Exemplo n.º 1
0
 private XmlDocument HandleWsSetup()
 {
     return(Convert.ToDocument(InputBuilder.FromString(
                                   "<root>\n"
                                   + "<!-- trim\tme -->\n"
                                   + "<child attr=' trim me ' attr2='not me'>\n"
                                   + " trim me \n"
                                   + "</child><![CDATA[ trim me ]]>\n"
                                   + "<?target  trim me ?>\n"
                                   + "<![CDATA[          ]]>\n"
                                   + "</root>").Build()));
 }
Exemplo n.º 2
0
        // doesn't match
        public void SelectNodesWithDefaultNSNoPrefix()
        {
            IXPathEngine e = Engine;

            source = InputBuilder.FromString("<d xmlns='urn:test:1'><e/></d>")
                     .Build();
            Dictionary <string, string> m = new Dictionary <string, string>();

            m[string.Empty]    = "urn:test:1";
            e.NamespaceContext = m;
            IEnumerable <XmlNode> it = e.SelectNodes("/d/e", source);

            Assert.IsTrue(it.GetEnumerator().MoveNext());
        }
Exemplo n.º 3
0
        [Test] public void SelectNodesWithNS()
        {
            IXPathEngine e = Engine;

            source = InputBuilder.FromString("<n:d xmlns:n='urn:test:1'><n:e/></n:d>")
                     .Build();
            Dictionary <string, string> m = new Dictionary <string, string>();

            m["x"]             = "urn:test:1";
            e.NamespaceContext = m;
            IEnumerable <XmlNode> it = e.SelectNodes("/x:d/x:e", source);

            Assert.IsTrue(it.GetEnumerator().MoveNext());
        }
Exemplo n.º 4
0
        [Test] public void SelectNodesWithNS_NodeVersion()
        {
            IXPathEngine e   = Engine;
            XmlDocument  doc = new XmlDocument();

            doc.Load(InputBuilder.FromString("<n:d xmlns:n='urn:test:1'><n:e/></n:d>").Build().Reader);
            sourceRootElement = doc.DocumentElement;
            Dictionary <string, string> m = new Dictionary <string, string>();

            m["x"]             = "urn:test:1";
            e.NamespaceContext = m;
            IEnumerable <XmlNode> it = e.SelectNodes("/x:d/x:e", sourceRootElement);

            Assert.IsTrue(it.GetEnumerator().MoveNext());
        }