Dimitre Novatchev said:
However, as the xml spec was written before the xml-namespace spec, I guess
that the latter overrides the former, providing a more convinient way to
achieve exactly the same.
The XML spec reserved names beginning with "xml". The Namespaces spec
used some of those reserved names. The rest are still reserved, but I
think it's unlikely that any will be used because (as you say) new
extensions will probably use the namespaces mechanism.
Also, from practical point of view I tried to procesa this xml document
"<xml/>" : there was not a single error message from any of the parsers of
the 10 XSLT processors I'm using (MSXML3/4, .Net xslTransform, XalanJ 2.4.1,
XalanC 1.5, Saxon 6.5.2, Saxon 7, JD, xsltProc, 4xslt).
Many extensions can be provided as layers after parsing, so it
wouldn't be much use if parsers rejected documents because of reserved
names. Namespaces are a case in point: you can implement namespaces
on top of a vanilla XML 1.0 parser, but you wouldn't be able to do
that if the parser had already rejected your xmlns: attributes.
More recent specs tend to be more explicit about what "reserved" means.
For example, the Namespaces 1.1 CR draft says:
All other prefixes beginning with the three-letter sequence x, m, l,
in any case combination, are reserved. This means that:
users should not use them except as defined by later specifications
processors must not treat them as fatal errors.
-- Richard