Issue while getting value for array element
-------------------------------------------
Key: JXPATH-137
URL: https://issues.apache.org/jira/browse/JXPATH-137
Project: Commons JXPath
Issue Type: Bug
Reporter: vaibhav kumthekar
Dear Sir,
I am subscribed user.
I am using JXPath and facing an issue while getting a value for array element.
Scenario: My XML is like this:
<test>
<testRecArray>
<testRec>......</testRec>
<testRec>......</testRec>
</testRecArray>
</test>
To get the value for each testRec element, I would iterate through the
testRecArray element using xpath
context.iterate("/test/testRecArray/testRecArray") and get the iterator.
But, I am getting null for this xpath. I am using the same pattern for other
XMLs and it works fine for me. e.g.
<test>
<testRecList>
<testRec>......</testRec>
<testRec>......</testRec>
</testRecList>
</test>
It works for the /test/testRecList/testRecArray xpath.
I can smell that the problem could be because of the element which holds array
elements have 'Array' in its name. JXPath internally could be checking for such
names and as this is not an array element but parent element, path is
unexpected and returns me null.
Please advise what should be xpath in such cases.
Thanks and regards,
Vaibhav
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.