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

RE: stylesheet expansion

Subject: RE: stylesheet expansion
From: "Scott Trenda" <Scott.Trenda@xxxxxxxx>
Date: Mon, 10 Dec 2007 14:10:53 -0600
RE:  stylesheet expansion
Since the original question involved the reduction of dependency on
paths and required a single stylesheet with the import precedences
converted to priorities, I'd say my reply here is slightly off-topic,
but I'd like to chime in while Abel has brought up the subject.

I use a type of single-file stylesheet collection system, nearly
identical to what Abel defines below, in a personal project of mine. My
intentions are slightly different, simply to reduce common aspects of
the small perfunctory stylesheets to a single instance. Instead of
Xpointer, though, I use a PHP function that performs a transformation on
the collection-file which:
- adds the xsl version attribute (limited to 1.0 via libxslt right now)
- copies any namespace nodes from parent elements
- adds an xsl:import of a common.xsl file of frequently-used templates.


It does save plenty of space and clutter (especially routine
declarations like xmlns:xsl), and ensures I can rely on the common
templates being present in the collection's stylesheets. The
transformation that picks out the requested stylesheet is fairly simple;
it just takes in an "id" parameter and looks for the first child of the
root node that has the same ID. (I'm using a few literal-result element
stylesheets, so it's not limited to xsl:stylesheet children.) If
anyone's interested, I could post the stylesheet and the particular
collection I'm using, but we should split off the topic at that point.
~_^

~ Scott


-----Original Message-----
From: Abel Braaksma [mailto:abel.online@xxxxxxxxx]
Sent: Monday, December 10, 2007 12:59 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  stylesheet expansion

Andrew Welch wrote:
> As Colin has said, compiled stylesheets seem to be the only way, but
> may be not what the OP was after.  Ideally importable compiled
> "stylesheet modules" will be invented soon....   :)

It really shouldn't be too hard to make a structure something like the
following, which is basically a simple collection framework for
stylesheets and can internally be gathered into a set of compiled
stylesheets:

<col:stylesheet-collection xmlns:col="http://stylesheet-collection"
start-with="main">

     <xsl:stylesheet col:name="main".... >
         <xsl:import href="#import-me" />
     </
     <xsl:stylesheet col:name="import-me">
          <xsl:output ... />
          <xsl:template match="...
     </

</col:stylesheet>

Or something like that. What catalogs are to XML and DTD, can stylesheet

collections be for XSLT. Perhaps a new standard ;)

Cheers,
-- Abel Braaksma

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.