Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » EclipseLink Moxy query by xpath using getValueByXPath(EclipseLink Moxy query by xpath using getValueByXPath)
EclipseLink Moxy query by xpath using getValueByXPath [message #1753679] Wed, 08 February 2017 18:04
surya aditya is currently offline surya adityaFriend
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.
Previous Topic:Eclipselink 2.6 does not work with MongoDB
Next Topic:NullPointerException on Eclipselink LAZY loading
Goto Forum:
  


Current Time: Tue Mar 19 03:32:22 GMT 2024

Powered by FUDForum. Page generated in 0.02148 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top