This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 2626 - base-URI-10
Summary: base-URI-10
Status: CLOSED FIXED
Alias: None
Product: XML Query Test Suite
Classification: Unclassified
Component: XML Query Test Suite (show other bugs)
Version: 0.8.2
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Carmelo Montanez
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-31 17:19 UTC by David Carlisle
Modified: 2006-05-12 15:02 UTC (History)
0 users

See Also:


Attachments

Description David Carlisle 2005-12-31 17:19:30 UTC
has expected reult 0 (implying that static-base-uri() returns () )
However the static base-uri has to be an absolute URI according to 2.1.1 in
particular it has to be non null and so the result of this test should be 1.
(Actually this is slightly surprising, I would have expected that the base URI
was allowed to be "" to accomodate in-memory queries and other cases where there
is no obvious base URI, but that isn't what the XQuery CR says, and even in that
case, the base URI would be normally set and so this test should return 1.
Comment 1 Andrew Eisenberg 2006-01-05 18:16:08 UTC
The Base URI property in the static context can undefined. Appendix C.1, Static
Context Components, in XQuery 1.0 says that its default initial value is none.

The beginning of section 2.1.1, Static Context, recognizes that components can
be undefined when it says,

"If analysis of an expression relies on some component of the static context
that has not been assigned a value, a static error is raised [err:XPST0001]."

If you agree with this resoution, then please make this bug report as closed.
Comment 2 David Carlisle 2006-01-05 22:13:28 UTC
(In reply to comment #1)
> The Base URI property in the static context can undefined. Appendix C.1, Static
> Context Components, in XQuery 1.0 says that its default initial value is none.
> 
> The beginning of section 2.1.1, Static Context, recognizes that components can
> be undefined when it says,
> 
> "If analysis of an expression relies on some component of the static context
> that has not been assigned a value, a static error is raised [err:XPST0001]."
> 
> If you agree with this resoution, then please make this bug report as closed.
> 

Your observation confirms my initial report. If the base uri is unset then an
error will be raised. so there will be no returned value. This would be the case
in situations where the query is an in-memory string or some other construct
with no uri. When reading the query from the filesystem (as in my test case
harness) surely any implementation
will set this to the URI of the query? in which case the value of count() will be 1.

In neither case can the returned value be 0 which is the result given in the
expected result file.

David
Comment 3 Carmelo Montanez 2006-01-13 18:43:02 UTC
I am not sure all implementations will will set teh base uri to the URI of the 
query.  Clearly the base-uri property is undefined (at least it seems so to 
me).  That being the case the description of the function specifies a  that 
the empty sequence be returned.

Should a error needs to be raise then there seems to be an inconsitency 
between this function's description and the query specs.  

Thanks,
Carmelo
Comment 4 David Carlisle 2006-01-13 22:53:52 UTC
I was wrong about 0 not being possible. (Sorry, it happens:-)
You are correct to say that the function is defined to return () rather than
error if base-uri is not set.

However it is clearly allowed that the static-base-uri is set if there is a URI
that may be assigned to the query. Saxon and xq2xsl both set it to the URI of
the file if the query has been read from a file. There was a thread on the
public query talk list this month about other possible strategies other
implementations use for setting this property. So clearly 1 has to be an
expected result result in addition to 0 (or the test could be changed to be
something like 
fn:count(fn:static-base-uri())=(0,1)
with an expected result of true.
Comment 5 Carmelo Montanez 2006-01-23 18:23:28 UTC
Added extra expected result and resubmitted.  Was easier to add extra
results than changing test.  Please close the bug when able to verify.

Thanks,
Carmelo