Hi all, In this email I would like to ask clarifiation of section 11.2.2 of RFC 3920 (XMPP), regarding the use of default namespaces in IQ stanza.
In the IO-DATA proposal, XML Schema is passed in the IQ stanza. These XML Schema documents may use the default namespace when defining XML schema types and elements. For example, this is what the Chemical Markup Language does in [0] at line 1 (for readability layed out on multiple lines here): <xsd:schema targetNamespace="http://www.xml-cml.org/schema" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.xml-cml.org/schema"> <xsd:simpleType id="st.actionOrderType" name="actionOrderType"> Which defines the default namespace, and following XML Schema design puts the defined simpleType 'actionOrderType' using the targetNamespace attributs in the CML namespace... later in the schema, again according to XML Schema customs, the actionOrderType is used again, without prefix, and therefore taking from the default namespace defined in the above snippet (see lin 3070 in [0]: <xsd:attribute name="order" id="att.actionOrder" type="actionOrderType"> Now, one of the XMPP tools we use (I do not know yet which one, so won't name the tools just yet, to not encourage false accusations) removes the xmlns="" attribute from the above snippet. This effectively means that the second part (line 3070) of the CML XML Schema becomes invalid, refering to an actionOrderType now in the XMPP default namespace... Before I want to further explore which of the tools we use is removing this crucial bit of XML, and to decide this is a minor bug or a rather critical one, I would like to inquire if the XMPP protocol allows the above set up. Section 11.2.2 of RFC 3920 states [1]: "A default namespace declaration is REQUIRED and is used in all XML streams in order to define the allowable first-level children of the root stream element. This namespace declaration MUST be the same for the initial stream and the response stream so that both streams are qualified consistently. The default namespace declaration applies to the stream and all stanzas sent within a stream (unless explicitly qualified by another namespace, or by the prefix of the streams namespace or the dialback namespace)." This section defines the default namespace that applies by default to all elements, unless elements are explicitly qualified otherwise. From this section I do not read that the default namespace cannot be overwritten by IQ stanza content; indeed, the above description seems to follow the XML Namespace specification nicely. The first statement could be interpreted that the default namespace can solely be used to define the namespace of the first-level children, but that would contradict, I think, the last statement. So, my questions is, is the one of the libraries we use wrong, or, alternatively, can IQ stanza never overwrite the default namespace? Looking forward to your opinions on how to interpret this part of the XMPP specification, kind regards, Egon Willighagen 0.http://cdk.svn.sourceforge.net/viewvc/cdk/cdk-xws/trunk/xws-qsar-services/src/org/openscience/cdk/xws/schema/cml.xml?revision=14106&view=markup 1.http://www.ietf.org/rfc/rfc3920.txt -- Post-doc @ Uppsala University http://chem-bla-ics.blogspot.com/
