[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: apply-import and named templates
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|