Incorrect type inference in call on distinct-values()
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 18.104.22.168 on .NET but reproduced on Java.
#2 Updated by Michael Kay about 4 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.
#3 Updated by Michael Kay about 4 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.
Please register to edit this issue