[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Comma in between!
Hi,
> > I have this structure, where I need to insert a comma in > between all <B> > nodes and <C>. There can be one, two or three <B>s. The first <B> will > always start at position 2. The number of nodes after <C> changes. > > <Root> > <A>a</A> > <B>b1</B> > <B>b2</B> > <B>b3</B> > <C>c</C> > <D>d</D> > <E>e</E> > <F>f</F> > </Root> With my little knowledge I can only think of following solution :- <xsl:template match="/Root"> <xsl:for-each select="child::B | child::C"> <xsl:if test="position() > 1"> <xsl:text>, </xsl:text> </xsl:if> <xsl:value-of select="."/> </xsl:for-each> </xsl:template> Cheers. Arun From: "Michael Kay" <mhk@xxxxxxxxx> Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Subject: RE: Comma in between! Date: Mon, 13 Sep 2004 12:04:37 +0100 _________________________________________________________________ Is cricket your religion? Check out the cricket shop! http://www.msn.co.in/Shopping/CricketShop/ CDs, books n all things cricket!
|
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
|