commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Benson (JIRA)" <>
Subject [jira] Resolved: (JXPATH-137) Issue while getting value for array element
Date Wed, 03 Mar 2010 20:02:27 GMT


Matt Benson resolved JXPATH-137.

    Resolution: Incomplete

It would appear that your xpath "/test/testRecArray/testRecArray" should be "/test/testRecArray/testRec".
 Please reopen if the reported problem occurs with that correction having been made.

> Issue while getting value for array element
> -------------------------------------------
>                 Key: JXPATH-137
>                 URL:
>             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.

View raw message