xsl-list
[Top] [All Lists]

[xsl] Get preceding sibling name issue

2008-04-14 07:45:26
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

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

<Prev in Thread] Current Thread [Next in Thread>