w3c / xslt30-test

24 stars 14 forks source link

on-empty-115b - namespace URI comprising a single space #60

Closed michaelhkay closed 4 months ago

michaelhkay commented 2 years ago

The test on-empty-115b constructs a namespace node whose string value (the namespace URI) consists of a single space character.

I can't find an explicit rule against it, but the QT specs do assume that a namespace name will be an xs:anyURI (see for example the return type of functions such as namespace-url()), and XSD 1.1 part 2 does say, for xs:anyURI

Note: Spaces are, in principle, allowed in the ·lexical space· of anyURI, however, their use is highly discouraged (unless they are encoded by '%20').

It also says that xs:anyURI has whitespace=collapse, which under normal circumstances would mean that the values "" (zero-length string) and " " (single space) are considered equivalent. But I think it's unlikely that XML parsers will treat xmlns=" " as equivalent to xmlns="".

If a single space as a namespace URI is expected to work, then this puts considerable stress on the whole system. In the absence of a WG to adjudicate how this should be handled, I think it's best for the test to dodge this question.

michaelhkay commented 2 years ago

I've changed the test to accept a wider range of possible results (not, at present, including the possibility of raising an error, which could possibly be justified).