Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XSL- FO transformations

Status
Not open for further replies.

AndyCheng

Technical User
Feb 22, 2005
4
AU
Hi All,

I just like to ask, does anyone know if I can do an XSL-FO transformation on 2 XML instance documents?

If the answer is yes, is there a tool that allows this?

Regards,
Andy
 
XSL-FO (FOP) <i>is</i> the tool that allows you to do this, but generally you would have to write the stylesheet (XSL-FO) that will specify the actual transformation to PDF.

FOP runs as a standalone application too. so you can write stylesheets and then run FOP on them manually.

Check out which gives you a lot of information about FOP.
 
What's the difference between XSL-FO and FOP then? Just a subset of XSL-FO?

To answer the original question, use XSLT to do a transform from XML to XSL-FO and this can take data from any number of XML files.
 
XSL-FO is the xsl language extension, FOP is the tool or API which transforms the XML to PDF using XSL-FO.

FOP (Formatting Objects Processor) is the world's first print formatter driven by XSL formatting objects (XSL-FO) and the world's first output independent formatter. It is a Java application that reads a formatting object (FO) tree and renders the resulting pages to a specified output. Output formats currently supported include PDF, PCL, PS, SVG, XML (area tree representation), Print, AWT, MIF and TXT. The primary output target is PDF. - from
You do not need to use XSLT to transform to XSL-FO and then PDF, you can transform XML -> PDF using XSL-FO and FOP in one go.
 
ah scratch that last bit, Jon is right again. You do need to transform to XSL-FO first, and then process using FOP.

My apologees, its getting late.

 
Hi All,

Thanks for all your responses. But I think I havent been clear about what I was asking.

When I was asking about XSL-FO transformation over 2 XML documents, I didnt mean using the same stylesheet for 2 or more XML documents.

I meant to ask if XSL-FO could render 2 XML documents simultaneously, ie these 2 XML documents will have different XML elements and I want to use the same XSL-FO to render both - so to print out one PDF file with information from 2 different XML instances.

If this is possible, what are the available tools?

Regards,
Andy
 
Thats what I was suggesting you do with XSL, although you can do both. You can do more or less anything you want with XSL.
 
Hi All,

I tried what u said in FOP 20.5 however looks like its still not producing the right results. Im typing in this command:

fop -xsl pdf.xsl -xml file1.xml -xml file2.xml -pdf output.pdf

My XSL file does have an fo:root element and works completely fine when rendering a single XML file. When running the above line, it only renders the latest XML file.

Jonty, if ur doing something that im not, let me know.

Regards,
Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top