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

RE: [XSLT 2.0] Creating a changeable globally scoped v

Subject: RE: [XSLT 2.0] Creating a changeable globally scoped variable?
From: "Andreas L. Delmelle" <a_l.delmelle@xxxxxxxxxx>
Date: Sat, 20 Mar 2004 21:17:04 +0100
vars xml
> -----Original Message-----
> From: Roger L. Costello
>
> I need to write a stylesheet which dynamically alters the value of a
> globally scoped variable.
>

Hi,

To keep it short: that is impossible.

I have quite a hard time trying to understand from your description what
exactly your requirements are, so it would be a big help if you could more
precisely describe what you are after...


> Some thoughts come to mind:
>
<snip />
>
> 2. Create a range variable with a sequence of values.  From reading the
> specs this seemed promising.  Here's an example of how this might work:
>
>    <xsl:template match="/">
>       <xsl:value-of select="for $i in (1 to 10) return (ex:print())"/>
>    </xsl:template>
>
>    <xsl:function ex:print">
>        <xsl:value-of select="$i"/>
>    </xsl:function>
>

If it's something this simple, why not do for instance:

<xsl:variable name="i" select="document('vars.xml')/*/number[. > 0 and .
&lt;= 10]" />

Where the document vars.xml consists of nodes representing numbers, then
have a template matching them

<xsl:apply-templates select="$i" />
...
<xsl:template match="number">
  <xsl:value-of select="." />
</xsl:template>


Hope this gives you an idea...

Cheers,

Andreas


 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.