xsl-list
[Top] [All Lists]

use-when attribute?

2004-12-16 18:40:45
I'm trying to understand the details of the use-when attribute in the latest XSLT 2.0 draft. Is the below a valid use?

<xsl:import href="output-xhtml.xsl" use-when="$output-format='xhtml'"/>

I'm trying to work out this idea of mine of designing for multiple output targets.

So what I want to do is is define an output-format parameter in my main stylesheet (as above). Likewise, I'd have a parameter for input format. I then want to condition which drivers get imported based on these parameters using the use-when attribute.

The main stylesheet would then get imported into other stylesheets like:

  <xsl:import href="citeproc.xsl"/>
  <xsl:template match="/">
    <xsl:apply-imports>
      <xsl:with-param name="output-format" select="xhtml" tunnel="yes"/>
    </xsl:apply-imports>
    <html>
      <head>
        <title>Testing</title>
      </head>
      <body>
        <div id="content">
          <div id="main-content">
            <xsl:apply-templates/>
            <div id="bibliography">
              <xsl:copy-of select="$formatted-biblist"/>
            </div>
          </div>
        </div>
      </body>
    </html>
  </xsl:template>

Do I have the right idea here?

Bruce


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>