qtspecs
qtspecs copied to clipboard
xsl:sequence: @as
I'd like to see@as on xsl:sequence. That way i can write, e.g.
<xsl:function name="dc:slice-count" as="xs:integer">
<xsl:param name="toast" as="element(toast)" />
<xsl:for-each select="$toast" as="xs:integer">
<xsl:sequence select="@cooked-slices + @raw-slices" as="xs:integer" />
</xsl:for-each>
</xsl:function>
It would be an error for the for-each to have other than exactly one integer as its result, and the same for the @sequence
. In this simple example there's not much scope for that to happen of course,
Maybe on anything with a select
attribute?
Parenthetically, a context-item attribute on xsl:sequence would obviate the XSLT1-ish xsl:for-each there, although $toast/(@a, @b) => sum() would work as well and be XSLT 3-ish.