# Xpath

**URL:** <https://www.ruby-forum.com/t/xpath/160269>\
**Category:** IT\
**Created:** [February 13, 2009, 3:38pm UTC](https://www.ruby-forum.com/t/xpath/160269 "2009-02-13T15:38:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![palberto](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/7ea924/32.png) [@palberto](https://www.ruby-forum.com/u/palberto)\
**Post date:** [February 13, 2009, 3:38pm UTC](https://www.ruby-forum.com/t/xpath/160269/1 "2009-02-13T15:38:50Z")

</div>

Ciao a tutti,

vorrei porre un quesito:

E’ possibile, medinate l’uso di Ruby REXML, ottentere l’intero percorso  
per arrivare dalla radice (di un foglio XML) al nodo foglia risultato di  
una query XPath?

esempio, dato l’XML:

 ... 

Xpath: //terzo[@id=‘3’]

Output:  
//primo/secondo/terzo[id=‘3’]

Grazie in anticipo.  
Alberto
