This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
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.
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.
(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
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
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.
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