I have a XML document with elements like
<offer>
<field name="name"><![CDATA[DS SIL CON]]></field>
<field name="merchant_ id"><![CDATA[3001]]></field>
.....
</offer>
I know not the best XML! Now I am selecting different values by XPath
having an XmlNode representing the <offer> element. Now when I try something
like this
XmlNode dataNode = offerNode.Selec tSingleNode("fi eld[@name='merchant _id']");
this works fine and returns a result. However the following query runs but
returns nothing:
XmlNode dataNode = offerNode.Selec tSingleNode("fi eld[@name='name']");
Now the only thing I can think of is that the attribute and text have the
same value. I tried the same query as an XPathExpression :
XPathExpression searchData = navigator.Compi le(("field[@name='name']");
XPathNodeIterat or iter = navigator.Selec t(searchData);
and surprise surprise it works.
So is this a bug in using the SelectNodes() or SelectSingleNod e methods on
an XmlNode?