xsl-list
[Top] [All Lists]

Re: [xsl] Act as xsl:next-match in XSLT 1 with xsl:apply-imports (not possible?)

2007-03-23 09:50:08

The reason is obvious: the XSLT 1.0 spec mandates that when two imports 
are of equal import precedence (i.e., in the same file) then template 
matches that appear lowest in the importing file take precedence and the 
rest is discarded. Because of "being discarded", I believe the 
<xsl:apply-imports /> does not work recursively.

I don't think that the spec describes these templates as being discarded,
and in fact two imports are never in equal precedence.
However (unfortunately) apply-imports is not defined to mean "next match
in import precedence order" it is only defined to consider stylesheets
that are imported into _this_ stylesheet module, so in a situation where
one stylesheet imports all the rest, any apply-imports in the imported
files will be a no-op as they don't themeselves have any imports.

As you said You need a thin deep tree, not a short fat one if you want
to use xsl:apply-imports.


The semantics of xslt 2's next match are a lot easier to understand,
more or less: "choose the template you would have chosen if this one had
not been here".

David

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--