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

RE: xsl:with-param and imports?

Subject: RE: xsl:with-param and imports?
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 30 Dec 2004 19:31:04 -0000
xslt import param
> Why can I not use xsl:with-param with xsl:import and xsl:include?

import and include are things that happen while assembling the stylesheet
from a collection of modules. with-param is something that happens while
executing a stylesheet. Since they happen at different times, it wouldn't
make sense to use them together.
> 
> Or alternately, is there some other workaround for the following?

If stylesheet A declares a top-level stylesheet parameter <xsl:param
name="s"/>, then a stylesheet module B that imports A can define a value for
this parameter using <xsl:param name="s" select="1234"/>, or even
<xsl:variable name="s" select="1234"/>. (This is clearly stated in the XSLT
2.0 spec, it's implicit in the 1.0 spec.)

Michael Kay
http://www.saxonica.com/

> 
> I have my stylesheets, which require a top-level parameter called 
> citation-style.
> 
> These stylesheets then get imported into a document 
> stylesheet like so, 
> in which two primary templates get called:
> 
>    <xsl:import href="../citeproc.xsl"/>
>    <xsl:output method="xhtml" encoding="utf-8" indent="yes"/>
>    <xsl:strip-space elements="*"/>
>    <xsl:template match="/">
>      <html>
>        <head>
>          <title>Testing</title>
>        </head>
>        <body>
>          <div id="content">
>            <div id="main-content">
>              <xsl:apply-templates/>
>              <xsl:if test="//db:footnote">
>                <div id="notes">
>                  <h3>Notes:</h3>
>                  <xsl:apply-templates select="//db:footnote" 
> mode="footnote-list"/>
>                </div>
>              </xsl:if>
>              <div id="bibliography">
>                <h3>References</h3>
>                <xsl:call-template name="bib:format-bibliography">
>                  <xsl:with-param name="output-format" 
> select="'xhtml'"/>
>                </xsl:call-template>
>              </div>
>            </div>
>          </div>
>        </body>
>      </html>
>    </xsl:template>
> 
> While it's not essential to be able to set the citation-style 
> parameter 
> in this stylesheet, it would be nice (a document stylesheet 
> would often 
> imply a single citation-style).  But how?
> 
> Bruce

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.