The Opening Tag
Earlier, we said that the opening document tag was used by the client to “announce its intentions.” The following is a typical opening document tag from a Jabber client that has made a socket connection to port 5222 on the Jabber server jabber.org:
<stream:stream
xmlns:stream="http://etherx.jabber.org/streams"
to="jabber.org"
xmlns="jabber:client">
There are four parts to this opening tag:
- The
<stream:stream>tag Every streaming Jabber XML document must start, and end, with a
<stream:stream>tag, qualified with thestreamnamespace.- The
streamnamespace declaration xmlns:stream="http://etherx.jabber.org/streams"The declaration of the
streamnamespace also comes in the openingstreamtag. It refers to a URL (http://etherx.jabber.org/streams), which is a fixed value and serves to uniquely identify thestreamnamespace used in the XML document, rooted with<stream/>, that is, streamed over a Jabber connection.The namespace qualifies only the tags that are prefixed
stream:. Apart fromstream, there is one other tag name used in these documents that is qualified by this namespace, and that iserror. The<stream:error/>tag is used to convey Jabber XML stream connection errors, such as premature disconnection, invalid namespace specifications, incomplete root tag definitions, a timeout while waiting for authentication to follow the root tag exchange, and so on.- The
toattribute to="jabber.org"There is a
toattribute that specifies to which Jabber server the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access