Suppose I have this XML document ...
<root>
<str name="My node attribute">My string value</str>
</root>
I want to get the value of the str element based on the known value of the element's name attribute, so I use the following XPath query ...
str[@name='My node attribute']
But this does not work for me, at least not in classic ASP and C # because of a single quote, which, of course, conflicts with the single quotes used in XPath syntax. An exception is thrown in both cases.
What is a possible solution here if I have a limitation that I cannot modify the XML document.
source
share