w3c / qtspecs

XSLT and XQuery Specifications - the source used to build the specs, and the errata
Other
30 stars 25 forks source link

[XDM31] Namespace names containing whitespace #39

Open michaelhkay opened 2 years ago

michaelhkay commented 2 years ago

XSLT3 test case on-empty-115b constructs a namespace node in which the namespace name comprises a single space character. The spec offers no clear guidance on whether this is allowed or not. Section 2.6 of XDM sits on the fence:

Namespace names, whatever form they take, are treated as character strings and compared for equality using codepoint-by-codepoint comparison, subject only to whitespace normalization if they appear in a context (for example, within an attribute value) where this is appropriate.

It is highly unlikely that namespace names containing spaces will work; there are certainly many places where they won't work.

A namespace name consisting entirely of spaces is particularly problematic, because it is not always clear whether it should be treated as a declaration or an undeclaration.

We currently say:

In this and related specifications, the use of the type xs:anyURI to hold a namespace name does not imply any restrictions on the value space beyond those described in this section: implementations may reject character strings that are not valid URIs or IRIs, but they are not required to do so.

and I would like to see this extended to say:

XSD 1.1 Part 2 states that the use of spaces in xs:anyURIs is strongly discouraged. This applies particularly to URIs used as namespace names. It is therefore RECOMMENDED that character strings containing spaces should not be accepted as namespace names.