When I use
SelectSingleNode("//meta[@name='keywords']")
it doesn’t work, but when I use the same case that used in original document it works good:
SelectSingleNode("//meta[@name='Keywords']")
So the question is how can I set case ignoring?
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.
If you need a more comprehensive solution, you can write an extension function for the XPath processor which will perform a case insensitive comparison. It is quite a bit of code, but you only write it once.
After implementing the extension you can write your query as follows
Where
Extensions:CaseInsensitiveComparisonis the extension function implemented in the sample below.NOTE: this is not well tested I just threw it together for this response so the error handling etc. is non-existent!
The following is the code for the custom XSLT Context which provides one or more extension functions
You can then use the above extension function in your XPath queries, here is an example for our case