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

Re: 'xsl:variable' as dynamic select for 'xsl:for-each

Subject: Re: 'xsl:variable' as dynamic select for 'xsl:for-each'...
From: Philippe Drix <pdrix@xxxxxxxxxxxx>
Date: Mon, 17 Nov 2003 14:03:50 +0100
xsl for each select variable
At 12:15 17/11/2003 +0000, you wrote:

Of course, this doesn't work either...

    <xsl:variable name="selectclause">
      <xsl:choose>
        <xsl:when test="$clientid = ''">"//client"</xsl:when>
        <xsl:otherwise>"//client[$clientid]"</xsl:otherwise>
      </xsl:choose>
    </xsl:variable>

use: <xsl:when test="$clientid = ''"><xsl:copy-of select="//client"/></xsl:when>



and then, your for-each will work fine.

  <xsl:for-each select="$selectclause">
        my code
  </xsl:for-each>

Perhaps : <xsl:for-each select="$selectclause/*"> my code </xsl:for-each>

It depends on your code.

This will work with Saxon and version="1.1"
Otherwise, use the function nodeset() :

<xsl:for-each select="nodeset($selectclause)/*">
etc.

Regards
Ph D


== Philippe Drix ___________ __| OBJECTIVA |___________________ http://www.objectiva.fr 21-23, rue Aristide Briand - 92170 Vanves tel : +33 1 47 36 60 30 cel : 06 74 78 34 97 fax : +33 1 47 36 61 93



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.