June 2008
Intermediate to advanced
986 pages
27h 8m
English
XSLT 1.0 had a very simple type system. The support for XML Schema in XSLT 2.0 means type checking is much stricter. For example, in XSLT 1.0, this statement works:
<xsl;value-of select="substring-before(12345, 3)"/>
This returns the value 12,
which causes a static error in XSLT 2.0. To get this function to work
in XSLT 2.0, we have to write it like this:
<xsl;value-of select="substring-before(string(12345), string(3))"/>
As you migrate your stylesheets from XSLT 1.0 to 2.0, you’ll find yourself explicitly casting values such as this quite often.
Read now
Unlock full access