This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The expected result of this test case is " http://datypic.com/pre http://datypic.com/unpre http://datypic.com/pre". The leading space in this result would be justified if namespace-uri-for-prefix('', $in-xml) returned a zero-length string ($in-xml has no default namespace). Section 11.2.5, fn:namespace-uri-for-prefix, in F&O, says: "If $prefix is the zero-length string or the empty sequence, it returns the namespace URI of the default (unnamed) namespace. Otherwise, it returns the empty sequence." I think that one could interpret this as requiring that an empty-sequence be returned, rather than a zero-length string. This interpretation would remove the leading space from the expected result. Am I missing something? Should this be brought to the WGs?
I agree that the spec could be clarified here. However, I think that if there is no default namespace, namespace-uri-for-prefix("", $e) should return "" as the expected results suggest. This is consistent with the results of other functions that return the pseudo-URI of the non-namespace, for example namespace-uri($e) and namespace-uri-from-QName("", "fred") both return "".
Yes, I think #1 sounds sensible. I think that's verified by other tests currently, as well. Maybe close this report, and open an editorial one on the spec?
Ok, closing the report on the test suite. Feel free to open up on the spec.