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

RE: Priority and import precedence

Subject: RE: Priority and import precedence
From: "Andrew Welch" <ajwelch@xxxxxxxxxxxxxxx>
Date: Tue, 1 Feb 2005 10:21:45 -0000
stylesheet priority
> > Would it be possible to add a warning message to Saxon,
> like ambiguous
> > rule match, when one template is chosen over another purely
> by import
> > precedence
> wouldn't that make import virtually unusable?
> Usually when I use import _every_ template in the importing
> stylesheet is overriding a template in the imported one
> (often because the latter has a template matching *).  I
> thought your earlier suggestion was that certain special
> templates could have an attribute to flag they should be top
> of the import tree and generate a warning if not.

Yes it was :) But if we can't have that then at least we should know
when it has happened (just like ambiguous rule match) rather than
silently getting the wrong output.  (Wrong as in 'not intended').

When I talk about 'one template being chosen over another just because
of import precedence' I am talking about the order of the imports - the
following import winning over the preceding import - *not* stylesheet A
importing stylesheet B.

So, in your example above, you would only get the warning message if you
imported two stylesheets that each had a template with the same match
pattern, that weren't overridden in your importing stylesheet, and one
of those templates was chosen over the other because it was in a
stylesheet that was imported later than the other one.

It may not be feasible, but I had a bug recently because of this and
thought it was a bit poor that the fix involved either re-ordering the
imports or moving the template into the importing stylesheet.  At least
if we have a warning, we could re-order the imports with confidence and
keep templates in the stylesheets they logically belong in.


Current Thread


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.
First Name
Last Name
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.