[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

transforming XSLT files to use XSLT3 features

Subject: transforming XSLT files to use XSLT3 features
From: "Chris Papademetrious christopher.papademetrious@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 11 Feb 2023 11:34:28 -0000
 transforming XSLT files to use XSLT3 features
Hi everyone,

Because XSLT files are themselves XML files, I've been intrigued by the idea
of using XSLT to improve its own stylesheets.

In the following DITA Open Toolkit enhancement:

#4123: Use some XSLT 3.0 features
https://github.com/dita-ot/dita-ot/issues/4123

I provide a stylesheet that performs a few simple substitutions to use XSLT3
features in obvious cases:


  *   Replace contains(@att, " keyword ") with contains-token(@att,
"keyword")
  *   Replace identity templates with <xsl:mode on-no-match="shallow-copy">
  *   Use mode="#current" where possible

The approach is limited by its use of template matches and regular
expressions. For some reason, I don't feel inclined to write an XPath grammar
parser in XSLT. But still, some low-hanging fruit can be obtained.

I thought about replacing concat() with "||", but I think I would need to wrap
all these instances in parentheses to avoid operator precedence issues.

Anyway, I thought I'd pass this along in case anyone found it interesting. If
someone thinks of additional XSLT3 features that could be targeted, let me
know and I'll look into it!

-----
Chris Papademetrious
Tech Writer, Implementation Group
(610) 628-9718 home office
(570) 460-6078 cell

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.