- From: <bugzilla@wiggum.w3.org>
- Date: Wed, 15 Mar 2006 11:56:09 +0000
- To: public-qt-comments@w3.org
- CC:
http://www.w3.org/Bugs/Public/show_bug.cgi?id=3002
Summary: [XSLT] xsl:next-match and pattern with |
Product: XPath / XQuery / XSLT
Version: Candidate Recommendation
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: XSLT 2.0
AssignedTo: mike@saxonica.com
ReportedBy: joannet@ca.ibm.com
QAContact: public-qt-comments@w3.org
Consider this example if the input is <doc><x/></doc>:
<xsl:template match="doc">
<out>
<xsl:apply-templates select="x"/>
</out>
</xsl:template>
<xsl:template match="*:x|element(x)">
<foo/>
<xsl:next-match />
</xsl:template>
<xsl:template match="node()">
<bar/>
</xsl:template>
Is the output:
<out><foo/><bar/></out>
or
<out><foo/><foo/><bar/></out>
note that the priority for
element(x) is 0
*:NCNAME is -.25
node() is -.5
It seems odd to me that xsl:next-match can match the template that it's
declared in. Is this the intention of the working group?
In section 6.4 Conflict Resolution for Template Rules:
"If the pattern contains multiple alternatives separated by | , then the
template rule is treated equivalently to a set of template rules, one for each
alternative. However, it is not an error if a node matches more than one of the
alternatives."
In section 6.7 Overriding Template Rules:
"the xsl:next-match instruction considers all other template rules of lower
import precedence and/or priority."
Received on Wednesday, 15 March 2006 11:56:16 UTC