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

is it possible to simulate <xsl:import> precedence wit

Subject: is it possible to simulate <xsl:import> precedence within a single stylesheet file?
From: "Chris Papademetrious christopher.papademetrious@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 25 Apr 2023 12:47:40 -0000
 is it possible to simulate <xsl:import> precedence wit
Hello XSLT friends,

Martin's XSLT fiddle site<https://xsltfiddle.liberty-development.net/> has
become one of my favorite XSLT learning and development tools. The ability to
see stylesheet results in real-time is enormously helpful in developing a
mental model both of the problem being solved and of XSLT itself.

Today I need to develop some functionality for a DITA-OT processing
stylesheet. The top-level stylesheet is a bunch of <xsl:import> imports of
lower-level files:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0">
  <xsl:import href="plugin:org.dita.base:xsl/preprocess/topicpullImpl.xsl"/>
  <xsl:import href="plugin:org.dita.base:xsl/preprocess/topicpull-task.xsl"/>
  <xsl:import href="plugin:org.dita.base:xsl/preprocess/topicpull-pr-d.xsl"/>
  <xsl:import
href="plugin:com.oxygenxml.pdf.css:xsl/preprocess/topicpull.xsl"/>
  <xsl:import href="plugin:com.synopsys.processing:topicpull.xsl"/>
  <xsl:import href="plugin:com.synopsys.mini-toc:topicpull-minitoc.xsl"/>
  <xsl:import href="plugin:com.synopsys.preserve.keyrefs:topicpull.xsl"/>
</xsl:stylesheet>

It would be super cool to create an XSLT stylesheet that flattens a top-level
DITA-OT stylesheet into something that can XSLT-fiddled with.

However, I am not sure how the import precedence rules described in 3.11.3
Stylesheet Import<https://www.w3.org/TR/xslt-30/#import> could be replicated
when flattening the stylesheet. The only solution I can think of is to convert
all implicit match priority values to explicit priority values (match
parsing!!), then completely linearize the whole mess to implement precedence
using ranges of priority values. And even if I wanted to do this (I don't!), I
am no longer fiddling with the original code because now everything uses
arbitrary priority values.

Is there some way to simulate import precedence (not priority) within a single
stylesheet file?

Thanks as always!

-----
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.