[Bug 4595] 1.0.3dev: document(*) with undefined context item

http://www.w3.org/Bugs/Public/show_bug.cgi?id=4595





------- Comment #15 from tim@cbcl.co.uk  2007-09-12 13:14 -------
OK.  I've modified our implementation.  Even if we can tell statically that a
query will necessarily require the context item, if its type is known to be
none we now just let it pass until the query is executed.

We now fail the following tests, so present alternative correct results.


(:*******************************************************:)
(: Test: K2-DirectConElemNamespace-13                    :)
(: Written by: Frans Englich                             :)
(: Date: 2007-07-17T17:04:38+01:00                       :)
(: Purpose: A name test whose namespace is declared with a prefixed namespace
at
tribute. :)
(:*******************************************************:)
declare default function namespace "http://example.com";
<e xmlns:p="http://www.w3.org/2001/XMLSchema" a:p="{p:nametest}"/>

In addition to XPDY0002, there is use of an undefined namespace prefix "a"
(XPST0081).  This also applies to K2-DirectConElemNamespace-14.

(:*******************************************************:)
(: Test: K2-LetExprWithout-17                            :)
(: Written by: Frans Englich                             :)
(: Date: 2007-07-17T17:04:39+01:00                       :)
(: Purpose: Ensure a name test is reported for using the undefined focus, when
a
ppearing as a child of a let binding. :)
(:*******************************************************:)
declare function local:function()
{
    let $b := (i/a)
    return ()
};
local:function()

Here an optimizer is free to eliminate $b completely.  Therefore the empty
sequence is a valid result.


(:*******************************************************:)
(: Test: K2-FunctionProlog-16                            :)
(: Written by: Frans Englich                             :)
(: Date: 2007-07-17T17:04:39+01:00                       :)
(: Purpose: A tricky parser case.                        :)
(:*******************************************************:)
declare function local:myFunction() as item()*
{***};
1

Here the function is never called.  1 is therefore a valid answer.

Received on Wednesday, 12 September 2007 13:14:40 UTC