Subject: Re: [xsl] sort by xsl:if and then sort using templates? From: David Carlisle <davidc@xxxxxxxxx> Date: Mon, 20 Nov 2006 21:59:35 GMT |
xsl:sort have to be direct children of xsl:for-each (or xsl:aply-templates) you can not nest in xsl:if (or anything else) Just put the test on your select predicate or outside the xsl:apply-templates It's a bit hard to show exactly what you need to do as I think you over trimmed your stylesheet, but in general rather than <xsl:apply-templates> <xsl:if test="something"> <xsl:sort ..../> </xsl:if> </xsl:apply-templates> do either <xsl:apply-templates select="*[something]> <xsl:sort.../> </xsl:sort> or <xsl:choose> <xsl:when test="something"> <xsl:apply-templates> <xsl:sort ..../> </xsl:apply-templates> </xsl:when> <xsl:otherwise> <xsl:apply-templates/> </xsl:otherwise> depending on what you want to do if the predicate is false (no output, or no sorting, respectively) David
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] sort by xsl:if and then sort , Max Bronsema | Thread | Re: [xsl] sort by xsl:if and then s, Max Bronsema |
[xsl] oo2xhtml to RDF, Gannon Dick | Date | Re: [xsl] Using copy-of to grab chi, David Carlisle |
Month |