Escolar Documentos
Profissional Documentos
Cultura Documentos
Deborah Aleyne Lapeyre and B. Tommie Usdin Mulberry Technologies Inc. 17 West Jefferson St. Suite 207 Rockville MD 20850 Phone: 301/315-9631 Fax: 301/315-8285 info@mulberrytech.com
http://www.mulberrytech.com
Where the Content Goes...........................................................................................34 Page Sequences.........................................................................................................35 Content Formatting Happens Inside the Flow...........................................................36 More Complex Pagination........................................................................................36 Organization of a Typical XSL-FO Document.........................................................37 Blocks Take Typographic Properties.......................................................................38 Block Properties are Attributes of the <fo:block> Element................................38 The Actual Text goes Inside the Block......................................................................39 Lets Watch a Stylesheet Grow....................................................................................39 Whos Using XSL-FO and What is It Good For........................................................50 XSL-FO Software Vendors Name Their Clients.............................................................50 Companies are Using XSL-FO When.............................................................................51 XSL-FO Really Shines When.........................................................................................52 Candidates also Include..................................................................................................53 Why Isnt Everybody Using XSL-FO?........................................................................53 When XSL-FO Is Not Useful.......................................................................................54 Really Bad XSL-FO Candidates Include......................................................................54 You Might Not Want XSL-FO If.............................................................................55 Additional Planning Challenges......................................................................................55 XSL-FO Tools...................................................................................................................56 Free XSL-FO Formatting Engines..................................................................................56 Commercial XSL-FO Formatting Engines......................................................................57 Page-layout Applications that Understand XSL-FO.......................................................57 More Support Tools All the Time...................................................................................58 There are Software Limitations.......................................................................................59 XSL-FO Spec Sets Levels of Conformance....................................................................60 The Wrapup What Does It Take to Create XSL-FO.........................................................................61 What You Need to Know to Write an XSL-FO Stylesheet..........................................61 What Does It Take to Maintain an XSL-FO Stylesheet...............................................62 How do You Train an XSL-FO Programmer...............................................................62 There is Other Cool XSL-FO Material............................................................................63 The Hype Behind XSL-FO..............................................................................................63 Some Real XSL-FO-Made Pages....................................................................................64 Information Resources: Where to Learn More.............................................................65 Books..............................................................................................................................65 Articles and Reports............................................................................................................ Online Resources............................................................................................................66 XSL-FO Stylesheets Online............................................................................................66 For Programmers.............................................................................................................67 Colophon............................................................................................................................68
Appendix
Appendix 1: The Most Basic Formatting Properties....................................................69
Page ii
Administrivia
C Start, end, break C How this will work C Questions are always in order C Who we am C Anything else?
slide 2
Page 1
slide 3
slide 4
Page 2
slide 5
Page 3
slide 6
slide 7
What is XSL-FO
Extensible Stylesheet Language-Formatting Objects
C A way to make print directly from XML C A page description language (that particular software can read) C XSL-FO rendering software C takes XML as input C gives PDF, Postscript (RTF, MIF, etc.) as output C Described in a W3C recommendation called XSL (Extensible Stylesheet Language)
(Not new, recommendation since 2001)
Page 4
slide 8
slide 9
Page 5
slide 10
slide 11
Page 6
slide 12
slide 13
Page 7
slide 14
slide 15
Page 8
slide 16
Page 9
slide 18
slide 19
Page 10
slide 20
slide 21
Page 11
slide 22
slide 23
Page 12
slide 24
XML file
XSLT processor
output file
Page 13
slide 26
slide 27
Page 14
slide 28
slide 29
So an XSL-FO Document is
C An XML document C Tagged in the XSL-FO tag set C That contains your text and graphic content wrapped in formatting object tags (F - O, get it?)
slide 30
Page 15
slide 31
slide 32
C XSL-FO rendering engine C understands these tags C makes pages from them (PDF, Postscript, RTF, etc.) C And printed/displayed using a display engine (like Adobe Acrobat for the PDF or Word for the RTF)
Page 16
slide 33
slide 34
C Produces display for paper (we dont know/care how) C An XSL-FO programmer needs to know which XSL-FO tags to use to make the pages he/she wants
Page 17
slide 35
(Native HTML does not enable complex page layout, multiple columns, running heads, keeps and breaks)
slide 36
Page 18
slide 37
HTML Example
C Start with XML-tagged source
<recipe> <title>Waffles with Syrup</title> ... </recipe>
C And the browser (like IE or Firefox) understands the HTML tags (<h1>) and displays
Page 19
slide 38
(XSL-FO can describe more complex, sophisticated page layouts than HTML)
slide 39
Page 20
slide 40
XSL-FO Example
(one more step than in the HTML)
C The source XML
<recipe> <title>Waffles with Syrup</title> ... </recipe>
C Rendering software understands the XSL-FO tags and creates PDF C And the display engine (like Acrobat) understands the PDF and displays
Page 21
slide 41
slide 42
Page 22
slide 43
slide 44
Page 23
slide 45
slide 46
Page 24
slide 47
slide 48
Page 25
slide 49
C page geometry C And there is a transform (XSLT) to turn your XML tags into XSL-FO tags XSL-FO is the intermediate form between media-neutral XML and media-dependent output - Stephen Deach
slide 50
Page 26
slide 51
slide 52
Page 27
slide 53
<fo:block> <fo:block-container>
<fo:list-block> <fo:list-item>
Pages and Layout Top-level elements that define Objects what the page(s) will look like and <fo:page-sequence-master> give you page sequences like making recto and verso pages different Out of Line FOs FOs for footnotes and marginalia, <fo:footnote> (includes links) stuff not in the regular stream of <fo:footnote-body> text
Page 28
slide 54
slide 55
C inside element <fo:layout-master-set> C Part Two contains page sequences (content flows)
C assign content to pages C assign formatting styles (properties) to content
Page 29
slide 56
slide 57
Page 30
slide 58
Page 31
slide 59
Content Rectangle
C Is the area where the text will actually go. That includes: C not just the body text with C columns and gutters, but also C headers and footers C Is divided into regions C Regions have names and text can be placed into regions (Not just the body text, this is the whole print region)
slide 60
Page 32
slide 61
Page 33
slide 62
Up to This Point
C We have described pages and pages geometry C Put page layout is only half the story C Where is the text, the content? C Where does the content go?
slide 63
Page 34
slide 64
Page Sequences
C Contain C static content (the same on every page) C for headers and footers (page numbers) C name the region they will go into C a flow C the primary stream of content (goes from page to page) C contains block-level formatting objects (e.g. <fo:block>) C these objects will flow onto the page (through the page sequence) C names the region into which content will be flowed
Page 35
slide 65
Page 36
slide 67
Page 37
slide 68
Blocks define the way the text will look through properties C Font font-family, font-size, font-weight C Color color, background-color C Spacing space-before, space-after C Line height C Indents and margins Blocks may be nested, and inherit properties from ancestors.
slide 69
Page 38
slide 70
slide 71
Page 39
slide 72
Page 40
</directions> </component> <component> <title>The Filling</title> <ingredient-list> <ingredient> <quantity>4</quantity> <foodstuff>tart apples, peeled</foodstuff> </ingredient> <ingredient> <quantity>1</quantity> <measure>Tbsp</measure> <foodstuff>lemon juice</foodstuff> </ingredient> <ingredient> <quantity>2</quantity> <measure>Tbsp</measure> <foodstuff>unsalted butter</foodstuff> </ingredient> <ingredient> <quantity>2/3</quantity> <measure>c</measure> <foodstuff>sugar</foodstuff> </ingredient> <ingredient> <quantity>3</quantity> <foodstuff>eggs</foodstuff> </ingredient> <ingredient> <quantity>1</quantity> <measure>c</measure> <foodstuff>heavy cream</foodstuff> </ingredient> <ingredient> <measure>pinch</measure> <foodstuff>nutmeg</foodstuff> </ingredient> <ingredient> <measure>pinch</measure> <foodstuff>cinnamon</foodstuff> </ingredient> </ingredient-list> <directions>
Page 41
Page 42
slide 73
Page 43
slide 74
Page 44
slide 75
Page 45
slide 76
Page 46
slide 77
Page 47
slide 78
Page 48
slide 79
Page 49
slide 80
slide 81
Page 50
slide 82
slide 83
Page 51
slide 84
Page 52
slide 86
slide 87
Page 53
slide 88
slide 89
Page 54
slide 90
slide 91
Page 55
slide 92
XSL-FO Tools
C Rendering engines C XSL-FO editors C Online previewers C Composition systems that accept XSL-FO input C Two cost categories C free and open source C commercial
slide 93
Page 56
slide 94
slide 95
Page 57
slide 96
slide 97
Page 58
slide 98
Page 59
slide 99
(Check with your vendor, read the conformance table, then ask their clients)
slide 100
Conformance Examples
(as of December 2005)
C XEP has not yet implemented table-omit-footer-at-break C AntennaHouse has not yet implemented font-selection-strategy C fop has not yet implemented all of the Basic conformance items C Almost no one had implemented any aural properties so far (In general what they do have is more important than what they dont)
Page 60
The Wrapup
slide 101
slide 102
Page 61
slide 103
slide 104
Page 62
slide 105
slide 106
Page 63
slide 107
slide 108
Page 64
slide 109
Books
C XSL Formatting Objects: Developers Handbook, Doug Lovell, 2002 C Elliotte Rusty Harold, chapter. 18 of The XML Bible
http://www.cafeconleche.org/books/bible2/chapters/ch18.html
C XSL-FO: Making XML Look Good in Print , Dave Pawson, 2002 C Practical Formatting Using XSL-FO, Ken Holman
slide 111
Page 65
C What Is XSL-FO and When Should I Use It? (Seybold Report, Dec. 2002)
http://www.adobe.com/products/server/documentserver/pdfs/adob eseybold_xsl-fo.pdf
slide 112
Online Resources
C W3C list of processors, with notes: http://www.w3.org/Style/XSL/ C Diderot Track XSL-FO list of processors, with notes and conformance comparison table:
http://www.diderottrack.nl/en.articles.xslfo.html
C XSL Info site http://www.xslfo.info/ C The lists: C W3C mailing list http://lists.w3.org/Archives/Public/www-xslfo/
slide 113
Page 66
C DocBook stylesheet Wikihttp://wiki.docbook.org/topic/DocBookXslStylesheets C RenderX FO-features demonstration with the XSL-FO stylesheets
http://www.renderx.com/featurestest.html
slide 114
For Programmers
C FAQs and Specs C News, examples, software links, and book links at xslfo.info
http://www.xslfo.info/
C Instructions for installing two free XSL-FO processors, FOP and PassiveTeX:
http://www.sagehill.net/docbookxsl/InstallingAnFO.html
Page 67
slide 115
Colophon
C Slides and handouts created from single XML source C Slides projected from HTML which was created from XML using XSLT C Handouts created from XML: C Source XML transformed to Open Office XML C Open Office XML opened in Open Office C Pagination normally adjusted C Slideshow materials available at:
http://www.mulberrytech.com/slideshow
Page 68
Appendix 1
There are many other properties for blocks and wrappers. Note in particular that an <fo:block> will also accept font-related attributes. Tip: Check the compliance table for the XSL-FO formatting engine you use for both its limitations and its extensions.
Page 69