Exemple #1
0
        public void ReadPropertyTree_should_retain_prefix_map_in_nodes()
        {
            PropertyTreeReader reader = PropertyTreeReader.CreateXml(GetXmlReader("alpha.xml"));

            Assert.True(reader.Read());
            Assert.True(reader.Read());
            Assert.True(reader.Read());

            // The tree created here should also support ns resolving
            PropertyTree tree     = PropertyTreeReader.CreateXml(GetXmlReader("alpha.xml")).ReadPropertyTree();
            var          nav      = tree.CreateNavigator();
            var          resolver = (IXmlNamespaceResolver)nav;

            nav.MoveToFirstChild();
            Assert.Equal("a", nav.Name);
            Assert.Equal("https://ns.carbonfrost.com/commons/core",
                         resolver.LookupNamespace("shared"));
            Assert.Null(resolver.LookupNamespace(string.Empty));
        }