Subject: Re: [xsl] When first Node add a style in XSL From: Michael Ludwig <mlu@xxxxxxxxxxxxx> Date: Fri, 16 May 2008 16:22:25 +0200 |
How do I put the proper test in for the first Node I encounter, add a top border:?
<xsl:template match="category"> <xsl:choose> <xsl:when test="first::category">
If you want to test whether an element node is the first one in a given node-set, you can proceed as follows:
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text"/> <xsl:template match="/"> <xsl:apply-templates select="//Elm"/> </xsl:template> <xsl:template match="Elm[1]"> <xsl:text>first one </xsl:text> </xsl:template> <xsl:template match="Elm"> <xsl:text>not the first one </xsl:text> </xsl:template> </xsl:transform>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] When first Node add a style i, Dan Acuff | Thread | RE: [xsl] When first Node add a sty, Dan Acuff |
Re: [xsl] Conditional Setting of a , Tony Graham | Date | RE: [xsl] When first Node add a sty, Dan Acuff |
Month |