This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: apply-imports
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] apply-imports
- From: Ruben Inoto <ris2 at alu dot ua dot es>
- Date: Tue, 20 Feb 2001 10:47:34 +0100
- References: <001601c09ac4$f94cc780$e9453c3e@oemcomputer>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hello Michael
>
> Your xsl:apply-imports call will look for a template that matches the
> current node (i.e. the root node) that has lower import precedence than the
> current template; and there isn't one. xsl:apply-imports always processes
> the current node, not its children.
I have added the template rule matching the root node to the XSL and it
doesn't work neither:
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
Anyway I have fixed the problem using one XSL to redirect to one of the two
(actually they will be three in the future) I use depending on the parameter
(using <xsl:processing-instruction>):
Is this one a good solution, or is the 'copy-of' at the end going to take a
lot of time?
Thank you,
------------- redirect.xsl --------------------
<xsl:param name="print">0</xsl:param>
<xsl:template match="/">
<xsl:choose>
<xsl:when test="$print='1'">
<xsl:processing-instruction name="xml-stylesheet">
href="probaimport.xsl" type="text/xsl"
</xsl:processing-instruction>
<xsl:processing-instruction name="cocoon-process">
type="xslt"
</xsl:processing-instruction>
</xsl:when>
<xsl:otherwise>
<xsl:processing-instruction name="xml-stylesheet">
href="probanormal.xsl" type="text/xsl"
</xsl:processing-instruction>
<xsl:processing-instruction name="cocoon-process">
type="xslt"
</xsl:processing-instruction>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="@*|*|text">
<xsl:copy-of select="."/>
</xsl:template>
----------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list