[xsl] Get preceding sibling name issue

Subject: [xsl] Get preceding sibling name issue
From: Don Don <progwihz@xxxxxxxxx>
Date: Mon, 14 Apr 2008 07:44:51 -0700 (PDT)
Hi all I am trying to get the last preceding sibiling
name for the <atext> element using the following xsl
code


The example in senario 1 works but that of senario 2
dosent work.  Anyway I can fix this ?  I need to get
the preceding name of the <atext> element in senario 2
(which should be spara1)

Cheers

senario 1
-----------------------------

<xsl:variable name="precedeName" select
="(name(./preceding-sibling::apara1 [last()]))" />
 Value:&#160;<xsl:value-of select="$precedeName" />

<docg>
    <apara1>xxx<apara1>
    <apara1>xxx<apara1>
    <apara1>xxx<apara1>
    <atext>hello</atext>
</docg>

senario 2
-----------------------------

<xsl:variable name="precedeName2" select
="(name(./preceding-sibling::spara1 [last()]))" />
 Value:&#160;<xsl:value-of select="$precedeName2" />

<docg>
<apara1>
    <spara1>xxx</spara1>
    <spara1>xxx</spara1>
    <spara1>xxx</spara1>
    <spara1>xxx</spara1>
    <atext>hello</atext>
<apara1>
</docg>



      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

Current Thread