Blog Stats
  • Posts - 62
  • Articles - 11
  • Comments - 8
  • Trackbacks - 99

 

Binary XML

Take a look at this XML:

<?xml version="1.0" ?>
<Employee>
    <Name>John Doe</Name>
    <Hired>2004/01/01</Hired>
    <Salary>99,999.00</Salary>
    <Address>
        <Street>123 NW</Street>
        <City>Sunny Beach</City>
        <State>FL</State>
    </Address>
    <Phone>555-1234</Phone>
</Employee>

Put some line numbers:

00 <?xml version="1.0" ?>
01 <Employee>
02     <Name>John Doe</Name>
03     <Hired>2004/01/01</Hired>
04     <Salary>99,999.00</Salary>
05     <Address>
06         <Street>123 NW</Street>
07         <City>Sunny Beach</City>
08         <State>FL</State>
09     </Address>
10     <Phone>555-1234</Phone>
11 </Employee>

Remove all tags and pair line numbers with data:

00 
01
02 John Doe
03 2004/01/01
04 99,999.00
05
06 123 NW
07 Sunny Beach
08 FL
09
10 555-1234
11 

Remove extra spaces and empty lines:

02John Doe
032004/01/01
0499,999.00
06123 NW
07Sunny Beach
08FL
10555-1234

Finally, add a header to identify the source of the schema:

xml:contoso.com/schemas/employee.xsd
02John Doe
032004/01/01
0499,999.00
06123 NW
07Sunny Beach
08FL
10555-1234
end

Now send it over the wire and do the world a big favor.

Long live binary xml!

PS. open to discussion what base 10, 16, 64 or 256 can be used to identify elements, perhaps is irrelevant.


Feedback

# re: Binary XML

Gravatar hello Rebel:
How are you? I come from Taiwan and find your blog which introduces about Binary XML , and let me have more understand in Binary XML ,but some questions that I have, such as where is tag to go or how to recovery this Binary XML to textual XML in receiver side. In other hand,
What's the file extensible name in Binary XML...
Thanks for your help and wish receive your response as soon as possible...
good luck to you 7/15/2007 9:20 PM | phil

Post a comment





 

Please add 5 and 1 and type the answer here:

 

 

Copyright © RebelGeekz