[Accessibility conventions are described at the bottom of the page]
*** This is a free preview excerpt of a commercial publication. ***
Table of Contents
1. The context of XSLT and XPath
1.1 The XML family of Recommendations
1.1.1 Extensible Markup Language (XML)
1.1.2 XML information links
1.1.3 XML Path Language (XPath)
1.1.4 Styling structured information
1.1.5 Extensible Stylesheet Language (XSL/XSL-FO)
1.1.6 Extensible Stylesheet Language Transformations (XSLT)
1.1.7 XSLT properties
1.1.8 Historical development of the XSL and XQuery Recommendations
1.1.9 XSL information links
1.1.10 Namespaces
1.1.11 Stylesheet association
1.2 Transformation data flows
1.2.1 Transformation from XML to XML
1.2.2 Transformation from XML to non-XML
1.2.3 Transforming and rendering XML information using XSLT and XSL-FO
1.2.4 XML to binary or other formats
1.2.5 XSLT as an application front-end
1.2.6 Three-tiered architectures
1.2.7 XSLT and XQuery on the wire
2. Getting started with XSLT and XPath
2.1 Transform examples
2.1.1 Some simple examples
2.2 Syntax basics
2.2.1 XSLT stylesheet requirements
2.2.2 XSLT instructions and literal result elements
2.2.3 XSLT templates and template rules
2.2.4 XSLT stylesheet components
2.3 Approaches to transform design
2.3.1 Pull and push constructs
2.4 More transform examples
2.4.1 Processing XML with many transforms
3. XPath data model
4. Processing model
5. Transformation environment
6. Transform and data management
7. Data type expressions and functions
8. Constructing the result tree
9. Sorting and grouping
A. XML to HTML transformation
B. XSL formatting semantics introduction
C. Instruction, function and grammar summaries
C.1 Vocabulary, functions and grammars XSLT 1.0 and XPath 1.0
C.1.1 XSLT 1.0 element summary
C.1.2 XPath 1.0 and XSLT 1.0 function summary
C.1.3 XPath 1.0 grammar productions
C.1.4 XSLT 1.0 grammar productions
C.2 Vocabulary, functions and grammars XSLT 2.0 and XPath 2.0
C.2.1 XSLT 2.0 element summary
C.2.2 XPath 2.0 and XSLT 2.0 function summary
C.2.3 XPath 2.0 grammar productions
C.2.4 XSLT 2.0 grammar productions
D. Tool questions
D.1 XSLStyle™
D.1.1 XSLStyle™
Notices
Copyrights
[[1] - Pursuant to [http://www.w3.org/Consortium/Legal/ipr-notice.html], some information included in this publication is from copyrighted material from the World Wide Web Consortium as described in [http://www.w3.org/Consortium/Legal/copyright-documents.html]: Copyright (C) 1995-2011 World Wide Web Consortium, (Massachusetts Institute of Technology, Institut National de Recherche en Informatique et en Automatique, Keio University). All Rights Reserved. The status and titles of the documents referenced are listed in the body of this work where first used.
[1] - Other original material herein is copyright (C) 1998-2011 Crane Softwrights Ltd. This is commercial material and may not be copied or distributed by any means whatsoever without the expressed permission of Crane Softwrights Ltd.
]
Disclaimer
[[1] - By purchasing and/or using any product from Crane Softwrights Ltd. ("Crane"), the product user ("reader") understands that this product may contain errors and/or other inaccuracies that may result in a failure to use the product itself or other software claiming to utilize any proposed or finalized standards or recommendations referenced therein. Consequently, it is provided "AS IS" and Crane disclaims any warranty, conditions, or liability obligations to the reader of any kind. The reader understands and agrees that Crane does not make any express, implied, or statutory warranty or condition of any kind for the product including, but not limited to, any warranty or condition with regard to satisfactory quality, merchantable quality, merchantability or fitness for any particular purpose, or such arising by law, statute, usage of trade, course of dealing or otherwise. In no event will Crane be liable for (a) punitive or aggravated damages; (b) any direct or indirect damages, including any lost profits, lost savings, damaged data or other commercial or economic loss, or any other incidental or consequential damages even if Crane or any of its representatives have been advised of the possibility of such damages or they are foreseeable; or (c) for any claim of any kind by any other party. Reader acknowledges and agrees that they bear the entire risk as to the quality of the product.
]
Preface
Preface
The main content of this book is in an unconventional style primarily in bulleted form
[[1] - derivations of the book are used for instructor-led training, requiring the succinct presentation
[[2] - note the exercises included in instructor-led training sessions are not included in the book
][1] - derivations of the book can be licensed and branded for customer use in delivering training
[1] - the objective of this style is to convey the essence and details desired in a compact, easily perused form, thereby reducing the search for key words and phrases in lengthy paragraphs
[1] - each chapter of the book corresponds to a module of the training
[1] - each page of the book corresponds to a frame presented in the training
[1] - a summary of subsections and their pages is at the back of the book
]
Much of the content is hyperlinked both internally and externally to the book in the 1-up full-page sized electronic renditions:
[[1] - (note the Acrobat Reader "back" keystroke sequence is "Ctrl-Left")
[1] - page references (e.g.: [Chapter 2.])
[1] - external references (e.g.: [http://www.w3.org/TR/1999/REC-xslt-19991116])
[1] - chapter references in book summary
[1] - section references in chapter summary
[1] - subsection references in table of contents at the back of the book
[1] - hyperlinks are not present in the cut, stacked, half-page, or 2-up renditions of the material
]
Prologue
This book is oriented to the stylesheet writer, not the processor implementer
[[1] - certain behaviors important to an implementer are not included
[1] - objective to help a stylesheet writer understand the language facilities needed to solve their problem
[[2] - a language reference arranged thematically to assist comprehension
[2] - a different arrangement than the Recommendations themselves
]]
This book covers every element, every attribute and every function of both XSLT and XPath, both versions 1.0 and 2.0:
[[1] - [P1.0]content specific to XPath 1.0 is marked with a "P1" icon at the beginning of the line
[1] - [P2.0]content specific to XPath 2.0 is marked with a "P2" icon at the beginning of the line
[1] - [T1.0]content specific to XSLT 1.0 is marked with a "T1" icon at the beginning of the line
[1] - [T2.0]content specific to XSLT 2.0 is marked with a "T2" icon at the beginning of the line
]
First two chapters are introductory in nature
[[1] - overview of context of XSLT and XPath amongst other members of the XML family of Recommendations
[1] - basic flow diagrams illustrate use of XSLT
[1] - basic terminology and approaches are defined and explained
]
Third and fourth chapters cover essential bases of understanding
[[1] - data model and processing model for document representation and behavior
[1] - important to understand the models in order to apply the language features
]
Fifth through ninth chapters address XSLT vocabulary
[[1] - every element, attribute and function not already covered when describing the models
[1] - no particular order of the chapters, but example code only uses constructs already introduced in earlier content
]
First two annexes overview HTML and XSL-FO as related to using XSLT
[[1] - considerations of using XSLT features to address basic result vocabulary requirements
]
Third annex includes a number of handy summaries derived from the Recommendations
[[1] - alphabetical lists of elements and functions
[1] - print-oriented summaries of all productions
]
Last annex addresses questions regarding tools
[[1] - lists of questions for processor implementers when assessing tool capabilities
]
External ZIP file included with the purchase of the book
[[1] - all of the complete scripts utilized in the documentation as stand-alone files ready for analysis and/or modification
[1] - sample invocation scripts for Windows environments
]
Epilogue
Where to go from here?
The work on XSL, XQuery, XSLT and XPath continues:
[[1] - all are full W3C Recommendations undergoing designs for new features
[1] - long list of future feature considerations already being examined for new releases of the technology
[1] - new products are continually being announced
[1] - feedback is necessary from users like you!
[[2] - use the XSL mail lists to contribute:
[[3] - [http://www.mulberrytech.com/xsl/xsl-list/]
[3] - [http://groups.yahoo.com/group/XSL-FO]
[3] - [http://lists.w3.org/Archives/Public/www-xsl-fo/]
][2] - contact the W3C with comments about the XSLT/XPath/XQuery specifications:
[[3] - [http://www.w3.org/XML/2005/04/qt-bugzilla]
[3] - [mailto:public-qt-comments@w3.org]
]]]
Colophon
These materials were produced using structured information technologies as follows:
[[1] - authored source materials
[[2] - content in numerous XML files maintained as external general entities for a complete prose book that can be made into a subset for training
[[3] - specification of applicability of constructs for each configuration
[[4] - 45- and 90-minute lecture, half-, full-, two- and three-day lecture and hands-on instruction, and book (prose) configurations
][3] - an XSLT transformation creates the subset of effective constructs from applying applicability to the complete file
[3] - content from other presentations/tutorials included semantically (not syntactically) during construct assembly
][2] - customized appearance engaged with marked sections and both parameter and general entities
[[3] - different host company logos and venue and date marginalia
[3] - changing a single external parameter entity to a key file includes suite of files for given appearance
]][1] - accessible rendition in HTML
[[2] - an XSLT stylesheet produces a collection of HTML files using Saxon for multiple file output
[2] - mono-spaced fonts and list-depth notation conventions assist the comprehension of the material when using screen-reader software
][1] - printed handout deliverables
[[2] - an XSLT stylesheet produces an instance of XSL formatting objects (XSL-FO) for rendering
[2] - XPDF [http://www.foolabs.com/xpdf] extracts raw text from PDF files for the back-of-the-book index methodology published as a free resource by Crane Softwrights Ltd.
[2] - XEP by RenderX [http://www.renderx.com] produces PostScript from XSL-FO
[2] - GhostScript [http://www.GhostScript.com] produces PDF from PostScript
[2] - the iText [http://itext.sf.net] PDF manipulation library for Java is used for page imposition by a custom Python [http://www.python.org] program running under the Jython [http://www.jython.org] environment
]]
Obtaining a copy of the comprehensive tutorial
This comprehensive tutorial on XSLT and XPath is available for subscription purchase and free preview download:
[[1] - "Practical Transformation Using XSLT and XPath (XSL Transformations and the XML Path Language)" Fourteenth Edition - 2011-02-11 - ISBN 978-1-894049-24-5
[[2] - the free download preview excerpt of the publication indicates the number of pages for each topic
][1] - the cost of purchase includes all future updates to the materials with email notification
[[2] - the materials are updated after new releases of the W3C specifications
[2] - the materials are updated after incorporating comments gleaned during presentations and from feedback from customers
][1] - available in PDF
[[2] - formatted as 1-up or 2-up book pages per imaged page
[2] - dimensions in either US-letter or A4 page sizes
[2] - available as either single sided or double sided
][1] - accessible rendition available for use with screen readers
[1] - free preview download includes full text of first two chapters and two useful annexes
[1] - site-wide and world-wide staff licenses (one-time fee) are available
]
See [http://www.CraneSoftwrights.com/links/trn-20110211.htm] for more details.
Feedback
[[1] - the unorthodox style has been well-accepted by customers as an efficient learning presentation
[1] - feedback from customers is important to improve or repair the content for future editions
[1] - please send suggestions or comments (positive or negative) to [info@CraneSoftwrights.com [mailto:info@CraneSoftwrights.com]]
]
US Government employee purchase
[[1] - US Government employees (not contractors) are entitled to obtain their personal prepaid copies at no charge from a government intranet location
[1] - visit the Crane web site for details
]
*** This is a free preview excerpt of a commercial publication. ***
This is an accessible version of Crane's commercial training material.
The content has been specifically designed to assist screen reader software
in viewing the entire textual content. Figures are replaced with text
narratives.
Navigation hints are in square brackets:
[Tx.x] and [Fx.x] are textual representations of the applicability icons;
[digit] indicates list depth for nested lists;
[link [URL]] indicates the URL of a hyperlink if different than link;
[EXAMPLE] indicates an example listing of code;
[FIGURE] indicates the presence of a figure replaced by its description;
[>] jumps forward;
[<] jumps backward;
[^] jumps to start of the section;
[^^] jumps to the start of the chapter;
[^^^] jumps to the table of contents.
Suggestions for improvement are welcome:
[info@CraneSoftwrights.com]
Book sales: [http://www.CraneSoftwrights.com/links/trn-acc.htm]
Information: [http://www.CraneSoftwrights.com/links/info-acc.htm]
This content is protected by copyright and, as there are no means to protect
this accessible version from plagiarism, please do not make any
commercial edition available to others.
+//ISBN 978-1-894049::CSL::Courses::PTUX//DOCUMENT Practical Transformation Using XSLT and XPath 2011-02-11 21:00UTC//EN
Practical Transformation Using XSLT and XPath
Fourteenth Edition - 2011-02-11
ISBN 978-1-894049-24-5
Copyright © Crane Softwrights Ltd.