Subject: Re: [xsl] Preference rules for /something and /* From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Mon, 18 Jun 2007 16:45:04 -0400 |
I'm not sure if I get this right, so I'm asking here. If I have the following two rules:
<xsl:template match="/root" /> <xsl:template match="/*" />
I receive an "ambiguous rule match" error if the input matches the first. I figured, '*' is not very selective, so it should've conceived lowest priority (I know that a single '*' has prio -.5). What I'd guess is that I am having a compound rule here, similar to 'node/child' or 'node/*' which both receive prio +.5, with the parent node being the document node. Am I correct?
1. Simple tests by name, on the child or attribute axis in a single step e.g. "root" or "@root" -- priority 0 2. "Wildcard" matches on the child or attribute axis in a single step e.g. "@*" or "comment()" -- priority -0.5 3. Anything else e.g. "//root", "/root", "/*/root" or "/*" -- priority 0.5
Or should a processor distinguish and select the first as having a higher prio (which intuitively seems more correct)?
Of course I can use priority='x', but I'm curious about the default prio here.
Cheers, Wendell
PS: the same happens when I over-specify the first rule, i.e.: /root[foo[bar='y']]
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Preference rules for /som, David Carlisle | Thread | Re: [xsl] Preference rules for /som, Abel Braaksma |
Re: [xsl] Preference rules for /som, David Carlisle | Date | [xsl] Dynamic pipelining in XSLT 2., Wendell Piez |
Month |