cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aurélien DEHAY" <>
Subject Re: Cocoon's issues with multiple stylesheets / multiple input do cuments
Date Tue, 29 Aug 2000 13:04:38 GMT
Thorbjørn Ravn Andersen <> writes:

> > to - the stylesheet is bolted onto the XML as surely as if 
> > they were the same
> > file.
> Cocoon 1 does not have any provisions for using an external
> mechanism to decide what style sheets to apply to a given XML file,
> but the Processing Instruction you are having trouble with.

But Cocoon offers to do a thing like this:

<?cocoon-process type="xslt"?>
<xsl:stylesheet xmlns:xsl="" xmlns:fo="">
  <xsl:param name="format">html</xsl:param>

  <xsl:template match="document">
		<xsl:when test="$format='pdf'">
		  <xsl:processing-instruction name="cocoon-format">type="text/xslfo"</xsl:processing-instruction>
		  <xsl:processing-instruction name="xml-stylesheet">version="1.0" href="/styles/xsl/document-pdf.xsl"</xsl:processing-instruction>
		<xsl:when test="$format='html'">
		  <xsl:processing-instruction name="cocoon-process">type="xslt"</xsl:processing-instruction>
		  <xsl:processing-instruction name="cocoon-format">type="text/html"</xsl:processing-instruction>
		  <xsl:processing-instruction name="xml-stylesheet">version="1.0" href="/styles/xsl/document-html.xsl"

		<xsl:apply-templates select="@*"/>
		<xsl:apply-templates select="node()"/>

  <xsl:template match="@*|*|text()">
		<xsl:apply-templates select="@*|*|text()"/>

Maybe it's not a beautifull peace of code, it's work.

> The standard answer is to use Cocoon 2 since such a mechanism is
> available there, but I have not tried it myself.

When snapshots of the CVSROOT will be online? I can't access to the
CVS (it's just beaucoup we don't have masquering here: whe're behind a


View raw message