Re: [xml] One question about XPath



On Wed, Oct 15, 2003 at 08:18:37PM +0200, MANU_TA wrote:
<main>

 <label_1>
  <sublabel_1>value1</sublabel_1>
  <sublabel_2>response1</sublabel_2>
 </label_1>

 <label_1>
  <sublabel_1>value2</sublabel_1>
  <sublabel_2>response2</sublabel_2>
 </label_1>

 <label_1>
  <sublabel_1>value3</sublabel_1>
  <sublabel_2>response3</sublabel_2>
 </label_1>

</main>

- My question is: Can I use XPath in order to obtain the <sublabel_2> 
value (responseX) from <sublabel_1> value (valueX)?. 
- Could you tell me what XPath "expresion" I have to use, please?

This means, with the "valueX" I would like to obtain "responseX" using 
XPath (is it possible?)

  picking the first one because teh node set may return multiple nodes:

   string((/main/label_1[sublabel_1 = 'valueX']/sublabel_2)[1])

  What about reading a book or an on-line resource like
    http://www.zvon.org/

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]