Hello,
I have been trying to get data from an xml file with a namespace. I
have followed the example in the MSDN, but I get no data in t he
XPathNodeIterator, but the file has the data I am trying to extract.
...
XPathNavigator navigator = xmlDoc.CreateNavigator();
// xpathQuery = "/ProductInformation/ProductNumber"
XPathExpression expr = navigator.Compile( xpathQuery );
expr = navigator.Compile( xpathQuery );
XmlNamespaceManager nsmgr = new XmlNamespaceManager( navigator.NameTable
);
nsmgr.AddNamespace( "myNS",
"http://www.orange.com/schemas/imaging/cyanblue/dev/1.0" );
expr.SetContext(nsmgr);
XPathNodeIterator iter = navigator.Select( xpathQuery );
while ( iter.MoveNext() )
{
XPathNavigator innerNav = iter.Current.Clone();
innerNav.MoveToFirstChild();
retVal = innerNav.Value;
}
..
As I stated earlier, "iter" has a count of 0 - has no nodes in it. Is
there somethign I ought to be doingthat I am not doing? What could be
the problem?
Thanks for your help.
orange
*** Sent via Developersdex http://www.developersdex.com ***