cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject How can I get both a HTML and a PDF output from the same XML source file?
Date Thu, 01 Jan 1970 00:00:00 GMT
I thoroughly read the FAQ (in particular the "How do I chain stylesheets" 
item) and I tried hard to get both a (X)HTML and a PDF output from the
same XML source file by applying two different XSL-T stylesheets.

The first stylesheet is a regular XML->(X)HTML converter and it works fine.

The second stylesheet tries to create a XSL-FO file from the XML source
and post-process it with the Cocoon XSL:FO engine. This second XSL-T
stylesheet does not work. I'm able to get a valid PDF file sent to my
internet browser (MS IE 5.5 on Windows 98) but this PDF file is presented 
in the browser window as it was a ASCII text file. Acrobat Reader is not
invoked by the browser.

As long as I can understand, this happens because of the lacking of the
<?xml version="1.0"?> element in the XSL:FO output produced by my XSL-T
stylesheet. Unfortunatley, I cannot insert this element in my output
using the "xsl:processing-instruction" because the XSL engine complains
about an illegal operation ('processing-instruction cannot be "xml"'). I
did not understand how to use the second technique mentioned in the "my
processing instruction disapper..." of the FAQ, that is by using an
"apply-templates" element that matches processing instructions, so I did
not try it.

Does anybody know how to get both HTML and PDF output from the same XML
file by applying two different stylesheets?

Does anybody have a working example of a single XML file converted into
both HTML and PDF using different stylesheets?

Many thanks in advance

Alessandro Bottoni
Web Architect
Quadrante SRL - Italy

View raw message