Book description
After years of anticipation and delay, the W3C finally released the XSLT 2.0 standard in January 2007. The revised edition of this classic book offers practical, real-world examples that demonstrate how you can apply XSLT stylesheets to XML data using either the new specification, or the older XSLT 1.0 standard.
XSLT is a critical language for converting XML documents into other formats, such as HTML code or a PDF file. With XSLT, you get a thorough understanding of XSLT and XPath and their relationship to other web standards, along with recommendations for a honed toolkit in an open platform-neutral, standards-based environment. This book:
- Covers the XSLT basics, including simple stylesheets and methods for setting up transformation engines
- Walks you through the many parts of XSLT, particularly XSLT's template-based approach to transformations
- Applies both XSLT 1.0 and 2.0 solutions to the same problems, helping you decide which version of XSLT is more appropriate for your project
- Includes profuse examples that complement both the tutorial and the reference material
The new edition of XSLT has been updated thoroughly to explain XSLT 2.0's many dependencies, notably XML Schema and XPath 2.0. Want to find out how the 2.0 specification improves on the old? This book will explain.
Publisher resources
Table of contents
- Dedication
- A Note Regarding Supplemental Files
- Preface
-
1. Getting Started
- The Design of XSLT
-
XML Basics
- XML’s Heritage
-
XML Document Rules
- An XML document must be contained in a single element
- All elements must be nested
- All attributes must be quoted
- XML tags are case-sensitive
- All end tags are required
- Empty tags can contain the end marker
- XML declarations
- Document Type Definitions (DTDs) and XML Schemas
- Well-formed versus valid documents
- Tags versus elements
- Namespaces
- [2.0] Datatypes
- Programming Interfaces for XML: DOM, SAX, and Others
-
XSLT Standards
- XSL transformations (XSLT) version 1.0
- XML path language (XPath) version 1.0
- XSL transformations (XSLT) version 2.0
- XML path language (XPath) version 2.0
- XQuery 1.0 and XPath 2.0 Data Model (XDM)
- XQuery 1.0 and XPath 2.0 functions and operators
- XQuery 1.0 and XPath 2.0 formal semantics
- XSLT 2.0 and XQuery 1.0 serialization
- XQuery 1.0: an XML query language
- XML syntax for XQuery 1.0 (XQueryX)
-
XML Standards
- XML 1.0
- XML 1.1
- The Extensible Stylesheet Language (XSL)
- XML Schemas
- RelaxNG
- Schematron
- The Simple API for XML (SAX)
- Document Object Model (DOM)
- Namespaces in XML
- Associating stylesheets with XML documents
- Scalable Vector Graphics (SVG)
- XML pointer language (XPointer) version 1.0
- XML linking language (XLink) version 1.0
- Installing XSLT Processors
- Summary
-
2. The Obligatory Hello World Example
- Goals of This Chapter
- Transforming Hello World
- How a Stylesheet Is Processed
- Stylesheet Structure
- Sample Gallery
- Summary
-
3. XPath: A Syntax for Describing Needles
and Haystacks
- The XPath Data Model
- Location Paths
- Attribute Value Templates
- Datatypes
-
XPath Operators
- Mathematical Operators
- Boolean Operators
- [2.0] Conditional Expressions—if, then, and else
- [2.0] Iterators Over Sequences—The for Operator
- [2.0] Quantified Expressions—some and every
- [2.0] Range Expressions—The to Operator
- [2.0] Constructor Functions
- [2.0] Datatype Operators—instance of, castable as, cast as, and treat as
- [2.0] Set Operators—except, intersect, and union
- [2.0] Node Operators
- [2.0] Comments in XPath Expressions
- [2.0] Types of XSLT 2.0 Processors
- The XPath View of an XML Document
- Summary
- 4. Creating Output
- 5. Branching and Control Elements
- 6. Creating Links and Cross-References
- 7. Sorting and Grouping Elements
-
8. Combining Documents
- The document() Function
- The document() Function and Sorting
- Implementing Lookup Tables
- Grouping Across Multiple Documents
- [2.0] Using XSLT 2.0 to Simplify Things
- [2.0] The doc() and doc-available() Functions
- [2.0] The collection() Function
- [2.0] The unparsed-text() and unparsed-text-available() Functions
- Summary
-
9. Extending XSLT
- The XSLT Extension Mechanism
- [2.0] Creating New Functions with <xsl:function>
- Example: Generating Multiple Output Files
- Creating Custom Collations
- Generating Hidden Word Graphics
- Example: Generating an SVG Pie Chart
- Writing Extensions in Other Languages
- Using Extension Functions from the EXSLT Library
- Accessing a Database with an Extension Element
- Creating a Photo Album with an Extension Element
- Summary
-
A. XSLT Reference
- [2.0] Attributes common to all XSLT elements
- [2.0] <xsl:analyze-string>
- <xsl:apply-imports>
- <xsl:apply-templates>
- <xsl:attribute>
- <xsl:attribute-set>
- <xsl:call-template>
- [2.0] <xsl:character-map>
- <xsl:choose>
- <xsl:comment>
- <xsl:copy>
- <xsl:copy-of>
- <xsl:decimal-format>
- [2.0] <xsl:document>
- <xsl:element>
- <xsl:fallback>
- <xsl:for-each>
- [2.0] <xsl:for-each-group>
- [2.0] <xsl:function>
- <xsl:if>
- <xsl:import>
- [2.0 – Schema] <xsl:import-schema>
- <xsl:include>
- <xsl:key>
- [2.0] <xsl:matching-substring>
- <xsl:message>
- [2.0] <xsl:namespace>
- <xsl:namespace-alias>
- [2.0] <xsl:next-match>
- [2.0] <xsl:non-matching-substring>
- <xsl:number>
- <xsl:otherwise>
- <xsl:output>
- [2.0] <xsl:output-character>
- <xsl:param>
- [2.0] <xsl:perform-sort>
- <xsl:preserve-space>
- <xsl:processing-instruction>
- [2.0] <xsl:result-document>
- [2.0] <xsl:sequence>
- <xsl:sort>
- <xsl:strip-space>
- <xsl:stylesheet>
- <xsl:template>
- <xsl:text>
- <xsl:transform>
- <xsl:value-of>
- <xsl:variable>
- <xsl:when>
- <xsl:with-param>
- B. XPath Reference
-
C. XSLT, XPath, and XQuery Function
Reference
-
Kinds of Functions
- Accessor Functions
- Boolean Functions
- Constructor Functions
- Context Functions
- Cross-Referencing and Grouping Functions
- Date, Time, and Duration Functions
- Node Functions
- Numeric Functions
- QName Functions
- Regular Expression Functions
- Sequence or Node-Set Functions
- String Functions
- Miscellaneous Functions
- Collation Functions
-
Kinds of Functions
- D. XML Schema Overview
- E. [2.0] Regular Expressions
- F. XSLT Formatting Codes
- G. XSLT 2.0 Migration Guide
- Glossary
- Index
- Colophon
- Copyright
Product information
- Title: XSLT, 2nd Edition
- Author(s):
- Release date: June 2008
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9780596527211
You might also like
book
XSLT Cookbook, 2nd Edition
Forget those funky robot toys that were all the rage in the '80s, XSLT (Extensible Stylesheet …
book
Learning XSLT
XSLT is a powerful language for transforming XML documents into something else. That something else can …
book
XSLT
XSLT documents a core technology for processing XML. Originally created for page layout, XSLT (Extensible Stylesheet …
book
XSLT for Dummies
Restructuring information in an XML document so that it works in other formats used to be …