Subject: Re: [xsl] problem of result returned by variable From: "andrew welch" <andrew.j.welch@xxxxxxxxx> Date: Tue, 22 Aug 2006 09:50:46 +0100 |
problem of result returned by variable I explain my problem between <!-- -->
<xsl:output method="html" media-type="text/html; charset=ISO-8859-1" version="4.0"/> <xsl:template match="/"> <html> <body> <table border="0" width="*" > <tr><th>Nombre noeud</th> <th>Numero du A</th> </tr> <xsl:call-template name="doc"> <xsl:with-param name="requete" select="document('requete.xml')/requete"/> </xsl:call-template>
</table> </body> </html> </xsl:template> <xsl:template name ="doc" match="LISTE-A"> <xsl:param name="requete"/> <xsl:call-template name="doc2"> <xsl:with-param name="requete" select="$requete"/> <xsl:with-param name="varReq1" select=".//DEP = $requete/DEP and .//ANI= $requete/ANI"/>
</xsl:call-template> </xsl:template> <xsl:template name ="doc2" match="LISTE-A"> <xsl:param name="varReq1"/> <xsl:param name="requete"/> <xsl:value-of select=".//DEP = $requete/DEP and .//ANI= $requete/ANI"/> <xsl:for-each select="//A">
<xsl:choose> <xsl:when test=".//DEP = $requete/DEP and .//ANI= $requete/ANI">
The test is now using DEP and ANI descendants of the context node (which is <A>) so its only checking descendants of each <A> in the document this time which is why you get a different result - do you really mean to use ".//" and not just "//"?
Either way if you are checking the same global condition you should really make it a global variable.
cheers andrew
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] problem of result returned by, corine amel zayanie | Thread | [xsl] Saxon removes namespace in XH, M 1879 |
RE: [xsl] spirit an xml element awa, Michael Kay | Date | Re: [xsl] change element to sibling, Mukul Gandhi |
Month |