|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: <xsl:sort>
> <xsl:template match="document">
> ...
> <xsl:for-each select="child::node()">
> <!--
> Avoid the first two nodes occuring in document order.
> They have already been address above.
> -->
> <xsl:if test="position() > 2">
> <xsl:apply-templates select="." />
> </xsl:if>
> </xsl:for-each>
> <xsl:apply-templates select="product">
> <xsl:sort select="category" data-type="number"
> order="descending" />
> </xsl:apply-templates>
You're applying templates to all the child nodes after the second, and then
you're applying templates to all the child nodes that are products. These
categories presumably overlap. I haven't followed what you're trying to
achieve, but this looks very odd.
Incidentally this could be rewritten
<xsl:template match="document">
...
<xsl:apply-templates select="child::node()[position() > 2]"/>
<xsl:apply-templates select="child::product">
<xsl:sort.../>
</xsl:apply-templates>
</xsl:template>
Michael Kay
http://www.saxonica.com/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








