cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jan-Willem Boer" <>
Subject catalog and xslt document() function
Date Thu, 21 Jun 2007 11:07:05 GMT

I ran into a problem with the catalog file and the xslt document() function.

To include a document into the XML that flows through a Cocoon pipeline, 
I am using the document() function in an XSLT stylesheet:
    <xsl:copy-of select="document(@path)"/>

The document-to-include contains a DOCTYPE declaration referring to an 
external entity:
    <!DOCTYPE something PUBLIC "-//Company//DTD SOMETHING-XML//NL" 

I added the DTD-file to the directory WEB-INF/entities and added a line 
to the catalog file containing the PUBLIC and SYSTEM identifiers.

The problem occurs when i use the document function to include the 
document directly with an absolute path, the catalog file is ignored, 
and the DTD is not found.
To circumvent this, I was forced to redirect the document() function to 
a cocoon pipeline like this:
    <xsl:copy-of select="document('cocoon://get-file/' + @path)"/>
instead of
    <xsl:copy-of select="document(@path)"/>

Cocoon reads the catalog and does not complain, so at least I have it 
working now.

I was wondering (1) if this is expected behaviour (2) if there is 
another, more elegant way to solve this: can the XSLT processor be 
instructed to read the catalog somehow?

Jan Willem Boer

View raw message