JXPathContext returns null for some xml documents if element have first
character in upper case or ' _' in xml
---------------------------------------------------------------------------------------------------------------
Key: JXPATH-136
URL: https://issues.apache.org/jira/browse/JXPATH-136
Project: Commons JXPath
Issue Type: Bug
Reporter: vaibhav kumthekar
Dear Sir,
I am using JXPath in my code and facing some strange issue. The issue is
"JXPathContext returns null for some xml documents. I parsed 2 XMLs:
1. <getName><name>vaibhav<name><getName>
2. <GetName><Name>vaibhav<Name><GetName>
In first case, my xpath "/getName/name" gives me the correct value i.e.
'vaibhav'.
But in second case, "/GetName/Name" gives me null (I have set lenient = true).
Please note that in XML as well as in expression "GetName" starts with Capital
letter "G". Somehow JXPath can't find the path and hence return null. Here, in
second case, if I give JXPath Expression as "/getName/name" then only it gives
me value as 'vaibhav'.
I have found similar changes in case of use of '_'(underscore). e.g. x_Name. My
xpath needs to change for such kind of XMLs.
Is it a bug or normal behaviour? Can you please provide us the list of changes
I would need to do in my xpath to resolve such issues?
Normally user gives JXPath expression depending on XML document that he wants
to parse. Thus both Expression and XML Document can be consistent. And hence I
think that the JXPath should not change the case of first letter. JXPath
expression should remain as is (i.e. same as what user has provided)
Please provide reply to our queries and comments on the suggestion.
Thanks,
Vaibhav
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.