예제 #1
0
파일: xml.cs 프로젝트: Sciumo/gaigen
        /// <summary>
        /// Initializes an empty Specification from an XML document
        /// </summary>
        public static void InitFromXmlDocument(Specification S, XmlDocument doc)
        {
            XmlElement rootElement = doc.DocumentElement;
            //System.Console.WriteLine(rootElement.Name);
            if (rootElement.Name != XML_G25_SPEC)
                throw new G25.UserException("Missing root element " + XML_G25_SPEC + " in XML file.");

            ParseRootElement(S, rootElement);

            // initializes the RefGA.Metric variables of the m_metrics
            S.FinishMetric();

            // check if specification is sane
            S.CheckSpecificationSanity();
        }