[xsl] template precedence problem

Subject: [xsl] template precedence problem
From: Ben Leighton <Ben.Leighton@xxxxxxxxxxxxxxx>
Date: Fri, 17 May 2002 11:34:08 +1000
Hi All,

    Im have two template matches:

<xsl:template match="Cost"/>


<xsl:template match="*[

I'd really like to apply specific template matches like "Cost" in
preference to my more generic "*[...]". However *[..] seems to take
precedence over "Cost". If I change *[...] to * precendence occurs the
way I'd like "Cost" is matched in preference to "*".

The XLST programmers spec indicates that this is correct behaviour. Why
does the xpath spec(?) allow more generic template matches to take
higher priority?. Will this occur in XPATH 2.0? Can someone provide me
with an xpath for my match *[..] that takes lower priority? I have
sucessfully corrected this by setting the priority attribute on *[...]
to a lower value. However I dislike doing this because it means every
time I add a new template to my stylesheet I need to think about its
priority in contrast the the prirorities I've forcibly adjusted.

:) Ben

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread