xslt-processor icon indicating copy to clipboard operation
xslt-processor copied to clipboard

Multiple match

Open marcobalestra opened this issue 4 years ago • 0 comments

In case of multiple node matches, instead of applying to the closest match all of the matches are applied at the same time.

e.g:

	<xsl:template match="*">
		<node name="{name(.)" />
		<xsl:apply-templates select="@*" />
		<xsl:apply-templates select="*" />
	</xsl:template>

	<xsl:template match="creationTime" />

	<xsl:template match="/*/submissionTime">
		<foo>bar</foo>
		<xsl:apply-templates select="*" />
	</xsl:template>

In this case

  • <node name="creationTime" /> is created
  • creationTime descendant nodes are considered
  • <node name="submissionTime" /> is created
  • submissionTime descendant nodes are considered twice

I also tried by assigning priority to template matches, but it didn't solve the issue.

marcobalestra avatar Dec 12 '21 14:12 marcobalestra