This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
template precedence problem
- From: Ben Leighton <Ben dot Leighton at wizardis dot com dot au>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Fri, 17 May 2002 11:34:08 +1000
- Subject: [xsl] template precedence problem
- Organization: Wizard Information Services
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi All,
Im have two template matches:
<xsl:template match="Cost"/>
and
<xsl:template match="*[
not(document('')//set:Sets/set:Set[@name='elementRules']/set:Item[@name=name()])
]">
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.
thanks,
:) Ben
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list