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 Performance test failed at 95 percentile
Next Topic:MOXY problems with EntityResolver for DynamicJAXBContextFactory
Goto Forum:
  


Current Time: Thu Nov 23 15:15:58 GMT 2017

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

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