[xsl] Why does the addition of one (1) to a positiveInteger produce an integer?

Subject: [xsl] Why does the addition of one (1) to a positiveInteger produce an integer?
From: "Costello, Roger L." <costello@xxxxxxxxx>
Date: Sun, 29 Aug 2010 15:43:29 -0400
Hi Folks,

I have a function that has a parameter with a xs:positiveInteger datatype.
Within the function I add one (1) to the parameter:

<xsl:function name="f:iter">
    <xsl:param name="count" as="xs:positiveInteger" />

    ...

    <xsl:sequence select="f:iter($count + 1)" />

</xsl:function>

When I run this I get an error, "The argument to f:iter is xs:positiveInteger,
the supplied value is xs:integer"

What is the rationale for this? After all, if I add one (1) to any
positiveInteger the result must be a positiveInteger.

/Roger

Current Thread