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

RE: xsl:param xsl:copy-of

Subject: RE: xsl:param xsl:copy-of
From: Jarno.Elovirta@xxxxxxxxx
Date: Tue, 15 Apr 2003 10:36:38 +0300
param xsl
Hi,

> If I have a structure like - 
> 
> <xxx>
> <a>
> <b>
> <c>
> </xxx>
> 
> in a vairiable X1 can I do the follwing -
> 
> <xsl:call-template>
> <xsl:with-param name="X1" select="$X1(not(position() =
> 1))" />
> </xsl:call-template>
> 
> to get -
> 
> <xxx>
> <b>
> <c>
> </xxx>
> 
> for the next iteration?

Unless you use exslt:node-set or XSLT 1.1/2.0, you can't modify the node-set. You should consider passing the node-set $X1 as such, and have another parameter to define the index of the containing element to be processed, i.e.

<xsl:template name="foo">
  <xsl:param name="X1" select="/.." />
  <xsl:param name="index" select="1" />

  <xsl:if test="$i &lt;= count($X1/*)">
    <xsl:for-each select="$X1/*[position() = $index]">
      ...
    </xsl:for-each>
    <xsl:call-template name="foo">
      <xsl:with-param name="X1" select="$X1" />
      <xsl:with-param name="index" select="$index + 1" />
    </xsl:call-template>
  </xsl:if>
</xsl:template>

Or you can pass

  <a />
  <b />
  <c />

(no wrapper element) and when recursing, pass if forwars with select="$X1[not(position() = 1)]". Did that make any sense to you?

Cheers,

Jarno - VNV Nation: Fallout


 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.