[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Working example xml+xsl to .fo file

Subject: Re: Working example xml+xsl to .fo file
From: "vasu chakkera" <vasucv@xxxxxxxxx>
Date: Tue, 18 Nov 2008 19:55:48 +0000 (GMT Standard Time)
Re:  Working example xml+xsl to .fo file
You have to understand how the FO works. And things will look much brighter
to you. 
Before going into XSL:FO , you need to know about XSLT. 
If you understand well that XSLT can transform XML into any output format
file you desire, then we are one step closer. 
The First Step in a PDF production is to Produce a .FO file from XML. 
An XSL file is written to produce this .FO file. 
This .FO file is sent into what is called a PDF renderer to produce the PDF
files. Google for renderx, FOP , antennahouse etc, and you can read quite a
lot on these. 
Let us now do what you asked for : a Hello World example: 
Consider you have an XML : 
<?XML version="1.0"?> 
Hello World 
You write a XSL as below to produce a .FO file. 
<?XML version="1.0"?> 
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3
<xsl:template match="/"> 
<of:root xmlns:of="http://www.w3.org/1999/XSL/Format" > 
<of:simple-page-master master-name="LetterPage" page-width="8.5in" 
Page-height="11in" > 
<of:region-body region-name="PageBody" margin="0.7in"/> 
<of:page-sequence master-reference="LetterPage"> 
<of:flow flow-name="PageBody"> 
<xsl:value-of select = "hello"/> 
Running the Transform  results in 
<?XML version="1.0" encoding="UTF-16"?> 
<of:root xmlns:of="http://www.w3.org/1999/XSL/Format"> 
<of:simple-page-master master-name="LetterPage" page-width="8.5in"
<of:region-body region-name="PageBody" margin="0.7in" /> 
<of:page-sequence master-reference="LetterPage"> 
<of:flow flow-name="PageBody"> 
Hello World 
Now if you use any FO renderer , you will get a PDF with Hello World. 
To get a quick check , you can download the antennahouse xsl formatter. It
allows you to select a .FO file and converts it into PDF file. 
This is a pretty good tool to play around with the FO. 
As it looks simple, please do not think that FO is simple, I strongly advice
you to read atleast to the level of fair understanding on how to write the
stylesheets to produce an FO file and what is the structure of a FO tree and
the formatting specifics. 
Google for XSL:Fo and you will soon find loads of articles .. 
-------Original Message------- 
From: eleonora46@xxxxxxx 
Date: 18/11/2008 18:18:18 
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
Subject: Re:  Working example XML+xsl to .of file 
I read http://www.cafeconleche.org/books/bible2/chapters/ch18.html 
It says all the time: 
File *.xsl and *.XML has been run through an XSLT processor to produce an
XSL-FO document, 
And I should like to see a working example for this run. I am unable to find
How it gets those .of files. 
Thanks, eleonora 
-------- Original-Nachricht -------- 
> Datum: Tue, 18 Nov 2008 18:13:06 +0000 
> Von: Dave Pawson <davep@xxxxxxxxxxxxx> 
> An: xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> Betreff: Re:  Working example XML+xsl to .of file 
> eleonora46@xxxxxxx wrote: 
> > Yes. I need a working example that creates from 
> > XML+csl a .of file, and not a HTML file. 
> what's a 'csl' file? 
> regards 
> -- 
> Dave Pawson 
Psssst! Schon vom neuen GMX MultiMessenger gehvrt? Der kann`s mit allen:

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.