[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: first of type element position

Subject: RE: first of type element position
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Tue, 12 Mar 2002 10:41:37 -0000
type of position
(1) use <xsl:strip-space elements="*"/> so that the first TOC.SECT element
is also the first node.

(2) use two template rules:

<xsl:template match="TOC.SECT[1]">
<xsl:template match="TOC.SECT">

The first one will match the first TOC.SECT, the second will match all the
others.


Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Sébastien
> Tisserant
> Sent: 12 March 2002 10:01
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  first of type element position
>
>
> hello,
>
> i have this XML:
>
> <RP.TOC>
> <TI.TOC>...</TI.TOC>
> <TOC.SECT>aaa....</TOC.SECT>
> <TOC.SECT>bbb....</TOC.SECT>
> <TOC.SECT>ccc....</TOC.SECT>
> <TOC.SECT>ddd....</TOC.SECT>
> <TOC.SECT>eee....</TOC.SECT>
> </RP.TOC>
>
> and this template:
>
> <xsl:template select="TOC.SECT">
> <xsl:if test="the TOC.SECT selected is not the  first TOC.SECT">
> ....
> </xsl:if>
> ......
> </xsl:template>
>
> <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.
>
> could you help writing this test properly ?
>
> thanks
> Sébastien
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>
>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.