[2.0] The Design of XSLT 2.0
XSLT 2.0 is a major enhancement to the language. XSLT 2.0 uses XPath 2.0, which itself went through many significant changes. The gap between XSLT 1.0/XPath 1.0 and XSLT 2.0/XPath 2.0 was a little over seven years (November 16, 1999 to January 23, 2007). There were two major requirements that led to the monumental amount of work required to create XSLT 2.0 and XPath 2.0:
- Support for XML Schema
XSLT and XPath now support XML Schema, which means nodes and variables can have datatypes. We can define a value to be of type
xs:dateTime, and the XSLT processor will enforce that requirement. All XSLT 2.0 processors support the basic XML Schema datatypes. A schema-aware processor also supports custom datatypes. If we have a datatype namedpurchaseOrder, we can use a schema-aware processor to work with values of that type.- Integration with XQuery
The initial work for XQuery began in 1998, and version 1.0 became a W3C Recommendation on January 23, 2007. XQuery 1.0 and XPath 2.0 share a common data model, functions, and operators. Coordinating the efforts of the XQuery, XPath, and XSLT working groups must have been a challenge.
The birthing pains of XSLT 2.0 and XPath 2.0 are behind us now, and we have a more powerful language for transforming documents. We’ll discuss the changes to the language as they’re relevant to our discussion of common tasks that you’ll probably want to do with XSLT. All of the technical details are covered in the appendixes.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access