RE: Priority and import precedence
> > 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. cheers andrew
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format