Extensible Stylesheet Language (XSL) Version 1.0
Total Page:16
File Type:pdf, Size:1020Kb
Extensible Stylesheet Language (XSL) Version 1.0 W3C Candidate Recommendation 21 November 2000 This version: http://www.w3.org/TR/2000/CR-xsl-20001121/ (PDF by RenderX, 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-20001018 Authors and Contributors: Sharon Adler (IBM) <[email protected]> Anders Berglund (IBM) <[email protected]> Jeff Caruso (Pageflex) <[email protected]> Stephen Deach (Adobe) <[email protected]> Paul Grosso (ArborText) <[email protected]> Eduardo Gutentag (Sun) <[email protected]> Alex Milowski (Lexica) <[email protected]> Scott Parnell (Xerox) <[email protected]> Jeremy Richman (BroadVision) <[email protected]> Steve Zilles (Adobe) <[email protected]> Copyright © 2000 W3C (MIT, INRIA, Keio), All Rights Reserved. W3C liability, trademark, document use and software licensing rules apply. ii Extensible Stylesheet Language (XSL) (xsl-20001121) 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 document is a W3C Candidate Recommendation. The XSL WG considers this specification to be stable and encourges implementation and comment during the CR review period. The Candidate Recommendation review period ends on February 28, 2001. Please send detailed comments and reports of implementation experience to [email protected] before the end of the CR review period. Archives of the comments are available. More general public discussion of XSL takes place on the XSL-List mailing list. Should this specification prove impossible to implement, the Working Group will return the document to Working Draft status and make necessary changes. Otherwise, the Working Group anticipates asking the W3C Director to advance this document to Proposed Recommendation. This document has been produced as part of the W3C Style Activity by the XSL Working Group (members only). A list of current W3C working drafts can be found at http://www.w3.org/TR. They may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use W3C Candidate Recommendations as reference material or to cite them as other than "work in progress". W3C Candidate Recommendation Extensible Stylesheet Language (XSL) (xsl-20001121) iii Table of Contents 1. Introduction and Overview 1 1.1. Processing a Stylesheet 1 1.1.1. Tree Transformations 2 1.1.2. Formatting 3 1.2. Benefits of XSL 6 1.2.1. Paging and Scrolling 6 1.2.2. Selectors and Tree Construction 7 1.2.3. An Extended Page Layout Model 8 1.2.4. A Comprehensive Area Model 8 1.2.5. Internationalization and Writing-Modes 8 1.2.6. Linking 9 2. Introduction to XSL Transformation 9 2.1. Tree Construction 9 2.2. XSL Namespace 9 3. Introduction to Formatting 10 3.1. Conceptual Procedure 11 4. Area Model 12 4.1. Introduction 12 4.2. Rectangular Areas 14 4.2.1. Area Types 14 4.2.2. Common Traits 14 4.2.3. Geometric Definitions 15 4.2.4. Tree Ordering 18 4.2.5. Stacking Constraints 19 4.2.6. Font Baseline Tables 24 4.3. Spaces and Conditionality 24 4.3.1. Space-resolution Rules 25 4.4. Block-areas 25 4.4.1. Stacked Block-areas 26 4.4.2. Intrusion Adjustments 27 4.5. Line-areas 28 4.6. Inline-areas 29 4.6.1. Stacked Inline-areas 30 4.6.2. Glyph-areas 30 4.7. Ordering Constraints 31 4.7.1. General Ordering Constraints 31 W3C Candidate Recommendation iv Extensible Stylesheet Language (XSL) (xsl-20001121) 4.7.2. Line-building 31 4.7.3. Inline-building 32 4.8. Keeps and Breaks 32 4.9. Rendering Model 33 4.9.1. Geometry 33 4.9.2. Viewport Geometry 34 4.9.3. Visibility 34 4.9.4. Border, Padding, and Background 34 4.9.5. Intrinsic Marks 35 4.9.6. Layering and Conflict of Marks 35 4.10. Sample Area Tree 36 5. Property Refinement / Resolution 36 5.1. Specified, Computed, and Actual Values, and Inheritance 37 5.1.1. Specified Values 37 5.1.2. Computed Values 37 5.1.3. Actual Values 38 5.1.4. Inheritance 38 5.2. Shorthand Expansion 38 5.3. Computing the Values of Corresponding Properties 39 5.3.1. Border and Padding Properties 40 5.3.2. Margin, Space, and Indent Properties 41 5.3.3. Height, and Width Properties 41 5.3.4. Overconstrained Geometry 43 5.4. Simple Property to Trait Mapping 43 5.4.1. Background-position-horizontal and background-position-vertical Properties 44 5.4.2. Column-number Property 44 5.4.3. Text-align Property 44 5.4.4. Text-align-last Property 44 5.4.5. z-index Property 44 5.5. Complex Property to Trait Mapping 44 5.5.1. Word-spacing and Letter-spacing Properties 44 5.5.2. Reference-orientation Property 44 5.5.3. Writing-mode and Direction Properties 44 5.5.4. Absolute-position Property 44 5.5.5. Relative-position Property 45 5.5.6. Text-decoration Property 45 5.5.7. Font Properties 45 5.6. Non-property Based Trait Generation 46 5.7. Property Based Transformations 46 5.7.1. Text-transform Property 46 W3C Candidate Recommendation Extensible Stylesheet Language (XSL) (xsl-20001121) v 5.8. Unicode Bidi Processing 46 5.9. Expressions 49 5.9.1. Property Context 49 5.9.2. Evaluation Order 49 5.9.3. Basics 50 5.9.4. Function Calls 50 5.9.5. Numerics 50 5.9.6. Absolute Numerics 51 5.9.7. Relative Numerics 52 5.9.7.1. Percents 52 5.9.7.2. Relative Lengths 52 5.9.8. Strings 52 5.9.9. Colors 52 5.9.10. Keywords 52 5.9.10.1. inherit 53 5.9.11. Lexical Structure 53 5.9.12. Expression Value Conversions 54 5.9.13. Definitions of Units of Measure 54 5.9.13.1. Pixels 54 5.10. Core Function Library 55 5.10.1. Number Functions 55 5.10.2. Color Functions 56 5.10.3. Font Functions 56 5.10.4. Property Value Functions 57 5.11. Property Datatypes 58 6. Formatting Objects 61 6.1. Introduction to Formatting Objects 61 6.1.1. Definitions Common to Many Formatting Objects 62 6.2. Formatting Object Content 63 6.3. Formatting Objects Summary 64 6.4. Declarations and Pagination and Layout Formatting Objects 68 6.4.1. Introduction 68 6.4.1.1. Page-sequence-masters 68 6.4.1.2. Page-masters 69 6.4.1.3. Page Generation 70 6.4.1.4. Flows and Flow Mapping 70 6.4.1.5. Constraints on Page Generation 71 6.4.1.6. Pagination Tree Structure 71 6.4.2. fo:root 71 6.4.3. fo:declarations 72 6.4.4. fo:color-profile 72 6.4.5. fo:page-sequence 73 W3C Candidate Recommendation vi Extensible Stylesheet Language (XSL) (xsl-20001121) 6.4.6. fo:layout-master-set 74 6.4.7. fo:page-sequence-master 75 6.4.8. fo:single-page-master-reference 75 6.4.9. fo:repeatable-page-master-reference 76 6.4.10. fo:repeatable-page-master-alternatives 76 6.4.11. fo:conditional-page-master-reference 77 6.4.12. fo:simple-page-master 78 6.4.13. fo:region-body 82 6.4.14. fo:region-before 85 6.4.15. fo:region-after 86 6.4.16. fo:region-start 88 6.4.17. fo:region-end 89 6.4.18. fo:flow 90 6.4.19. fo:static-content 91 6.4.20. fo:title 91 6.5. Block-level Formatting Objects 92 6.5.1. Introduction 92 6.5.1.1. Example 92 6.5.1.1.1. Chapter and Section Titles, Paragraphs 92 6.5.2. fo:block 94 6.5.3. fo:block-container 96 6.6. Inline-level Formatting Objects 97 6.6.1. Introduction 97 6.6.1.1. Examples 97 6.6.1.1.1. First Line of Paragraph in Small-caps 97 6.6.1.1.2. Figure with a Photograph 98 6.6.1.1.3. Page numbering and page number reference 98 6.6.2. fo:bidi-override 100 6.6.3. fo:character 101 6.6.4. fo:initial-property-set 102 6.6.5. fo:external-graphic 103 6.6.6. fo:instream-foreign-object 105 6.6.7. fo:inline 106 6.6.8. fo:inline-container 107 6.6.9. fo:leader 109 6.6.10. fo:page-number 111 6.6.11. fo:page-number-citation 112 6.7. Formatting Objects for Tables 113 6.7.1. Introduction 113 6.7.1.1. Examples 113 6.7.1.1.1. Simple Table with Relative Column-width Specifications 113 6.7.2. fo:table-and-caption 117 6.7.3. fo:table 118 W3C Candidate Recommendation Extensible Stylesheet Language (XSL) (xsl-20001121) vii 6.7.4. fo:table-column 120 6.7.5. fo:table-caption 121 6.7.6. fo:table-header 122 6.7.7. fo:table-footer 123 6.7.8. fo:table-body 123 6.7.9. fo:table-row 124 6.7.10. fo:table-cell 124 6.8. Formatting Objects for Lists 126 6.8.1.