xsl-list
[Top] [All Lists]

RE: how to convert HTML to FO

2003-09-19 14:01:11
-----Original Message-----
From: Biying Huang

I need to format a java object MyObject to PDF. So I convert MyObject to
a XML file and write a XSL file to transform the XML data into PDF by
using FOP.

One attribute of MyObject is a String representing html source code. In
my XSL file, how do I convert this html portion to FO so that FOP can
process it?


Rather depends on the level of complexity of the HTML portion, but...

Looks like this could be solved by:

a. setting up an extra XSLT for the transformation HTML->FO & make sure the
template you are going to use is defined with an <xsl:param ...>
(I'm not sure but I seem to recall running into generic HTML->FO stylesheets
somewhere...)

b. referencing this extra XSLT in your original XSL ( via <xsl:include ...
)

c. perform an <xsl:call-template ...> <xsl:with-param ...> in your original
XSLT and feed it the value of your object's html attribute (or, better even,
the node that contains the HTML portion ... if the HTML is well-formed, it
should be possible to store this as a node in your XML, rather than as an
attribute - pass the node to the HTML2FO-template and make the template
return a FO-node to enter in your resulting document.)

Vaguely sketched, so this method would definitely need a bit of fine-tuning.

Hope this helps.


Greetz,

Andreas Delmelle


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>