This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

XSL:T Spec - qname processing - Question/Suggestion


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]