xsl-list
[Top] [All Lists]

RE: following-sibling usage

2003-02-21 08:02:10
If you want the element that immediately follows the SOUSTHEME child of
the context node, write

SOUSTHEME/following-sibling::*[1]

The thing that follows the axis name in a step is a NodeTest. It tests
the node at the end of the axis, it doesn't determine where the
navigation starts from.

Michael Kay
Software AG
home: Michael(_dot_)H(_dot_)Kay(_at_)ntlworld(_dot_)com
work: Michael(_dot_)Kay(_at_)softwareag(_dot_)com 

-----Original Message-----
From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com 
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com] On Behalf Of 
s-oualid(_at_)artefrance(_dot_)fr
Sent: 21 February 2003 13:46
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] following-sibling usage


Hello there,

I have a problem while using the following-sibling axis. Here's an 
simplified example of my XML data :

  <FICHE cdId="663" catanetId="13343" type="P" lang="FRA">
    <TITRE>140 000 CHINOIS POUR LA GRANDE GUERRE</TITRE>
    <THEME>Histoire</THEME>
    <SOUSTHEME>Histoire Contemporaine</SOUSTHEME>
    <GENERIQUE>
      <GENERAL>
        <ENTREE lib="Durée">
          <VALEUR>52 min</VALEUR>
        </ENTREE>
<!-- MORE SUBTAGS HERE -->
      </GENERAL>
<!-- MORE SUBTAGS HERE -->
  </FICHE>

I want to make a test on the following sibling SOUSTHEME (subtag of 
FICHE), as my test always returned FALSE, I decided to write 
the data. Here's what I got in my xsl:for-each select="FICHE" :

current : <xsl:value-of select="SOUSTHEME" />
following : <xsl:value-of select="following-sibling::SOUSTHEME[1]" />

And here's the output :

current : Biographie 
following :

As you see, this expression failed : 
select="following-sibling::SOUSTHEME[1]". How should I use 
the following 
sibling axis... I can't find my error ! :/

Any help would be appreciated. Thanks !

Simon

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



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