You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by ab...@quadrante.com on 2001/01/28 18:09:40 UTC

How can I have both PDF and HTML from *the same* XML doc?

I would like to use the same XML document (based on a custom DTD) to
output either HTML (via XSLT) or PDF (via XSL-FO) documents, depending on 
the applied XSL style sheet.

I have two problems:

1) The samples supplied with the distribution illustrate this situation:

FO -> PDF

while I have this situation:

XML(my DTD) -> FO -> PDF

Of course, I do not want to maintain both a XML(myDTD) and a FO version
of the same document, hence I need a way to convert my XML document to a
valid FO document on user request. 

How can I perform such a translation? It seems that the XSL-T engine have 
some trouble when I try to output a XML declaration into the generated
document.

I have the feeling that I have to chain these two translations, in a way
similar to the XSP process, but I cannot figure out how to do it. Any
suggestion?

2) How can I apply a different style sheet to my XML document on user request?

Have I to use a XSP page to handle the user request? Is there a
different, maybe more natural, way to perform this task?

I have seen a nice example of conditional formatting at this URL:
http://www.beyondhtml.com 

but it uses MS stuff, not Cocoon.

Is there any equivalent example on the Net?

Many thanks in advance

Alessandro Bottoni

This message powered by EMUMAIL. -- http://www.EMUMAIL.com

Re: How can I have both PDF and HTML from *the same* XML doc?

Posted by Matthias Brunner <mb...@blumenstrasse.vol.at>.
abottoni@quadrante.com wrote:
> 
> I would like to use the same XML document (based on a custom DTD) to
> output either HTML (via XSLT) or PDF (via XSL-FO) documents, depending on
> the applied XSL style sheet.
> 

Maybe this helps:
http://mailman.real-time.com/pipermail/cocoon-users/2000-August/001910.html

Depending on the parameter "view" it changes the stylesheet.

Best regards!
-- 
Matthias Brunner <mb...@blumenstrasse.vol.at>
PGP FP 7862 32B3 3B75 292A F76F  5042 8587 21AB 5B89 D501
Check out http://blumenstrasse.vol.at/~mb/gpgkey.asc