Bug #2685
closedIncorrect type inference in call on distinct-values()
100%
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.
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.
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.
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.
Please register to edit this issue