Example #1
0
        public void Subset()
        {
            XmlDocument doc1 = new XmlDocument();

            doc1.LoadXml(@"
				<root>
					<element1 attr2='2'>
						<uhus/>
					</element1>
				</root>
			"            );

            XmlDocument doc2 = new XmlDocument();

            doc2.LoadXml(@"
				<root>
					<element1 attr1='1' attr2='2'>
						<subelement1>uhus</subelement1>
						<uhus/>
					</element1>
				</root>
			"            );

            NavigatorUtils.IsSubsetOf(doc1.CreateNavigator(), doc2.CreateNavigator());
        }
Example #2
0
        public static void IsSubset(object o, string xml)
        {
            XmlDocument doc = new XmlDocument();

            doc.LoadXml(xml);

            ObjectXPathContext context = new ObjectXPathContext();

            context.NamespaceManager.AddNamespace("sdf", Namespaces.SDF);
            XPathNavigator nav = context.CreateNavigator(o);

            nav.MoveToRoot();

            NavigatorUtils.IsSubsetOf(doc.CreateNavigator(), nav);
        }