Bug #4616


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

In Progress
Start date:
Due date:
% Done:


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


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="" />
      <xsl:copy-of select="max($data)"
        default-collation="" />

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.


#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="">
      <xsl:perform-sort select="$data">
        <xsl:sort select="."/>

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="">....</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