I don’t know exactly why the xpath expression:
//h3[text()='Foo › Bar']
doesn’t match:
<h3>Foo › Bar</h3>
Does that seem right? How do I query for that markup?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
XPath does not define any special escape sequences. When XPath is used within XSLT (e.g. in attributes of elements of an XSLT document), the escape sequences are processed by the XML processor that reads the stylesheet. If you use XPath in non-XML context (e.g. from Java or C# or other language) via a library, and your XPath query is a string literal in that language, you won’t get any escape processing aside from that which the language itself usually does.
If this is C# or Java, this should work:
As a side note, it wouldn’t work in XSLT either, as XSLT uses XML, which doesn’t define a character entity
›– it only defines<,>,",'and&. You’d have to either use艐, or define the character entity yourself in DOCTYPE declaration of the XSLT stylesheet.