Subject: Re: [xsl] previous sibiling node value From: ram <ram_kurra@xxxxxxxxxxx> Date: Mon, 15 Nov 2010 00:47:59 +0530 (IST) |
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@xxxxxxxxx> wrote: > From: Dimitre Novatchev <dnovatchev@xxxxxxxxx> > Subject: Re: [xsl] previous sibiling node value > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Date: Monday, 15 November, 2010, 12:22 AM > On Sun, Nov 14, 2010 at 10:46 AM, ram > <ram_kurra@xxxxxxxxxxx> > 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@xxxxxxxxxxxxxxxxxxxxxx> > --~--
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] previous sibiling node va, Dimitre Novatchev | Thread | Re: [xsl] previous sibiling node va, Dimitre Novatchev |
Re: [xsl] previous sibiling node va, Dimitre Novatchev | Date | Re: [xsl] previous sibiling node va, Dimitre Novatchev |
Month |