[standards-jig] XML Conformance
julian at jabber.org
Wed Jan 16 20:57:27 UTC 2002
People have repeatedly brought up on JDEV the issue of Jabber's XML
conformance. I just wanted to make two quick notes about it. ALL
DISCUSSION SHOULD BE CONTINUED *ONLY* ON THE STANDARDS-JIG LIST. This
mail is being cc'd to jdev because quite a few jdev members who have
brought up these issues are unaware of the standards JIG.
First off, the id attribute: the id *MUST* start with an alphabetic
character, but can contain numbers after that.
Reference: XML 1.0 Recommendation:
"Values of type ID must match the Name production. A name must not
appear more than once in an XML document as a value of this type; i.e.,
ID values must uniquely identify the elements which bear them."
The definition of Name:
Name ::= (Letter | '_' | ':') (NameChar)*
definition of NameChar:
NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' |
CombiningChar | Extender
definition of Letter: http://www.w3.org/TR/2000/REC-xml-20001006#NT-Letter
So therefore, ids may start with a letter, an underscore, or a colon,
and then have all the numbers your pretty little heart desires. However,
'2' is not a valid id.
It is also important to remember that there are *two* XML documents
being created, one going to the server, one coming from the server,
which is why you can receive a packet with the same id as one you sent.
Second, namespaces. Contrary to what some people believe, Jabber's usage
of namespaces conforms with the specification. <x> and <query> are
actually a parent element of everything within in the same namespace.
Schemas will conform with this statement. The "problem" is that current
Jabber implementations do not fully support namespaces via Qualified
Names. (Such as <last:query xmlns:last="jabber:iq:last"> and then being
able to use last: thereafter) - However, there is NOTHING WRONG with
Jabber being even more restrictive than the XML Namespaces
Recommendation. I feel that we should continue to enforce the fact that
jabber:x: and jabber:iq: namespaces within jabber:client are only
allowed in certain places (<x> within <message> and <presence>, <query>
within <iq> and so on). If the protocol remains strict here, Jabber
implementations will not have as much to compensate for and can be much
better optimized. It's also much easier to program when you expect
namespaces to always use certain element names in certain places. Again
I stress that this does not break the XML Namespaces Recommendation in
any fashion, we are simply adding additional restrictions to Jabber.
email: julian at jabber.org
jabber:julian at jabber.org
More information about the Standards