[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: how to convert HTML to FO
> -----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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|