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

Re: xsl:apply-imports and (imported) default templates

Subject: Re: xsl:apply-imports and (imported) default templates
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 15 May 2014 15:07:07 -0000
Re:  xsl:apply-imports and (imported) default templates
On 15 May 2014, at 15:38, Rushforth, Peter peter.rushforth@xxxxxxxxxxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:

> Hi,
>
> We are using <xsl:apply-imports/> to allow an imported stylesheet to provide
custom javascript links in the head
> of the generated html page.
>
> The problem is that unless the imported stylesheet provides a do-nothing
template for this mode, the <xsl:apply-imports/>
> directive seems to invoke the default templates from either the imported
stylesheet or itself.  I thought, from reading
> the "manual", that xsl:apply-imports only invoked templates which have the
same mode as that of the invoking template.
>
> Why are the default templates apparently being invoked?  Thank you.
>


If I remember correctly, XSLT 1.0 was a bit vague on this and XSLT 2.0
clarified it, so processors may vary. XSLT 2.0 states that if no user-written
template is found to meet the criteria for xsl;apply-imports, the built-in
template is executed.

Built-in templates of course apply to every mode.

Michael Kay
Saxonica

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.