Hi,
Are there any XSLT parsers (like MSXML 4.0) helping to retrieve the XSL FO document during the XSL-Transformaion Process ?
In other words, how do I get a XSL FO file from a XML and XSL file ?
Thanks, Aiwee
Hi,
Are there any XSLT parsers (like MSXML 4.0) helping to retrieve the XSL FO document during the XSL-Transformaion Process ?
In other words, how do I get a XSL FO file from a XML and XSL file ?
Thanks, Aiwee
You can't automatically.
The original XSL specification was split in to 3 seperate specifications:
XSL:FO should be seen as a way to describe documents in XML. XSLT can help you generate such an XML structure but it won't do so automatically.
The flow is as followed:
XML input => XSLT => XML output.
XSL:FO is XML output nothing more nothing less.
The flow is not
XML input => XSLT => XML output & XSL:FO.
I think the root of the confusion stems from the fact that the term XSL encompasses XSLT/XSLFO & XPATH yet often XSL is used as a synonym for XSLT.
w3schools has a section on how these two seperate specifications can aid one another:
you can use a simple xml transform for this.
for example:
Source source = new StreamSource(new File("imput.xml"));
Source style = new StreamSource(new FileInputStream("style-fo.xsl"));
TransformerFactoryImpl saxon = new TransformerFactoryImpl();
Transformer transformer = saxon.newTransformer();
transformer.transform(source, new StreamResult(System.out));
transforms the in.xml document with the xsl-fo style sheet into xml-fo and prints in on the console.