xsl-list
[Top] [All Lists]

[xsl] template precedence

2006-07-19 18:10:48
A trap for young players, like me (document is the top node in the input XML
document).

Original XSL (in part):
======================

<xsl:template match="document">
...<xsl:apply-templates />...
</

<xsl:template match = "*">
<xsl:choose>
...
/>
/>

New XSL (same part):
===================

<xsl:template match="document">
...<xsl:apply-templates />...
</

<xsl:template match="*[(_at_)mark='Y']">
...
</

<xsl:template match="*[not(@mark='Y')]">
...
</

========

I was a bit taken aback to find that "*[]" takes priority over "document".
This might be according to spec, but it's still a bit counter-intuitive,
isn't it!

Cheers
T



--~------------------------------------------------------------------
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>
--~--

<Prev in Thread] Current Thread [Next in Thread>
  • [xsl] template precedence, Trevor Nicholls <=