Project

Profile

Help

Bug #4616

default-collation

Added by Michael Kay 17 days ago. Updated 16 days ago.

Status:
In Progress
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
2020-06-26
Due date:
% Done:

0%

Estimated time:
Applies to JS Branch:
2.0
Fix Committed on JS Branch:
Fixed in JS Release:
SEF Generated with:
Company:
-
Contact person:
-
Additional contact persons:
-

Description

If an [xsl:]default-collation attribute appears in the stylesheet, the XX compiler appears to ignore it.

Given the input

      <xsl:copy-of select="saxon:highest($data, my:val#1)"
        default-collation="http://www.w3.org/2005/xpath-functions/collation/html-ascii-case-insensitive" />
      <xsl:copy-of select="max($data)"
        default-collation="http://www.w3.org/2005/xpath-functions/collation/html-ascii-case-insensitive" />

The XJ compiler generates a defaultCollation attribute on the sequence node representing the sequence constructor (I think it detects that the static context for both instructions is the same). It also generates a collation attribute on the fn:max function call - this is done by SystemFunction.export calling out.emitRetainedStaticContext().

The output of the XX compiler does not include the default collation anywhere, which means that neither the built-in function max() nor the extension function saxon:highest() can take it into account.

History

#1 Updated by Michael Kay 17 days ago

In principle this should be tested by XSLT3 test collations-0118.

However, that test, with most of the others in the collations test-set, is on the exceptions list because it depends on DTD parsing - the collation in use is represented using an entity reference.

I have modified most of the XSLT3 tests in the collations test-set so they no longer depend on use of entity references, which means it is now possible to run them in Saxon-JS. Most of them are failing.

#2 Updated by Michael Kay 16 days ago

A test with xsl:perform-sort

   <out xsl:default-collation="http://www.w3.org/2005/xpath-functions/collation/html-ascii-case-insensitive">
      <xsl:perform-sort select="$data">
        <xsl:sort select="."/>
      </xsl:perform-sort>
    </out>

shows that for this case, the default collation is being respected, but it is also output as a (non-namespaced) attribute in the result:

<out defaultCollation="http://www.w3.org/2005/xpath-functions/collation/html-ascii-case-insensitive">....</out>

If I move the default-collation attribute to the containing xsl:template element it works correctly.

The conversion of @xsl:default-collation to a no-namespace @defaultCollation attribute is done by the compiler in normalize.xsl line 288; it's not clear what the rationale is here.

#3 Updated by Michael Kay 16 days ago

  • Status changed from New to In Progress
  • Assignee changed from Michael Kay to John Lumley
  • Priority changed from Low to Normal
  • Applies to JS Branch 2.0 added

Please register to edit this issue

Also available in: Atom PDF Tracking page