XSL FO - PowerPoint PPT Presentation

1 / 29
About This Presentation
Title:

XSL FO

Description:

Share as many styling properties and as much of the formatting/layout model from ... In contrast, XSL FO is a language for completely describing a styled document. ... – PowerPoint PPT presentation

Number of Views:62
Avg rating:3.0/5.0
Slides: 30
Provided by: Gue145
Category:
Tags: xsl | styled

less

Transcript and Presenter's Notes

Title: XSL FO


1
XSL FO
  • XSL Formatting Objects
  • XSLFO is a pagination markup language which
    describes a rendering vocabulary capturing the
    semantics of formatting information for paginated
    presentation.
  • While XSLT combined with XML has several
    applications, some of which we just learned
    about, generating an XSLFO presentational
    vocabulary is one of them.

2
XML, XSLT, XSL FO putting these technologies
together
3
What is XSL FO for?Styling
  • Styling as two distinct processes
  • Transforming (XSLT)
  • Formatting (XSLFO)

4
Formatting (Rendering)
  • Expresses the aspects of the appearance of the
    transformed information desired for the target
    medium
  • Target Mediums
  • Browsers
  • Books
  • Printers
  • Computer Speakers

5
Goal of XSLFO
  • Preserve the original information so that it can
    be distributed in many different ways later on,
    without committing to a single design.
  • Example Rather than using the ltbgt element to
    display emphasized text, use ltemphgt to capture
    the reason for marking up the information.

6
Lets get this straight
  • XSL FO originally part of the XSL working group
    chartered by W3C (World Wide Web Consortium).
  • What emerged were three separate technologies
  • XSLT eXtensive StyleSheet Language
    Transformations
  • XPATH XML Path Language
  • XSL eXtensive StyleSheet Language aka XSL FO

7
Why was XSL FO made?
  • No language for describing the pagination of
    complex documents on the web.
  • Inability to deal with long documents and complex
    layouts. No support for TOC, footnotes, endnotes
  • CSS not sufficient for print documents, but only
    browsers.

8
XSLFO responds to the issues
  • XSLFO
  • XML syntax
  • Declarative
  • Build on CSS
  • Cross-media
  • Typographic quality/multilingual market

9
XML Syntax
  • Two distinct advantages
  • XSLT and XSLFO will work with existing XML
    parsers
  • XSLT and XSLFO can be manipulated and validated
    using existing XML tools

10
Declarative
  • XLSFO should be comprised of a set of elements
    and attributes fully describing what the desired
    results looks like.

11
Build on CSS
  • Share as many styling properties and as much of
    the formatting/layout model from CSS as possible.
  • Also provide support for more advanced features
    such as footnotes, endnotes, floats, indexes,
    TOCs, odd and even page masters.
  • Support layout-driven documents such as
    newspapers, magazines, catalogues, brochures and
    web browsers.

12
Cross Media
  • Support a wide range of display devices
  • Government mandated accessibility requirements
    (larger text, alternate fonts, high contrast font
    schemes, alternate navigation, aural
    presentation).
  • Palmtop Devices requiring reflow or repagination
    of original content.

13
Typographic quality/Multilingual Support
  • XSLFO capabilities should match or exceed present
    capabilities of existing page formatters and be
    compatible with their underlying formatting
    models.
  • Multilingual support should include the use of
    Unicode and the Unicode bidirectional rules.

14
So CSS and XSLFO are the same right?
  • No. CSS (Cascading Style Sheets) is an external
    stylesheet language. It applies styling to
    selected elements in HTML document.
  • In contrast, XSL FO is a language for completely
    describing a styled document. Including
    everything needed to format and paginate it.

15
Getting inside XSLFO - Structure
16
Getting inside XSLFO The Basics
17
Four areas of a page
  • Regions
  • Block Areas
  • Line Areas
  • Inline Areas

18
Regions
  • A region is the highest-level container in
    XSL-FO. Formatting objects that produce regions
    include foregion-body, foregion-before,
    foregion-after, foregion-start, and
    foregion-end.

19
Block Areas
  • A block area represents a block-level element,
    such as a paragraph or a list item.
  • A block area, rather than being precisely
    positioned by coordinates, is placed sequentially
    in the area that contains it.
  • Formatting objects that produce block areas
    include foblock, fotable-and-caption, and
    folist-block.

20
Line Areas
  • A line area represents a line of text inside a
    block.
  • The formatting engine calculates the line areas
    as it decides how to wrap lines inside block
    areas.

21
Inline Areas
  • Inline areas are parts of a line such as a single
    character, a footnote reference, or a
    mathematical equation.
  • Formatting objects that produce inline areas
    include focharacter, foexternal-graphic,
    foinline, foinstream-foreign-object, foleader,
    and fopage-number.

22
root
  • The foroot element exists just to declare the
    namespace and be the document root. It has no
    direct effect on page layout or formatting.
  • (layout-master-set,declarations?,page-sequence)

23
layout-master-set
  • The folayout-master-set consists of descriptions
    of the kinds of pages that can occur in the
    document (Geometry) and their sequences.
  • (simple-page-masterpage-sequence-master)
  • Example
  • ltfolayout-master-setgt
  • ltfosimple-page-master master-name"cover
  • page-height"12cm
  • page-width"12cm
  • margin-top"0.5cm
  • margin-bottom"0.5cm
  • margin-left"1cm
  • margin-right"0.5cm"gt
  • lt/fosimple-page-mastergt

24
page-sequence
  • Depending on whether for instance, the page is
    odd or even, the page-sequence, using the
    definitions from simple-page-master, can generate
    different looking pages.

25
flow
  • The content that is flowed to as many pages as
    required

26
A simple example
  • 01   lt?xml version"1.0" encoding"UTF-8"?gt
  • 02   ltroot xmlns"http//www.w3.org/1999/XSL/Forma
    t"
  • 03    font-size"16pt"gt
  • 04    ltlayout-master-setgt
  • 05    ltsimple-page-master
  • 06    margin-right"15mm" margin-left"15mm
  • 07    margin-bottom"15mm" margin-top"15mm"
  • 08    page-width"210mm" page-height"297mm"
  • 09    master-name"bookpage"gt
  • 10    ltregion-body region-name"bookpage-body
  • 11    margin-bottom"5mm" margin-top"5mm" /gt
  • 12    lt/simple-page-mastergt
  • 13    lt/layout-master-setgt
  • 14    ltpage-sequence master-reference"bookpage"
    gt
  • 15    lttitlegtHello world examplelt/titlegt
  • 16    ltflow flow-name"bookpage-body"gt

27
Example Result XSLFO - PDF
28
Tools
  • FOP is a command-line Java program that converts
    FO (formatting object) documents to Adobe Acrobat
    PDF files.

29
Resources
  • Deach, Stephen. "What Is XSL-FO and When Should I
    Use It?" 2002. 8 Jul. 2003. lthttp//www.seyboldrep
    orts.com/TSR/free/0217/techwatch.htmlgt
  • Harold, Elliotte Rusty. "XSL Formatting Objects."
    12 Nov. 2001. 8 Jul. 2003. lthttp//www.ibiblio.org
    /xml/books/bible2/chapters/ch18.htmlgt
  • Holman, G. Ken. "What is XSL-FO?" 20 Mar. 2002. 8
    Jul. 2003. lthttp//www.xml.com/pub/a/2002/03/20/xs
    l-fo.htmlgt
  • Pawson, Dave. XSLFO An Introduction To XSL
    Formatting Objects. 2001. 8 Jul. 2003.
    ltwww.dpawson.co.uk/xsl/sect3/bk/index.htmlgt
Write a Comment
User Comments (0)
About PowerShow.com