[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 20:01:19 +0000 (GMT Standard Time)
Re:  Working example xml+xsl to .fo file
Eleonora, 
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> 
Hello World 
</hello> 
 
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 
Org/1999/XSL/Transform"> 
<xsl:template match="/"> 
<of:root xmlns:of="http://www.w3.org/1999/XSL/Format" > 
<of:layout-master-set> 
<of:simple-page-master master-name="LetterPage" page-width="8.5in" 
Page-height="11in" > 
<of:region-body region-name="PageBody" margin="0.7in"/> 
</of:simple-page-master> 
</of:layout-master-set> 
<of:page-sequence master-reference="LetterPage"> 
<of:flow flow-name="PageBody"> 
<of:block> 
<xsl:value-of select = "hello"/> 
</of:block> 
</of:flow> 
</of:page-sequence> 
</of:root> 
</xsl:template> 
</xsl:stylesheet> 
========================================================================= 
 
Running the Transform results in 
 
=============================================================================

==== 
<?XML version="1.0" encoding="UTF-16"?> 
<of:root xmlns:of="http://www.w3.org/1999/XSL/Format"> 
<of:layout-master-set> 
<of:simple-page-master master-name="LetterPage" page-width="8.5in" 
Page-height="11in"> 
<of:region-body region-name="PageBody" margin="0.7in" /> 
</of:simple-page-master> 
</of:layout-master-set> 
<of:page-sequence master-reference="LetterPage"> 
<of:flow flow-name="PageBody"> 
<of:block> 
Hello World 
</of:block> 
</of:flow> 
</of:page-sequence> 
</of:root> 
=============================================================================

= 
 
 
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. 
http://www.antennahouse.com/ 
 
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:Of and you will soon find loads of articles .. 
 
HTH 
Vasu 
-------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 
 
Dave, 
 
Typo. 
XML+xsl 
 
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

Out, 
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: 
http://www.gmx.net/de/go/multimessenger 

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.