xsl-list
[Top] [All Lists]

Re: [xsl] previous sibiling node value

2010-11-14 13:18:12
Thanks that perfectly works. 
       let us suppose if i get qmNumber as 01 then i need to get BRKQM
if i get qmNumber is 02 then i need to get BEKQM
i have written the logic like below but I am not able to go second QMNUmber

if QMNumber is 2 its failing.Its showign only qmnumber 1

$qmNumberFromContext is variable which will come either 01/02
$serviceType is Response

<xsl:choose>
        <xsl:when test="$serviceType/QMNumber=$qmNumberFromContext">
          <xsl:value-of  
          select="$qmNumberFromContext/precedingibling::QMName[1]/text()"/>

        </xsl:when>
         <xsl:otherwise/>  
 
</xsl:choose>
--- On Mon, 15/11/10, Dimitre Novatchev <dnovatchev(_at_)gmail(_dot_)com> wrote:

From: Dimitre Novatchev <dnovatchev(_at_)gmail(_dot_)com>
Subject: Re: [xsl] previous sibiling node value
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Date: Monday, 15 November, 2010, 12:22 AM
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>
--~--





--~------------------------------------------------------------------
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>
--~--