53
An Introductive Presentation of XSL-FO Jean-Michel HUFFLEN LIFC — University of Franche-Comté GUIT meeting, 15th October 2011 1

An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

  • Upload
    hadieu

  • View
    241

  • Download
    1

Embed Size (px)

Citation preview

Page 1: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

An Introductive Presentationof XSL-FO

Jean-Michel HUFFLENLIFC — University of Franche-ComtéGUIT meeting, 15th October 2011

1

Page 2: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

Contents

Using xsl-fo

Basic elements

Multilingual capabilities

Page model

Orientation

Conclusion

2

Page 3: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

XSL-FO

Aims to describe high-quality output prints.

Page 4: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

XSL-FO

Aims to describe high-quality output prints.

In fact:

dsssl −→ xsl −→ xsltxsl(-fo)

Page 5: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

XSL-FO

Aims to describe high-quality output prints.

In fact:

dsssl −→ xsl −→ xsltxsl(-fo)

Very verbose language.

3

Page 6: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

Using XSL-FO

xml text

Page 7: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

Using XSL-FO

xml text xslt=⇒ xsl-fo

Page 8: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

Using XSL-FO

xml text xslt=⇒ xsl-fo

fo processor=⇒ pdf, ps, etc.

Page 9: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

Using XSL-FO

xml text xslt=⇒ xsl-fo

fo processor=⇒ pdf, ps, etc.

Automatically chained by ‘complete’ fo processors.

Page 10: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

Using XSL-FO

xml text xslt=⇒ xsl-fo

fo processor=⇒ pdf, ps, etc.

Automatically chained by ‘complete’ fo processors.

Not wisiwyg.

4

Page 11: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

FO processors

Free of charge:

the best—the most complete—Apache fop.

Page 12: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

FO processors

Free of charge:

the best—the most complete—Apache fop.

Related to TEX’s world: PassiveTEX

Page 13: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

FO processors

Free of charge:

the best—the most complete—Apache fop.

Related to TEX’s world: PassiveTEX ⇐= stalled.

5

Page 14: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

LATEX =⇒ XSL-FO

EuroBachoTEX, April 2007.

Page 15: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

LATEX =⇒ XSL-FO

EuroBachoTEX, April 2007.

GUTenberg, October 2008.

Page 16: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

LATEX =⇒ XSL-FO

EuroBachoTEX, April 2007.

GUTenberg, October 2008.

Multidirectional typesetting in xsl-fo. BachoTEX,April 2009.

Page 17: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

LATEX =⇒ XSL-FO

EuroBachoTEX, April 2007.

GUTenberg, October 2008.

Multidirectional typesetting in xsl-fo. BachoTEX,April 2009.

Italian translation updated, by Massimiliano Dominici.

6

Page 18: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

General principles

Same ideas than (LA)TEX, but the markup is more homogeneous.

Page 19: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

General principles

Same ideas than (LA)TEX, but the markup is more homogeneous.

LATEX:

• {\em ...}

• \emph{...}

• \begin{emph}...\end{emph}

Page 20: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

General principles

Same ideas than (LA)TEX, but the markup is more homogeneous.

LATEX:

• {\em ...}

• \emph{...}

• \begin{emph}...\end{emph}

xsl-fo ⇐= \begin{emph}...\end{emph}.

7

Page 21: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

Basic elements

...\par

Page 22: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

Basic elements

...\par

<fo:block>...</fo:block>

Page 23: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

Basic elements

...\par

<fo:block>...</fo:block>

\begin{minipage}{...}...\end{minipage}

8

Page 24: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

Containers

fo:block fo:inline . . .

Page 25: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

Containers

fo:block fo:inline . . .

If an attribute is not redefined, it is inherited:

<fo:block font-family="sans-serif" font-size="medium">You’re afraid,<fo:inline font-size="large">ain’t</fo:inline>you?

</fo:block>

9

Page 26: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

Rubber lengths ⇐= interactions

space-before space-after

Page 27: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

Rubber lengths ⇐= interactions

space-before space-after

Components:

space-before="..."space-before.minimum="..."space-before.optimum="..."space-before.maximum="..."

10

Page 28: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

Solving conflicts

Beginning or ending a reference⇐= conditionality(discard | retain).

Between two reference areas ⇐= precedence(integer | force).

11

Page 29: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

More about interactions

keep-with-next="always" or an integer,keep-with-next.within-linekeep-with-next.within-pagekeep-with-previous....keep-together....

12

Page 30: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

Other elements

Close to LATEX’s commands:

fo:footnote fo:float

Page 31: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

Other elements

Close to LATEX’s commands:

fo:footnote fo:float

Closer to (x)html:

fo:list-block fo:table

Page 32: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

Other elements

Close to LATEX’s commands:

fo:footnote fo:float

Closer to (x)html:

fo:list-block fo:table

Interactions about such elements.

13

Page 33: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

Multilingual capabilities

Word hyphenation w.r.t. a language. Partly imple-mented, but specified in the w3c recommendation.

(See examples.)

14

Page 34: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

Page model

' document classes in LATEX.

Page 35: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

Page model

' document classes in LATEX.

fo:region-body,fo:region-before, fo:region-after,fo:region-start, fo:region-end.

Page 36: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

Page model

' document classes in LATEX.

fo:region-body,fo:region-before, fo:region-after,fo:region-start, fo:region-end.

Headers and footers ⇐= static content.

Page 37: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

Page model

' document classes in LATEX.

fo:region-body,fo:region-before, fo:region-after,fo:region-start, fo:region-end.

Headers and footers ⇐= static content.

Text for successive pages ⇐= flow.

15

Page 38: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

Page model’s regions

margin-bottom

region-after

region-before

marg

in-l

eft

regi

on-s

tart

region-body

regi

on-e

ndma

rgin

-rig

ht

� margin-top

16

Page 39: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

One or more pages

fo:simple-page-master,

fo:page-sequence-master.

17

Page 40: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

More advanced

<fo:page-sequence-master ...><fo:repeatable-page-master-alternatives>

<fo:conditional-page-master-referencepage-position="..."master-name="..."/>

<fo:conditional-page-master-reference .../>...

</fo:repeatable-page-master-alternatives></fo:page-sequence-master>

18

Page 41: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

Directions

• inline-progression-direction,

• block-progression-direction.

Page 42: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

Directions

• inline-progression-direction,

• block-progression-direction.

In Italian: lr-tb (lr).

Page 43: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

Directions

• inline-progression-direction,

• block-progression-direction.

In Italian: lr-tb (lr).

Semitic languages (Hebrew, Arabic):

Page 44: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

Directions

• inline-progression-direction,

• block-progression-direction.

In Italian: lr-tb (lr).

Semitic languages (Hebrew, Arabic): rl-tb.

Page 45: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

Directions

• inline-progression-direction,

• block-progression-direction.

In Italian: lr-tb (lr).

Semitic languages (Hebrew, Arabic): rl-tb.

Traditional Japanese:

Page 46: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

Directions

• inline-progression-direction,

• block-progression-direction.

In Italian: lr-tb (lr).

Semitic languages (Hebrew, Arabic): rl-tb.

Traditional Japanese: tb-rl.

19

Page 47: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

Latin languages

margin-bottom

region-after

region-before

marg

in-l

eft

regi

on-s

tart

region-body

regi

on-e

ndma

rgin

-rig

ht

� margin-top

20

Page 48: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

Semitic languages

margin-bottom

region-after

region-before

marg

in-l

eft

regi

on-e

nd

region-body

regi

on-s

tart

marg

in-r

ight

� margin-top

21

Page 49: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

Traditional Japanese

margin-bottom

region-end

region-start

marg

in-l

eft

regi

on-a

fter

region-body

regi

on-b

efor

ema

rgin

-rig

ht

� margin-top

22

Page 50: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

Other systems

lr-alternating-rl-bt

lr-inverting-tb

tb-lr-in-lr-pairs

tb-lr bt-lr bt-rl lr-bt rl-bt

23

Page 51: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

Cumulation

(See examples.)

24

Page 52: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

Conclusion

fo processors ⇐= not LATEX.

Page 53: An Introductive Presentation of XSL-FO · PDF fileUsingXSL-FO xml text=xslt)xsl-fo fo=processor) pdf,ps,etc. Automaticallychainedby‘complete’fo processors. Not wisiwyg. 4

Conclusion

fo processors ⇐= not LATEX.

My personal point of view: (LA)TEX and xsl-fo shouldconverge.

25