3.1.4.7 BinXml

The event information returned by the query and subscription methods is in a binary format named BinXml. BinXml is a token representation of text XML 1.0, as specified in [XML10].

Here BinXml encodes an XML document so that the original XML text can be correctly reproduced from the encoding. There is no requirement for a server to use or understand the text XML. The protocol can be implemented end to end by treating BinXml as a method to transmit name-value pairs, instead of as an encoding of XML. However, after the data has been received, it is common for third-party applications to convert from binary XML to text XML independent of the protocol. Therefore, for informative purposes only, an overview of the relationship is provided.

Note that this translation is not required by either the client or the server in this protocol.

What follows is a greatly simplified example of a fragment of text XML encoding in binary XML.

Text

Binary

<SomeEvent>

01 SomeEvent 02

<PropA> 99 </PropA>

01 PropA 02 05 "99" 04

<PropB> 101 </PropB>

01 PropB 02 05 "101" 04

</SomeEvent>

04 00

The binary bytes in the preceding example have the following meaning.

 00 - eof
 01 - open start tag
 02 - close start tag
 04 - end tag
 05 - value text

BinXml also includes more information that allows for fast navigation of the XML. For example, lengths of elements and attribute lists allow the user to jump forward in the BinXml stream. Another example is that BinXml encoding of Names includes length and hash values that allow for fast comparisons of the XML names.