Hi All,
Am getting an error while selecting nodes from my XML document. But if I change the "X-path" expression used it is working fine. Can anyone help me to undestand what is wrong with my X-path?
Following X-path expression is giving error.
xmldom.SelectNo des("//[protype='abc' and proflag='1']")
Above line of code gives following exception in VS2005 [vb.net]
Run-time exception thrown : System.Xml.XPat h.XPathExceptio n - Expression must evaluate to a node-set.
But if I give the x-path as follows then it is working fine.
xmldom.SelectNo des("//proxml[protype='abc' and proflag='1']")
Can anyone tell why '//[condition]" does not work and "//node[condition]" works ?
Here is the sample XML which I am using.
<proxml>
<protype>abc</protype>
<prouid>demo</prouid>
<proflag>1</proflag>
</proxml>
Thanking you in advace
Apurva G.
Am getting an error while selecting nodes from my XML document. But if I change the "X-path" expression used it is working fine. Can anyone help me to undestand what is wrong with my X-path?
Following X-path expression is giving error.
xmldom.SelectNo des("//[protype='abc' and proflag='1']")
Above line of code gives following exception in VS2005 [vb.net]
Run-time exception thrown : System.Xml.XPat h.XPathExceptio n - Expression must evaluate to a node-set.
But if I give the x-path as follows then it is working fine.
xmldom.SelectNo des("//proxml[protype='abc' and proflag='1']")
Can anyone tell why '//[condition]" does not work and "//node[condition]" works ?
Here is the sample XML which I am using.
<proxml>
<protype>abc</protype>
<prouid>demo</prouid>
<proflag>1</proflag>
</proxml>
Thanking you in advace
Apurva G.
Comment