[jira] [Created] (XALANJ-2824) Template alternative with | do not use correct priorities

"Nathan (Jira)" <[email protected]>
Newsgroups gmane.text.xml.xalan.devel
Message-ID <[email protected]>
Nathan created XALANJ-2824:
------------------------------

             Summary: Template alternative with | do not use correct priorities
                 Key: XALANJ-2824
                 URL: https://issues.apache.org/jira/browse/XALANJ-2824
             Project: XalanJ2
          Issue Type: Bug
      Security Level: No security risk; visible to anyone (Ordinary problems in Xalan projects.  Anybody can view the issue.)
          Components: SAX, transformation, Xalan
    Affects Versions: 2.7.3
            Reporter: Nathan
         Attachments: reproduction-priorities.zip

When using the | to create a set of alternative template matches the priority of the templates are set based on the lowest priority in the set of template matches apparently.

e.g.: 

<xsl:template match="otherPerson | person[lastName]"> MATCH 1...
<xsl:template match="person"> MATCH 2...
The default priority for MATCH 2 should be lower than the priority for MATCH 1 since it specifies a child element should be present.

But when testing this, it results in MATCH 2.

This is not correct according to the xslt specs [https://www.w3.org/TR/xslt-10/#dt-default-priority]

A set of template matches behaves differently. 

So e.g.:

<xsl:template match="otherPerson"> MATCH 1...

<xsl:template match="person[lastName]"> MATCH 1...
<xsl:template match="person"> MATCH 2...
This will select MATCH 1 when relevant as it should, because it has a higher priority than MATCH 2 now.

See the attached project for the reproduction.

The saxon implementation uses the expected matches, so it either does not have this bug or interprets the spec differently.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.