xsl-list
[Top] [All Lists]

Re: [xsl] Required cardinality checks

2009-09-30 18:05:58
On Wed, Sep 30, 2009 at 2:47 PM, Michael Kay <mike(_at_)saxonica(_dot_)com> 
wrote:
These rules have led to a great deal of debate, and there is certainly room
for different interpretations. Note also that there are a number of
published errata in this area. However, the sentence

If a processor evaluates an operand E (wholly or in part), then it is
required to establish that the actual value of the operand E does not
violate any constraints on its cardinality.

was carefully written: the implication is that if the processor does not
evaluate E, then it is NOT required to check the cardinality of E.

This makes sense, but there are some less obvious cases where it is
still not clear how the above would apply. For example:

    <xsl:function name="my:foo">
        <xsl:param name="xs" as="xs:integer"/>
        <xsl:value-of select="$xs[1]"/>
    </xsl:function>

And a call:

    my:foo((1, 2))

or even:

    my:foo(())

Common sense tells me that the second one should definitely trigger an
error (because the user is entitled to expect that $xs[1] should never
produce an empty sequence), but I'm not sure about the first one -
eliding a check there doesn't seem like it would have any undesirable
effect "down the line", so to speak, so why not?

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>