[Home] [By Thread] [By Date] [Recent Entries]
bryan rasmussen wrote:
I was just thinking but the thing that would be useful in XSLT for me would be constructs for checking if something was already matched by an import or include. If you mean it such that a certain template should only be called *if* it is not previously matched by another template in some imported or included stylesheet, however deep, you can use priorities. Use a low prio in your principal stylesheet and it will only be matched *if* it does not have a match in any of the imported stylesheets. Like this: <xsl:template match="b" priority="-1">
<b-matched-in-principal />
</xsl:template>If an imported stylesheet has a similar match, it will not match the above. The other way: <xsl:template match="b" priority="1">
<b-matched-in-principal />
</xsl:template>will match if there is *not* the same match in any of the imported/included stylesheets. Of course, it depends on the other set priorities.
What do you mean with "level matched". Do you mean the order of precedence? You can calculate that (but that number is of little use in run time, I think). If I remember my lessons correctly, the precedence is calculated by means of priority, based on how specific your match is. Like "*" has less prio then "nodenamehere", which has less prio then "/nodenamehere" which has less prio then "/nodenamehere[predicatehere]". But perhaps I misunderstood your question/request? Can you give a coded example of how you see these added features? Cheers, -- Abel Braaksma http://www.nuntia.nl
|

Cart



