[
Lists Home |
Date Index |
Thread Index
]
> >And in a namespace-aware XML parser, Name is not used for elements or
> >attributes,
> >QName is (from XML Namespaces). Isn't it a mess?
>
> No, it's not a mess.
>
> The XML 1.0 specification said that colon in names was reserved for a
> future namespace mechanism. XML Namespaces defined that mechanism.
> That was how it was supposed to work, and that was how it did work.
Here is exactly what it is saying:
: Note:
:
: The Namespaces in XML Recommendation [XML Names] assigns a
: meaning to names containing colon characters. Therefore, authors
: should not use the colon in XML names except for namespace
: purposes, but XML processors must accept the colon as a name
: character.
For me, as an implementor of XML Parser, that I should accept
documents with ':' in names. And a document that does not
declare a namespace is a well-formed XML document with leading
colon in attributes of elements and names. Whether an author
did what it 'should' is a different matter, but he/she produced
a well-formed xml document, and he/she did not ask for
namespaces.
Now comes the second part, namely, that for a namespace-aware
parser elements and attributes follow different productions,
that is, if the default mode for a parser is namespace-aware,
then, even if the document is not (and never mentiones anything
related to namespaces), it will be rejected by the parser. Just
because the productions are suddenly different, and there is a
first-and-a-half store -- namespace-aware, a little better than
well-formed.
>
> XML isn't a way for you to use some random syntax you've made up
> and call it standard. If you want to be compatible with XML-based
> software, you have to follow the specifications.
Yes, I am trying to follow the specification strictly. An XML
1.0 second edition parser should accept documents with colons in
elements' and attributes' names, even in the leading position,
even if they are used for non-namespace purposes.
Unless there is something explicitely said about the document
that makes the parser think that wants to follow XML Namespaces,
leading colons are legal.
Would you use a validating parser that rejects to process a document if it
does not have a DOCTYPE declaration? What is the difference
between this and XML vs XML+namespaces?
David Tolpin
|