Hi,
Is anyone able to help me? I have the following code and when I try to
create an XPathNavigator object it keeps returning null. any cunning
ideas?
private void loadXMLDoc(String xml)
{
xmlDoc = new XmlDocument();
xmlDoc.LoadXml(xml);
namespaceManager = new
XmlNamespaceManager(xmlDoc.NameTable);
namespaceManager.AddNamespace("ns1",
"urn:soj-deltascheme-com.supplierinquiry.v1");
}
private String getFieldValue(String xpath)
{
return getFieldXPN(xpath).Value;
}
private XPathNavigator getFieldXPN(String xpath)
{
XPathNavigator xpn =
xmlDoc.CreateNavigator().SelectSingleNode(xpath, namespaceManager);
return xpn;
}
The XPath I am using is
"/ns1:Invoice/ns1:InvoiceDetail/ns1:CompanyNumber"
I have copied the xml into OxygenXML and then tested this xpath against
that within Oxygen and it works just fine. But for some reason in this
code it returns null instead of "3000".
thanks very much
cheers
Bruce