Hello all,
I am working on an Add-in to the .NET framework using C#. I wanted to
search the XML document using XPath but failed.
The XML is like this:
<unit xmlns="http://www.some.info/srcML"
xmlns:cpp="http://www.some.info/srcML/cpp">
<aaa>something</aaa>
</unit>
The code I am using is as follows:
XPathNavigator nav;
XPathDocument docNav;
XPathNodeIterator NodeIter;
string fname="sth.xml";
docNav = new XPathDocument(@fname);
nav = docNav.CreateNavigator();
nav.Evaluate(input);
NodeIter = nav.Select(input);
It works fine if there is no namespace in the XML file. I know the
problem is caused by namespace. I just don't know how to solve it. I
don't think I can use XSLT for this add-in. What shall I do :( ?
Thanks a lot,
Kelly