W3C

Extensible Stylesheet Language (XSL)
Version 1.0

W3C Working Draft 27 March 2000

This version:
http://www.w3.org/TR/2000/WD-xsl-20000327/
( XML file, HTML (one large file), ZIP file )
Latest version:
http://www.w3.org/TR/xsl/
Previous version:
http://www.w3.org/TR/2000/WD-xsl-20000301
Authors and Contributors:
Sharon Adler (IBM) <sca@us.ibm.com>
Anders Berglund (IBM) <alrb@us.ibm.com>
Jeff Caruso (Bitstream) <jcaruso@bitstream.com>
Stephen Deach (Adobe) <sdeach@adobe.com>
Paul Grosso (ArborText) <paul@arbortext.com>
Eduardo Gutentag (Sun) <eduardo.gutentag@eng.sun.com>
Alex Milowski (Lexica) <alex@milowski.com>
Scott Parnell (Xerox) <Scott.Parnell@usa.xerox.com>
Jeremy Richman (Interleaf) <jrichman@hq.ileaf.com>
Steve Zilles (Adobe) <szilles@adobe.com>

Abstract

XSL is a language for expressing stylesheets. It consists of two parts:

  1. a language for transforming XML documents, and

  2. an XML vocabulary for specifying formatting semantics.

An XSL stylesheet specifies the presentation of a class of XML documents by describing how an instance of the class is transformed into an XML document that uses the formatting vocabulary.

Status of this document

This is a W3C Working Draft for review by W3C members and other interested parties. The XSL Working Group considers that this draft is stable and ready to move to Candidate Recommendation status, following the successful resolution of comments. This is therefore the last call for comments on this Working Draft. Please send detailed comments to xsl-editors@w3.org before 30 April 2000; archives of the comments are available. More general public discussion of XSL takes place on the XSL-List mailing list.

It is a draft document and may be updated, replaced, or obsoleted by other documents at any time. The XSL Working Group will not allow early implementation to constrain its ability to make changes to this specification prior to final release. It is inappropriate to use W3C Working Drafts as reference material or to cite them as other than "work in progress". A list of current W3C working drafts can be found at http://www.w3.org/TR.

This document has been produced as part of the W3C Style Activity by the XSL Working Group (members only).

Table of contents

1 Introduction and Overview
    1.1 Processing a Stylesheet
        1.1.1 Tree Transformations
        1.1.2 Formatting
    1.2 Benefits of XSL
        1.2.1 Paging and Scrolling
        1.2.2 Selectors and Tree Construction
        1.2.3 An Extended Page Layout Model
        1.2.4 A Comprehensive Area Model
        1.2.5 Internationalization and Writing-Modes
        1.2.6 Linking
2 Introduction to XSL Transformation
    2.1 Tree Construction
    2.2 XSL Namespace
3 Introduction to Formatting
    3.1 Conceptual Procedure
4 Area Model
    4.1 Introduction
    4.2 Rectangular Areas
        4.2.1 Area Types
        4.2.2 Common Traits
        4.2.3 Geometric Definitions
        4.2.4 Tree Ordering
        4.2.5 Stacking Constraints
        4.2.6 Font Baseline Tables
    4.3 Spaces and Conditionality
        4.3.1 Space-resolution Rules
    4.4 Block-areas
    4.5 Stacked Block-areas
    4.6 Line-areas
    4.7 Inline-areas
    4.8 Stacked Inline-areas
    4.9 Glyph-areas
    4.10 Ordering Constraints
        4.10.1 General Ordering Constraints
        4.10.2 Line-building
        4.10.3 Inline-building
    4.11 Keeps and Breaks
    4.12 Rendering Model
        4.12.1 Geometry
        4.12.2 Viewport Geometry
        4.12.3 Visibility
        4.12.4 Border, Padding, and Background
        4.12.5 Intrinsic Marks
        4.12.6 Layering and Conflict of Marks
    4.13 Sample Area Tree
    4.14 List of Traits on Areas
5 Property Refinement / Resolution
    5.1 Specified, Computed, and Actual Values, and Inheritance
        5.1.1 Specified Values
        5.1.2 Computed Values
        5.1.3 Actual Values
        5.1.4 Inheritance
    5.2 Shorthand Expansion
    5.3 Computing the Values of Corresponding Properties
        5.3.1 Border and Padding Properties
        5.3.2 Margin, Space, and Indent Properties
        5.3.3 Height, and Width Properties
        5.3.4 Overconstrained Geometry
    5.4 Simple Property to Trait Mapping
        5.4.1 Background-position-horizontal and background-position-vertical Properties
        5.4.2 Column-number Property
        5.4.3 Text-align Property
        5.4.4 Text-align-last Property
        5.4.5 z-index Property
    5.5 Complex Property to Trait Mapping
        5.5.1 Word-spacing and Letter-spacing Properties
        5.5.2 Reference-orientation Property
        5.5.3 Writing-mode and Direction Properties
        5.5.4 Absolute-position Property
        5.5.5 Relative-position Property
        5.5.6 Text-decoration Property
    5.6 Non-property Based Trait Generation
    5.7 Property Based Transformations
        5.7.1 Text-transform Property
    5.8 Expressions
        5.8.1 Property Context
        5.8.2 Evaluation Order
        5.8.3 Basics
        5.8.4 Function Calls
        5.8.5 Numerics
        5.8.6 Absolute Numerics
        5.8.7 Relative Numerics
        5.8.8 Strings
        5.8.9 Colors
        5.8.10 Keywords
        5.8.11 Lexical Structure
        5.8.12 Expression Value Conversions
        5.8.13 Definitions of Units of Measure
    5.9 Core Function Library
        5.9.1 Number Functions
        5.9.2 Color Functions
        5.9.3 Font Functions
        5.9.4 Property Value Functions
    5.10 Property Datatypes
6 Formatting Objects
    6.1 Introduction to Formatting Objects
        6.1.1 Definitions Common to Many Formatting Objects
    6.2 Formatting Object Content
    6.3 Formatting Objects Summary
    6.4 Declarations and Pagination and Layout Formatting Objects
        6.4.1 Introduction
        6.4.2 fo:root
        6.4.3 fo:declarations
        6.4.4 fo:color-profile
        6.4.5 fo:page-sequence
        6.4.6 fo:layout-master-set
        6.4.7 fo:page-sequence-master
        6.4.8 fo:single-page-master-reference
        6.4.9 fo:repeatable-page-master-reference
        6.4.10 fo:repeatable-page-master-alternatives
        6.4.11 fo:conditional-page-master-reference
        6.4.12 fo:simple-page-master
        6.4.13 fo:region-body
        6.4.14 fo:region-before
        6.4.15 fo:region-after
        6.4.16 fo:region-start
        6.4.17 fo:region-end
        6.4.18 fo:flow
        6.4.19 fo:static-content
        6.4.20 fo:title
    6.5 Block-level Formatting Objects
        6.5.1 Introduction
        6.5.2 fo:block
        6.5.3 fo:block-container
    6.6 Inline-level Formatting Objects
        6.6.1 Introduction
        6.6.2 fo:bidi-override
        6.6.3 fo:character
        6.6.4 fo:initial-property-set
        6.6.5 fo:external-graphic
        6.6.6 fo:instream-foreign-object
        6.6.7 fo:inline
        6.6.8 fo:inline-container
        6.6.9 fo:leader
        6.6.10 fo:page-number
        6.6.11 fo:page-number-citation
    6.7 Formatting Objects for Tables
        6.7.1 Introduction
        6.7.2 fo:table-and-caption
        6.7.3 fo:table
        6.7.4 fo:table-column
        6.7.5 fo:table-caption
        6.7.6 fo:table-header
        6.7.7 fo:table-footer
        6.7.8 fo:table-body
        6.7.9 fo:table-row
        6.7.10 fo:table-cell
    6.8 Formatting Objects for Lists
        6.8.1 Introduction
        6.8.2 fo:list-block
        6.8.3 fo:list-item
        6.8.4 fo:list-item-body
        6.8.5 fo:list-item-label
    6.9 Link and Multi Formatting Objects
        6.9.1 Introduction
        6.9.2 fo:simple-link
        6.9.3 fo:multi-switch
        6.9.4 fo:multi-case
        6.9.5 fo:multi-toggle
        6.9.6 fo:multi-properties
        6.9.7 fo:multi-property-set
    6.10 Out-of-Line Formatting Objects
        6.10.1 Introduction
        6.10.2 fo:float
        6.10.3 fo:footnote
        6.10.4 fo:footnote-body
    6.11 Other Formatting Objects
        6.11.1 Introduction
        6.11.2 fo:wrapper
        6.11.3 fo:marker
        6.11.4 fo:retrieve-marker
7 Formatting Properties
    7.1 Description of Property Groups
    7.2 XSL Areas and the CSS Box Model
    7.3 Common Accessibility Properties
        7.3.1 source-document
        7.3.2 role
    7.4 Common Absolute Position Properties
        7.4.1 absolute-position
        7.4.2 top
        7.4.3 right
        7.4.4 bottom
        7.4.5 left
    7.5 Common Aural Properties
        7.5.1 azimuth
        7.5.2 cue-after
        7.5.3 cue-before
        7.5.4 elevation
        7.5.5 pause-after
        7.5.6 pause-before
        7.5.7 pitch
        7.5.8 pitch-range
        7.5.9 play-during
        7.5.10 richness
        7.5.11 speak
        7.5.12 speak-header
        7.5.13 speak-numeral
        7.5.14 speak-punctuation
        7.5.15 speech-rate
        7.5.16 stress
        7.5.17 voice-family
        7.5.18 volume
    7.6 Common Border, Padding, and Background Properties
        7.6.1 background-attachment
        7.6.2 background-color
        7.6.3 background-image
        7.6.4 background-repeat
        7.6.5 background-position-horizontal
        7.6.6 background-position-vertical
        7.6.7 border-before-color
        7.6.8 border-before-style
        7.6.9 border-before-width
        7.6.10 border-after-color
        7.6.11 border-after-style
        7.6.12 border-after-width
        7.6.13 border-start-color
        7.6.14 border-start-style
        7.6.15 border-start-width
        7.6.16 border-end-color
        7.6.17 border-end-style
        7.6.18 border-end-width
        7.6.19 border-top-color
        7.6.20 border-top-style
        7.6.21 border-top-width
        7.6.22 border-bottom-color
        7.6.23 border-bottom-style
        7.6.24 border-bottom-width
        7.6.25 border-left-color
        7.6.26 border-left-style
        7.6.27 border-left-width
        7.6.28 border-right-color
        7.6.29 border-right-style
        7.6.30 border-right-width
        7.6.31 padding-before
        7.6.32 padding-after
        7.6.33 padding-start
        7.6.34 padding-end
        7.6.35 padding-top
        7.6.36 padding-bottom
        7.6.37 padding-left
        7.6.38 padding-right
    7.7 Common Font Properties
        7.7.1 font-family
        7.7.2 font-size
        7.7.3 font-stretch
        7.7.4 font-size-adjust
        7.7.5 font-style
        7.7.6 font-variant
        7.7.7 font-weight
    7.8 Common Hyphenation Properties
        7.8.1 country
        7.8.2 language
        7.8.3 script
        7.8.4 hyphenate
        7.8.5 hyphenation-character
        7.8.6 hyphenation-push-character-count
        7.8.7 hyphenation-remain-character-count
    7.9 Common Margin Properties-Block
        7.9.1 margin-top
        7.9.2 margin-bottom
        7.9.3 margin-left
        7.9.4 margin-right
        7.9.5 space-before
        7.9.6 space-after
        7.9.7 start-indent
        7.9.8 end-indent
    7.10 Common Margin Properties-Inline
        7.10.1 space-end
        7.10.2 space-start
    7.11 Area Alignment Properties
        7.11.1 alignment-adjust
        7.11.2 baseline-identifier
        7.11.3 baseline-shift
        7.11.4 display-align
        7.11.5 dominant-baseline
        7.11.6 relative-align
    7.12 Area Dimension Properties
        7.12.1 block-progression-dimension
        7.12.2 content-height
        7.12.3 content-width
        7.12.4 height
        7.12.5 inline-progression-dimension
        7.12.6 max-height
        7.12.7 max-width
        7.12.8 min-height
        7.12.9 min-width
        7.12.10 scaling
        7.12.11 scaling-method
        7.12.12 width
    7.13 Block and Line-related Properties
        7.13.1 hyphenation-keep
        7.13.2 hyphenation-ladder-count
        7.13.3 last-line-end-indent
        7.13.4 line-height
        7.13.5 line-height-shift-adjustment
        7.13.6 line-stacking-strategy
        7.13.7 linefeed-treatment
        7.13.8 space-treatment
        7.13.9 text-align
        7.13.10 text-align-last
        7.13.11 text-indent
        7.13.12 white-space-collapse
        7.13.13 wrap-option
    7.14 Character Properties
        7.14.1 character
        7.14.2 letter-spacing
        7.14.3 suppress-at-line-break
        7.14.4 text-decoration
        7.14.5 text-shadow
        7.14.6 text-transform
        7.14.7 treat-as-word-space
        7.14.8 word-spacing
    7.15 Color-related Properties
        7.15.1 color
        7.15.2 color-profile-name
        7.15.3 rendering-intent
    7.16 Float-related Properties
        7.16.1 clear
        7.16.2 float
    7.17 Keeps and Breaks Properties
        7.17.1 break-after
        7.17.2 break-before
        7.17.3 keep-together
        7.17.4 keep-with-next
        7.17.5 keep-with-previous
        7.17.6 orphans
        7.17.7 widows
    7.18 Layout-related Properties
        7.18.1 clip
        7.18.2 overflow
        7.18.3 reference-orientation
        7.18.4 relative-position
        7.18.5 span
    7.19 Leader and Rule Properties
        7.19.1 leader-alignment
        7.19.2 leader-pattern
        7.19.3 leader-pattern-width
        7.19.4 leader-length
        7.19.5 rule-style
        7.19.6 rule-thickness
    7.20 Properties for Links
        7.20.1 active-state
    7.21 auto-restore
    7.22 case-name
    7.23 case-title
    7.24 destination-placement-offset
    7.25 external-destination
    7.26 indicate-destination
    7.27 internal-destination
    7.28 show-destination
    7.29 starting-state
    7.30 switch-to
    7.31 Properties for Markers
        7.31.1 marker-class-name
        7.31.2 retrieve-class-name
        7.31.3 retrieve-position
        7.31.4 retrieve-boundary
    7.32 Properties for Number to String Conversion
        7.32.1 format
        7.32.2 grouping-separator
        7.32.3 grouping-size
        7.32.4 letter-value
    7.33 Pagination and Layout Properties
        7.33.1 blank-or-not-blank
        7.33.2 column-count
        7.33.3 column-gap
        7.33.4 extent
        7.33.5 flow-name
        7.33.6 force-page-count
        7.33.7 initial-page-number
        7.33.8 master-name
        7.33.9 maximum-repeats
        7.33.10 odd-or-even
        7.33.11 page-height
        7.33.12 page-position
        7.33.13 page-width
        7.33.14 precedence
        7.33.15 region-name
    7.34 Table Properties
        7.34.1 border-collapse
        7.34.2 border-separation
        7.34.3 caption-side
        7.34.4 column-number
        7.34.5 column-width
        7.34.6 empty-cells
        7.34.7 ends-row
        7.34.8 number-columns-repeated
        7.34.9 number-columns-spanned
        7.34.10 number-rows-spanned
        7.34.11 starts-row
        7.34.12 table-layout
        7.34.13 table-omit-footer-at-break
        7.34.14 table-omit-header-at-break
    7.35 Writing-mode-related Properties
        7.35.1 direction
        7.35.2 font-height-override-after
        7.35.3 font-height-override-before
        7.35.4 glyph-orientation-horizontal
        7.35.5 glyph-orientation-vertical
        7.35.6 unicode-bidi
        7.35.7 writing-mode
    7.36 Miscellaneous Properties
        7.36.1 content-type
        7.36.2 id
        7.36.3 provisional-label-separation
        7.36.4 provisional-distance-between-starts
        7.36.5 ref-id
        7.36.6 score-spaces
        7.36.7 src
        7.36.8 visibility
        7.36.9 z-index
    7.37 Shorthand Properties
        7.37.1 background
        7.37.2 background-position
        7.37.3 border
        7.37.4 border-bottom
        7.37.5 border-color
        7.37.6 border-left
        7.37.7 border-right
        7.37.8 border-style
        7.37.9 border-spacing
        7.37.10 border-top
        7.37.11 border-width
        7.37.12 cue
        7.37.13 font
        7.37.14 margin
        7.37.15 padding
        7.37.16 page-break-after
        7.37.17 page-break-before
        7.37.18 page-break-inside
        7.37.19 pause
        7.37.20 position
        7.37.21 size
        7.37.22 vertical-align
        7.37.23 white-space
        7.37.24 xml:lang
8 Conformance

Appendices

A Internationalization
    A.1 Additional writing-mode values
B Formatting Object Summary
    B.1 Declaration and Pagination and Layout Formatting Objects
    B.2 Block Formatting Objects
    B.3 Inline Formatting Objects
    B.4 Table Formatting Objects
    B.5 List Formatting Objects
    B.6 Link and Multi Formatting Objects
    B.7 Out-of-line Formatting Objects
    B.8 Other Formatting Objects
C Property Index
    C.1 Explanation of Trait Mapping Values:
    C.2 Property Table: Part I
    C.3 Property Table: Part II
D References
    D.1 Normative References
    D.2 Other References
E Property Index
F Acknowledgements (Non-Normative)