EclipseLink Moxy query by xpath using getValueByXPath [message #1753679] |
Wed, 08 February 2017 18:04 |
surya aditya Messages: 5 Registered: February 2017 |
Junior Member |
|
|
Given xml as follows:
<test>
<AlternateID>
<System>xyz</System>
<Type>four</Type>
<Value>0</Value>
</AlternateID>
<AlternateID>
<System>abc</System>
<Type>one</Type>
<Value>145287</Value>
<Version>01</Version>
</AlternateID>
<AlternateID>
<System>def</System>
<Type>two</Type>
<Value>123456</Value>
<Version>1</Version>
</AlternateID>
<AlternateID>
<System>ghi</System>
<Type>three</Type>
<Value>17032</Value>
</AlternateID>
</test>
Using eclipselink moxy for parsing the data and using getValueByXPath to get the values by querying using xpath. It works wonderfully except in the case if I use the following xpath
test/AlternateID[System='abc' and Type='one']/Value/text()
Appreciate if anyone can share any success with this, basically using 'AND' in xpath for selecting nodes based on values.
I have also tried xpath as
test/AlternateID[System/text()='abc' and Type/text()='one']/Value/text()
i have tried it as well but not working. i wonder if this feature is available in moxy getValueByXPath itself, as in the test cases I do not see such xpath being tested.
https://github.com/eclipse/eclipselink.runtime/blob/master/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/jaxbcontext/GetByXPathTests.java
thanks.
|
|
|
Powered by
FUDForum. Page generated in 0.02148 seconds