[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Required cardinality checks

Subject: Re: Required cardinality checks
From: Pavel Minaev <int19h@xxxxxxxxx>
Date: Wed, 30 Sep 2009 15:05:06 -0700
Re:  Required cardinality checks
On Wed, Sep 30, 2009 at 2:47 PM, Michael Kay <mike@xxxxxxxxxxxx> 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?

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.