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

Re: importance

Subject: Re: importance
From: James Clark <jjc@xxxxxxxxxx>
Date: Wed, 02 Jun 1999 13:31:13 +0700
importance of following orders
Jakob Fix wrote:
> 
> given a stylesheet "a" which imports two stylesheets "b" and "c" which in
> turn import one stylesheet each, "d" and "e" what is their relationship
> importance-wise?
> 
>    a
>   / \
>   b  c
>   |  |
>   d  e
> 
> following the spec, "a" as the importing stylesheet is the most important
> one. (section 15.1 Stylesheet Import).
> 
> now, is the order of importing the stylesheets
>     "b" then "c" then "d" then "e", or
>     "b" then "d" then "c" then "e"?
> This seems not to be explicitly stated in the spec, but is obviously
> necessary to decide on the imortance of each.
> 
> When the spec says
> 
> "Definitions and template rules in the importing stylesheet are defined to
> be more important than definitions and templates in any imported
> stylesheets."
> 
> does "importing stylesheet" mean the root stylesheet, "a" only, or any
> stylesheet that imports another stylesheet?

It means that if stylesheet X imports stylesheet Y then X is more
important Y. So if we use X > Y to mean that X is more important than Y,
we have

a > b
a > c
b > d
c > e

The spec also says:

  Also definitions and template rules in one
  imported stylesheet are defined to be more important than
  definitions and template rules in previous imported
  stylesheets.

This is intended to mean in your case that:

c > b
c > d
e > b
e > d

(Clearly there's scope for improving the wording here.) Implicit in the
spec is the idea that importance is transitive: if X > Y and Y > Z then
X > Z.

So putting this together the order of importance of the stylesheets in
your example would be (most important first):

a c e b d

Remember that all xsl:import statements must come at the beginning of
the stylesheet before any template rules.  So if you parse an xsl:import
when you see it, then the template rules will be encoutered coming from
stylesheets in the following order:

d b e c a

ie precisely in reverse order of importance.

James



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread
  • importance
    • Jakob Fix - Tue, 1 Jun 1999 19:37:00 +0200
      • James Clark - Wed, 02 Jun 1999 13:31:13 +0700 <=

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.