cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: XML to PDF
Date Tue, 08 May 2001 01:33:01 GMT

here in the List I got a kind of super stylesheet which copies the xml
Nodes in a new xml file with the stylesheet given as a parameter.

You save this file for example as master.xml and declare this stylesheet in
your xml file. Then you can link to your xml file for example by

and the stylesheet in the file pdf.xsl is assigned to your xml.

The only disadvantage is, that your xml is now processed two times per
click, but in most cases that should not be a problem.

-----------------------------beginning of

<?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl=""
  version="1.0">     <xsl:param name="style"/>
      <xsl:template match="/">
          <!-- when style is specified -->
          <xsl:when test="$style">
            <xsl:processing-instruction name="xml-stylesheet">
              href="<xsl:value-of select="$style"/>" type="text/xsl"
            <xsl:processing-instruction name="cocoon-process">
          <!-- Otherwise use default.xsl -->
            <xsl:processing-instruction name="xml-stylesheet">
              href="default.xsl" type="text/xsl"
            <xsl:processing-instruction name="cocoon-process">
        </xsl:choose>         <xsl:apply-templates/>
      </xsl:template>       <!-- copy all elements -->
      <xsl:template match="@*|*|text">
        <xsl:copy-of select="."/>

-----------------------------end of master.xsl------------------------



Please check that your question has not already been answered in the
FAQ before posting. <>

To unsubscribe, e-mail: <>
For additional commands, e-mail: <>

View raw message