|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: first of type element position
Hi Sébastien,
> <xsl:if test="position()!=1"> doesn't work because, i think, the
> first element <TOC.SECT> is in position()=2. and <TI.TOC> in
> position()=1.
You can test whether the TOC.SECT has a preceding sibling TOC.SECT
element:
<xsl:if test="preceding-sibling::TOC.SECT">
<!-- not the first TOC.SECT element -->
...
</xsl:if>
Or you could change the way that you apply templates to the elements,
so that the position() test would work. If you did:
<xsl:template match="RP.TOC">
...
<xsl:apply-templates select="TI.TOC" />
<xsl:apply-templates select="TOC.SECT" />
...
</xsl:template>
Then in the template matching the TOC.SECT elements, the set of nodes
to which you were applying templates would only contain TOC.SECT
elements, and the node in position 1 would be the first of those
TOC.SECT elements.
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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








