xsl-list
[Top] [All Lists]

[xsl] xsl template priority / xsl template precedence

2006-09-07 10:46:14
Hi,

seem to be stuck on this one. I'm using the following template:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0">
  <xsl:template match="aggregate" priority="5">
      matched aggregate
  </xsl:template>
  <xsl:template match="aggregate/responses/errorresponse" priority="1000">
      matched error response
  </xsl:template>
</xsl:stylesheet>

and the following input:

<?xml version="1.0" encoding="UTF-8"?>
<aggregate>
  <responses>
      <errorresponse>
          some error
      </errorresponse>
  </responses>
</aggregate>

I'd assume that given the priority attributes on the templates, the match="aggregate/responses/errorresponse" would get chosen by the XSLT processor. However, the result is that - no matter what I try - the processor always uses the match="aggregate" template also that thing has lower priority and is also less specific than the other one.

Anyone any ideas why that happens? I tried different processors, all with the same result.

Ralph




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>