Project

Profile

Help

Bug #2685

closed

Incorrect type inference in call on distinct-values()

Added by Michael Kay over 8 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XPath conformance
Sprint/Milestone:
Start date:
2016-03-23
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
9.7
Fix Committed on Branch:
9.7
Fixed in Maintenance Release:
Platforms:

Description

In a schematron-generated stylesheet we are making an incorrect type inference, resulting in the message:

Warning: in xsl:variable/@select on line 1472 column 160 of transfer.xsl:
  SXWN9000: Required item type of value of variable $theAttCheck is attribute(); supplied
  value has item type xs:untypedAtomic. The expression can succeed only if the supplied
  value is an empty sequence.

and a subsequent run-time failure. The attribute declaration is:

<xsl:variable name="theAttCheck"
                    select="distinct-values(document('-- uri --')/*/valueSet/conceptList/concept[@code = $theAttValue]/@code)"/>

which does not have a declared type.

Reported on 9.7.0.4 on .NET but reproduced on Java.

Actions #2

Updated by Michael Kay over 8 years ago

It seems that the metadata for function distinct-values in StandardFunction.java gives it the property "same as ARG0" which means that the result type is inferred to be the same as the item type of the first argument. this is incorrect, because the first argument is atomized.

Actions #3

Updated by Michael Kay over 8 years ago

  • Subject changed from Incorrect type inference in schematron-generated stylesheet to Incorrect type inference in call on distinct-values()
  • Category changed from XSLT conformance to XPath conformance
  • Status changed from In Progress to Resolved
  • Priority changed from Low to Normal
  • Fix Committed on Branch 9.7 added

A fix has been committed to remove the two properties "AS_ARG0" and "FILTER" from the two variants of the distinct-values() function.

Actions #4

Updated by O'Neil Delpratt over 8 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in Maintenance Release 9.7.0.5 added

Bug fix applied in the Saxon 9.7.0.5 maintenance release.

Actions #5

Updated by O'Neil Delpratt over 8 years ago

  • Sprint/Milestone set to 9.7.0.5

Please register to edit this issue

Also available in: Atom PDF