> What is your opinion on this? Is MongooseIM or Strophe.js’ behaviour correct?


MongooseIM is correct here. I would also check that Strophe is handling stream 
errors correctly.



Every WebSocket message has to be a well-formed, independently parseable chunk 
of XML. Which means that all namespaces and prefixes MUST be defined inside 
that chunk. Everything else follows from that requirement.



You can either use the namespace directly without a prefix:

<features xmlns="http://etherx.jabber.org/streams"; />
<error xmlns="http://etherx.jabber.org/streams"; />

or if you wish to use the 'stream' prefix (or any prefix) you MUST declare it 
inside that element:

<stream:features xmlns:stream="http://etherx.jabber.org/streams"; />
<stream:error xmlns:stream="http://etherx.jabber.org/streams"; />




I called this out in 7395 because both stream features and errors traditionally 
use the 'stream' prefix while relying on the opening <stream> tag to define to 
define the prefix. But for WebSocket there is no parent <stream> tag providing 
those declarations, and it seemed like an easy item for implementors to either 
miss entirely or do incorrectly like so:

// Not define the namespace or prefix at all
<stream:features />
<stream:error />

// Define the namespace without a prefix, while still using a prefix
<stream:features xmlns="http://etherx.jabber.org/streams"; />
<stream:error xmlns="http://etherx.jabber.org/streams"; />

// Stamp 'jabber:client' as the namespace because it has no xmlns attribute
<stream:error xmlns="jabber:client" />
<stream:features xmlns="jabber:client" />



— Lance

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
JDev mailing list
Info: http://mail.jabber.org/mailman/listinfo/jdev
Unsubscribe: [email protected]
_______________________________________________

Reply via email to