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

Re: foreach, preceding-sibling::node() and following-

Subject: Re: foreach, preceding-sibling::node() and following-sibling::node()
From: Ragulf Pickaxe <ragulf.pickaxe@xxxxxxxxx>
Date: Wed, 26 Oct 2005 15:34:05 +0200
xsl for each preceding sibling
I am not sure what you want either.

For the examples of your input and output the following three
templates should work:

<xsl:template match="abs">
  <xsl:apply-templates/>
</xsl:template>

<xsl:template match="idlink">
  <xsl:variable name="urlnumber" select="count(preceding::idlink)+1"/>
  <a href="url{$urlnumber}"><xsl:value-of select="."/></a>
</xsl:template>

<xsl:template match="i|b|u|em"> <!-- And more elements -->
  <xsl:copy>
    <xsl:apply-templates/>
  </xsl:copy>

<!-- This template is not needed as this is the same as the default
template for text nodes, but is added for clarity: -->
<xsl:template match="text()">
  <xsl:value-of select="."/>
</xsl:template>

Is this what you need?

Regards,
Ragulf Pickaxe :-)

On 10/26/05, David Carlisle <davidc@xxxxxxxxx> wrote:
>
>
> > Actually, I do want the content between the two idlinks and, that's where
> > I'm stuck. This is what I need:
> > Xml input file:

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.