예제 #1
0
        public void TestInit()
        {
            textDoc = new XmlDocument();
            textDoc.Load(File.OpenRead(@"Resources\\empty_main.xml"));

            XmlDocument responseDoc = new XmlDocument();

            responseDoc.Load(File.OpenRead(@"Resources\\response_example.xml"));

            XmlDocument customDataDoc = new XmlDocument();

            customDataDoc.Load(File.OpenRead(@"Resources\\custom_data_example.xml"));

            configParser = new ConfigParser(textDoc);
            foreach (XmlNode productNode in responseDoc.SelectNodes("//RemoteConfiguration/Products/Product/StaticData"))
            {
                XmlParser.SetNode(responseDoc, productNode.SelectSingleNode("//CustomData"), customDataDoc.SelectSingleNode("//CustomData/CustomVars"));
                XmlParser.SetNode(textDoc, textDoc.SelectSingleNode("//Products/Product"), productNode);
                configParser.EvalCustomVariables(textDoc.SelectSingleNode("//Products/Product/StaticData/CustomData/CustomVars"));
            }
        }