0

I have this

    XPathExpression expr = xpath.compile("/job/entries/entry/name/text()");

I need to filter by the text value of the type property so I only get the entry objects that have the value JOB in the type.

<job>
 <entries>
    <entry>
      <name>OperationalDataStoreToReconciled</name>
      <description/>
      <type>JOB</type>
    </entry>
 </entries>
</job>
nicomp
  • 4,344
  • 4
  • 27
  • 60
  • Possible duplicate of [XPath select based on child value(s)](https://stackoverflow.com/questions/41027096/xpath-select-based-on-child-values) – Coronero Jul 11 '19 at 15:03
  • Is it not your case? https://stackoverflow.com/questions/6282579/xpath-query-to-filter-values-on-certain-attributes-only – prasingh Jul 11 '19 at 15:04

1 Answers1

1

Use the below xpath.

 //job/entries/entry[./type[.='JOB']]

Screenshot:

enter image description here

supputuri
  • 13,644
  • 2
  • 21
  • 39