Hi All,
I have this weird problem. I have an xml document and tried to do an XPath
query to it. If I use the SelectSingleNod e method it throws an exception but
it works with SelectNodes method. Is this a known problem with XPath and
SelectSingleNod e?
Code snippet:
<snip>
XmlDocument xml= new XmlDocument();
xml.LoadXml(xml String);
XmlNamespaceMan ager namespaceManage r =
new XmlNamespaceMan ager(xml.NameTa ble);
namespaceManage r.AddNamespace( "defns", defns);
// return xml.DocumentEle ment.SelectSing leNode(xpath, namespaceManage r);
<-- does not work
return xml.DocumentEle ment.SelectNode s(xpath, namespaceManage r); // WORKS!
</snip>
so ... this is odd, does anyone has any explanation?
thanks,
/m
I have this weird problem. I have an xml document and tried to do an XPath
query to it. If I use the SelectSingleNod e method it throws an exception but
it works with SelectNodes method. Is this a known problem with XPath and
SelectSingleNod e?
Code snippet:
<snip>
XmlDocument xml= new XmlDocument();
xml.LoadXml(xml String);
XmlNamespaceMan ager namespaceManage r =
new XmlNamespaceMan ager(xml.NameTa ble);
namespaceManage r.AddNamespace( "defns", defns);
// return xml.DocumentEle ment.SelectSing leNode(xpath, namespaceManage r);
<-- does not work
return xml.DocumentEle ment.SelectNode s(xpath, namespaceManage r); // WORKS!
</snip>
so ... this is odd, does anyone has any explanation?
thanks,
/m
Comment