[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
[Recent Entries]
[Reply To This Message]
Re: Problem of template priority
Subject: Re: Problem of template priority
From: "Imsieke, Gerrit, le-tex" <gerrit.imsieke@xxxxxxxxx>
Date: Thu, 29 Apr 2010 03:26:23 +0200
|
On 29.04.2010 02:41, Fabre Lambeau wrote:
Hi!
I have a complex XSLT stylesheet, which does import some other ones in order to refine/delegate some of the work depending on the type of data it finds.
This works by using templates with modes, and matching rules that are more specific, hence increasing their default priority. However, in the main sheet (the one that imports the others), there is a case where I want to force the most generic template to be applied, after which it can call the others.
However, no matter what I do with the priority attribute, my processor seems to always select the template from the imported stylesheet.
I'm afraid we cannot tell you why without seeing the actual code or a
minimal example that reproduces this behaviour.
There are many possible reasons why the template rule in the importing
stylesheet didn't match -- a predicate that causes the pattern not to
match, typos in mode names, missing namespace prefixes, ...
Having said that, I tried to create a simple example (below), and there I get just the opposite effect: I can never get the imported template to apply instead of the generic one, even though it is more selective
Before considering explicit or computed priorities, the processor has to
consider import precedence [1, 2].
This means that the imported template will always lose, no matter what
the priorities specify.
Gerrit
[1] http://www.w3.org/TR/xslt20/#conflict
[2] http://www.w3.org/TR/xslt20/#dt-import-precedence

|
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
RSS 2.0 |
|
Atom 0.3 |
|
|