Une partie de mon xml-file:XPath récursive
<table>
<row id="aant">
<radio id="radaant">
<omschrijving>test radio</omschrijving>
<omschrijving>part 2</omschrijving>
<table>
<row id="testrow">
<radio id="testrad">
<omschrijving>test radio deeper</omschrijving>
<table/>
</radio>
</row>
</table>
</radio>
</row>
</table>
Je voudrais obtenir le "omschrijving" sous la radio tag avec id = "radaant". Depuis "omschrijving" est aussi plus profond chez l'enfant, je reçois toujours "test radiopart 2test radio plus profond" comme résultat, mais je veux juste "test radiopart 2".
Je suis actuellement en utilisant XPath: expr = xpath.compile ("/ table/rangée [@ id = 'Aant']/Radio [@ id = 'radaant']/omschrijving")
Comment est-ce que je peux changer ma chaîne de xpath pour obtenir seulement le "omschrijving" du noeud courant?
Je ne peux pas reproduire votre problème: votre xpath sélectionne les deux éléments 'omschrijving' désirés –