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

looping through global parameters

Subject: looping through global parameters
From: Ann Marie Rubin <Annmarie.Rubin@xxxxxxx>
Date: Fri, 12 Nov 2004 15:57:46 -0500
xsl looping
Hello List,

I have a stylesheet that defines 2 global parameters: attr and value.
The stylesheet has a template that matches all attributes, and if the
current attribute name matches the global attr, outputs value.

    <xsl:template match="@*" priority="10">
    <xsl:attribute name="{name()}">
   
            <xsl:choose>
                <xsl:when test="name()=$attr"><xsl:value-of
select="$value"/></xsl:when>
                <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
            </xsl:choose>
        </xsl:attribute>
      </xsl:template>
     

Requirements have changed and now the calling process will parse the
stylesheet to write a set of global parameters for the values that need
to be updated, like so:

<xsl:param name="attr">temporary-directory</xsl:param>
<xsl:param name="value">/var/temp</xsl:param>
<xsl:param name="attr1">search-local-classes-first</xsl:param>
<xsl:param name="value1">false</xsl:param>
.
.
.

Is there a way to loop through the global attributes and call the
template for each one?

Thanks,

Ann Marie

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.