You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Sébastien JALLOT - AgOA <se...@agoa-fr.net> on 2001/03/23 09:34:32 UTC
XSLT problem
Could someone help me ?
Here's the Xml file :
<MENU>
<MENU1>
<M_LIBELLE>Administration</M_LIBELLE>
<M_URL />
<M_ACTIF>0</M_ACTIF>
<NBSM>5</NBSM>
<SOUSMENU id="1">
<S_LIBELLE>indexation</S_LIBELLE>
<S_URL>$PHP_SELF</S_URL>
<S_ACTIF>0</S_ACTIF>
</SOUSMENU>
<SOUSMENU id="2">
<S_URL>modifglob.php</S_URL>
<S_LIBELLE>modification globale</S_LIBELLE>
<S_ACTIF>0</S_ACTIF>
</SOUSMENU>
<SOUSMENU id="3">
<S_URL>supglob.php</S_URL>
<S_LIBELLE>Supression Globale</S_LIBELLE>
<S_ACTIF>0</S_ACTIF>
</SOUSMENU>
<SOUSMENU id="4">
<S_URL>informations.php</S_URL>
<S_LIBELLE>Informations</S_LIBELLE>
<S_ACTIF>0</S_ACTIF>
</SOUSMENU>
<SOUSMENU id="5">
<S_URL>Infosql.php</S_URL>
<S_LIBELLE>Fenêtre SQL</S_LIBELLE>
<S_ACTIF>0</S_ACTIF>
</SOUSMENU>
</MENU1>
<MENU2>
<M_LIBELLE>Fonctions</M_LIBELLE>
<M_URL />
<M_ACTIF>0</M_ACTIF>
<NBSM>2</NBSM>
<SOUSMENU id="1">
<S_LIBELLE>Contrôle Doublon</S_LIBELLE>
<S_URL>$PHP_SELF?ILS_DOC|DOC_TITRE</S_URL>
<S_ACTIF>0</S_ACTIF>
</SOUSMENU>
<SOUSMENU id="2">
<S_LIBELLE>Informations Réservations</S_LIBELLE>
<S_URL>reservations.php</S_URL>
<S_ACTIF>0</S_ACTIF>
</SOUSMENU>
</MENU2>
</MENU>
Here's the XSL file :
/*/
<xsl:for-each select="/MENU/*" >
<xsl:if test="position()!=last()">
"<xsl:apply-templates select="M_LIBELLE" />","",<xsl:value-of
select="count(SOUSMENU)" /> ,
</xsl:if>
<xsl:if test="position()=last()">
"<xsl:value-of select="M_LIBELLE" />","",<xsl:value-of
select="count(SOUSMENU)" />)
</xsl:if>
</xsl:for-each>
/*/
THis give me "Administration","",0 <- doessomeone has an idea on how could I
count the number of items "sousmenu" ?
Thanks !
Seb