xsl-list
[Top] [All Lists]

Re: [xsl] previous sibiling node value

2010-11-14 12:52:51
On Sun, Nov 14, 2010 at 10:46 AM, ram <ram_kurra(_at_)yahoo(_dot_)co(_dot_)in> 
wrote:
Hi,
  I am trying to get the current node's preceding-sibling node value.
Here is my xml


 <Policy Service="response">
     <QMName>BRKQM</QMName>>
     <QMNumber>01</QMNumber>
     <QMName>BEKQM</QMName>>
     <QMNumber>02</QMNumber>
     <RequestQueue>TEST.RSP</RequestQueue>
  </Policy>
                Let us suppose if my qmNumber is 02 i need to go to prevoius 
node QMName and get BEKQM.
         How can i do this .


Use:

/*/QMNumber[. = 2]/preceding-sibling::QMName[1]/text()

This expression can be used in many xslt instuctions -- in attributes
such as "select" or "test" .

-- 
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
Never fight an inanimate object
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--