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

import/include and file structure

Subject: import/include and file structure
From: Bruce D'Arcus <bdarcus@xxxxxxxxxxxxx>
Date: Sat, 4 Sep 2004 14:40:35 -0400
xsl include file
I'm trying to get what I've been working on into shape to distribute more widely, and am wondering if my approach to modularizing the (xslt 2.0) code makes sense.

I have a main file that looks like:

<!-- read the external citation style file -->
<xsl:param name="citation-style" required="yes" as="xs:string" />

<xsl:variable name="styles" as="document-node()"
  select="doc(concat('../styles/',$citation-style, '.csl'))" />

<!-- set the citation class parameter (e.g. author-year) as specified in the style file -->
<xsl:param name="citation-class" select="$styles/cs:citationstyle/@class"/>


<xsl:include href="core.xsl" />
<xsl:include href="drivers.xsl" />
<xsl:include href="render-classes.xsl" />

Each of these included files in turn includes other files. So, for example, core.xsl looks like:

<xsl:include href="core/css.xsl" />
<xsl:include href="core/functions.xsl" /> <!-- all function code -->
<xsl:include href="core/render-mods.xsl" /> <!-- all general rendering code -->
<xsl:include href="core/style.xsl" />


The "render-classes.xsl" file looks like this:

<xsl:include href="render-classes/author-year/render.xsl"/> <!-- all rendering code specific to author-year class -->
<xsl:include href="render-classes/note/render.xsl"/> <!-- all rendering code specific to footnote/endnote class -->


I am using conditional statements on the class-specific templates to keep stuff separate in processing.

Is it fine or me to be using include in this way, or is there a compelling reason for me to be importing instead? I recall Wendell's discussion about import precedence and such, but am not sure practically whether this matters in this case.

Bruce

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.