W3C home > Mailing lists > Public > www-xsl-fo@w3.org > October 2002

Re: xsl:fo rendering

From: G. Ken Holman <gkholman@CraneSoftwrights.com>
Date: Wed, 16 Oct 2002 06:34:11 -0400
Message-Id: <5.1.0.14.0.20021016113401.031c03a0@pop.storm.ca>
To: <www-xsl-fo@w3.org>

At 2002-10-16 11:27 +0100, subbu@boltblue.com wrote:
>I started off with an example ..

Your example has some missing and incorrectly specified properties for the 
page masters.

>My questions are as follows:
>1.How do we write the XSL to produce the above XSL:FO file? I am quite ok 
>with
>writing xsl style sheets

Perhaps you have been using HTML until now?

>but do not know how to write xsl to produce xsl:fo..
>Please assume that i know nothing about xsl:fo.

Then all you have to learn is the XSL-FO vocabulary so that when you write 
your stylesheet you use that vocabulary instead of HTML.  We have a free 
download preview of our electronic book we sell on our web site that will 
both give you an introduction and has a hyperlinked cross reference in the 
annex for the objects and properties that is useful in its own right:

   Practical Formatting Using XSL-FO
   (Extensible Stylesheet Language Formatting Objects)
   Third Edition - 2002-09-05 - ISBN 1-894049-10-1
   Copyright (c) 2002 Crane Softwrights Ltd.
   / 396 Pages / Subscription price includes free updates,
   /           / soft-copy of included examples, and an
   /           / accessible rendition and 10 PDF renditions.
   /           / Free 206-page download preview excerpt.

The same skills you have for HTML apply when using any output vocabulary.

An example is below with repaired properties ... I hope this helps.

............... Ken

T:\ftemp>type subbu.xml
<doc>
<para>Hello world!</para>
<para>This is a test</para>
</doc>

T:\ftemp>type subbu.xsl
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                 xmlns:fo="http://www.w3.org/1999/XSL/Format"
                 version="1.0">

<xsl:template match="/">
<fo:root>
   <fo:layout-master-set>
     <fo:simple-page-master master-name="my-page">
       <fo:region-body  margin="1in"></fo:region-body>
     </fo:simple-page-master>
   </fo:layout-master-set>
   <fo:page-sequence master-reference="my-page">
     <fo:flow flow-name="xsl-region-body">
       <xsl:apply-templates/>
     </fo:flow>
   </fo:page-sequence>
</fo:root>
</xsl:template>

<xsl:template match="para">
   <fo:block><xsl:apply-templates/></fo:block>
</xsl:template>

</xsl:stylesheet>

T:\ftemp>


--
G. Ken Holman               mailto:gkholman@CraneSoftwrights.com
Crane Softwrights Ltd.        http://www.CraneSoftwrights.com/f/
Box 266, Kars, Ontario CANADA K0A-2E0  +1(613)489-0999 (F:-0995)
ISBN 0-13-065196-6                     Definitive XSLT and XPath
ISBN 0-13-140374-5                             Definitive XSL-FO
ISBN 1-894049-08-X Practical Transformation Using XSLT and XPath
ISBN 1-894049-10-1             Practical Formatting Using XSL-FO
Next public training:          2002-12-08,2003-02-03,06,03-03,06
Received on Wednesday, 16 October 2002 06:46:14 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 3 October 2007 16:06:09 GMT