This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: apply-imports



 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]