0

From the below example I need to extract the data of "value" field., when the string field name = "first". How should write the xpath in XSLT for the below JSONX sample to get the desired result.

Example:

<json:array name="filters">
<json:object>
<json:object>
<json:string name="name">first</json:string>
<json:string name="op">eq</json:string>
<json:string name="value">11223333</json:string>
</json:object>
<json:object>
<json:string name="name">second</json:string>
<json:string name="op">eq</json:string>
<json:string name="value">1234</json:string>
</json:object>
<json:object>
<json:string name="name">date</json:string>
<json:string name="op">between</json:string>
<json:string name="value">26/07/2016</json:string>
<json:string name="value2">26/07/2018</json:string>
</json:object>
</json:object>
</json:array>

Thanks,

Ann
  • 13
  • 4

1 Answers1

0

Try

//json:object[json:string[@name='name']='first']]
   /json:string[@name='value']/string()

(with a suitable namespace binding of course)

Michael Kay
  • 156,231
  • 11
  • 92
  • 164
  • @ApupaKS, the SO way of saying "Thankyou, it worked" is to mark the answer as accepted by clicking the tick/check mark next to the answer. That way the question is registered as having an accepted answer. – Michael Kay Aug 02 '18 at 20:06