Mix XSLT 1.0 and XSLT 2.0 in the Same Stylesheet
A very useful technique for XSLT 2.0 migration is to process
parts of the stylesheet in XSLT 1.0 or XSLT 2.0 mode. The simplest way
to do this is to create an stylesheet with version="2.0", adding version="1.0" to templates as needed.
(Remember, the version attribute can be used on any
XSLT element except <xsl:output>.) This lets you migrate
your stylesheet in stages without worrying about dynamic errors. If
your stylesheet depends on math being processed using XSLT 1.0 rules,
you can set that section of the stylesheet to use version="1.0". As your XSLT 2.0 experience
grows, you can address the XSLT 1.0 sections of the stylesheet and
migrate them to XSLT 2.0.
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