W3C home > Mailing lists > Public > xsl-editors@w3.org > April to June 1999

Further comments on xsl:include

From: Jess M Holle <jessh@ptc.com>
Date: Tue, 29 Jun 1999 10:10:06 -0400
Message-ID: <3778D3BE.F13930EB@ptc.com>
To: xsl-editors@w3.org
I previously suggested that xsl:include allow XSL expressions for the
href attribute (or alternatively as an alternate 'expr' attribute which
replaces the href attribute in such cases).

Someone else suggested another possibility which I would like to
re-iterate:

If xsl:include was allowed elsewhere besides at the top-level of the
stylesheet, then one could work around the lack of inclusion
expressions.

For example:

<!-- main xsl file -->
<xsl:stylesheet>
  <xsl:param-variable name='locale'>en</xsl:param-variable>
  <xsl:include href="translationBundle.xsl"/>
  <!-- other xsl stuff -->
</xsl:stylesheet>

<!-- translationBundle.xsl -->
<xsl:stylesheet>
  <xsl:choose>
    <xsl:when test='starts-with($locale,"en")'>
      <xsl:include href="translationBundle_en.xsl"/>
    </xsl:when>
    <!-- other cases follow -->
  </xsl:choose>
</xsl:stylesheet>

This brings up a question:  How are input parameters dealt with during
inclusion evaluation?

The example above uses a 'locale' variable which is intended to
propagate from the top stylesheet into the translationBundle.xsl sheet
where it selects the appropriate translation bundle.  This obviously
makes certain assumptions about the handling of param-variable's.
Received on Tuesday, 29 June 1999 10:10:29 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:59:49 GMT