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

XSL:T Spec - qname processing - Question/Suggestion

Subject: XSL:T Spec - qname processing - Question/Suggestion
From: Peter Bray <pdb_ml@xxxxxxxxxxxx>
Date: Mon, 4 Mar 2002 12:58:39 +1100 (EST)
xsl apply templates qname
Greetings,

	Being the programming type I find it strange that the XSL:T standard
does not allow variables / parameters expansion in qnames such as
"mode" in <apply-templates>.

	While I have read part of XSL:T and XML standards regarding qnames I
can't  really see why simple variable/parameter expansion is not
permitted.

	Will this change in XSLT 2.0 ?

Regards,
Peter

This might be best illustrated by an example.

INVALID XSLT
============

  <xsl:template name="generateTableRow">
    <xsl:param name="label"/>
    <xsl:param name="match"/>
    <xsl:param name="count"/>
    <xsl:param name="mode" select="''"/>

    <!-- Other Logic and Markup -->

    <xsl:apply-templates select="$match" mode="$mode"/>

    <!-- Other Logic and Markup -->

</xsl:template>

VALID XSLT
==========

  <xsl:template name="generateTableRow">
    <xsl:param name="label"/>
    <xsl:param name="match"/>
    <xsl:param name="count"/>
    <xsl:param name="mode" select="''"/>

    <!-- Other Logic and Markup -->

    <!-- xsl:apply-templates' mode is a qname
         and qnames do not seem to expand variable references :-( -->
    <xsl:choose>
      <xsl:when test="$mode = 'RequiredByGeneration'">
         <xsl:apply-templates select="$match"
                              mode="RequiredByGeneration"/>
      </xsl:when>
      <xsl:otherwise>
         <xsl:apply-templates select="$match"/>
      </xsl:otherwise>
    </xsl:choose>
          
    <!-- Other Markup and Logic -->

  </xsl:template>



http://movies.yahoo.com.au - Yahoo! Movies
- Vote for your nominees in our online Oscars pool.

 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.