[ 
https://issues.apache.org/jira/browse/XALANJ-2824?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18072162#comment-18072162
 ] 

Mukul Gandhi commented on XALANJ-2824:
--------------------------------------

I've tested the XSLT stylesheet examples provided by [~nathan_cl] using both 
Xalan Java XSLT 1.0 (v 2.7.3) and Xalan Java xslt 3.0 (v alpha1), and I get the 
XSL transformation results as specified by XSLT 3.0 spec. The examples provided 
by [~nathan_cl] mention version="2.0" within the stylesheet, therefore I think 
its reasonable to use an XSLT 3.0 processor to try debug this Jira issue.

Using default priority of XSLT 'match' templates, match="person" will be 
preferred (since, this template's pattern is more specific than the other one) 
over match="otherPerson | person[lastName]" during XSL transformation when 
there are two such XSLT templates.

I don't think, that this Jira issue points to any bug with Xalan Java (either v 
2.7.3, or xslt 3.0 alpha1).

 

> 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
>            Priority: Minor
>         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)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to