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

Re: apply-import and named templates

Subject: Re: apply-import and named templates
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Tue, 27 Feb 2001 09:34:18 +0000
xsl apply import
Hi Kelly,

> Is there a way to do the equivalent of <xsl:apply-imports/> on a
> named template? The spec mentions match templates only in the
> discussions about imports and conflict resolution, and Xalan-J 2 has
> a stack overflow if I try to use something like the following.

There isn't a way to do something like xsl:apply-imports with named
templates.

However, you might be able to change your named templates into
equivalent moded templates and thus be able to use xsl:apply-imports
instead.  If you change your templates to:

 file:///common.xsl:
 ------------------------------
 <xsl:template match="node()" mode="foo">
 bar
 </xsl:template>


 file:///special.xsl:
 ------------------------------
 <xsl:import href="common.xsl"/>
 
 <xsl:template match="node()" mode="foo">
 foo<xsl:apply-imports/>
 </xsl:template>
 ------------------------------

and then 'call' this moded template with:

  <xsl:apply-templates select="." mode="foo" />

rather than:

  <xsl:call-template name="foo" />

then that should work as you want it.

Of course there may be other ways around it - perhaps you can change
the name of the template in the importing stylesheet, and call the one
you're importing from within it?

I hope that helps anyway,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.