XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Convert any data format to XML … very cool

Hi Folks,

 

DFDL [1] is a very cool standard for converting any data format – text or binary – to XML.

 

Want to convert a (text) CSV file to XML?  Use DFDL.

 

Want to convert a (binary) JPEG file to XML?  Use DFDL.

 

 

For example, I used DFDL to convert a binary data format called IPFIX [2] to XML. I converted the following binary (shown in hex) to XML.

 

00 0A 00 24 54 F8 92 E1 00 00 00 02 00 00 00 0A

00 02 00 15 00 02 00 02 01 2C 00 02 80 00 00 02

00 00 00 FF 00

 

That binary has this meaning:

 

 

I ran the binary through a DFDL parser and … bam! … out pops this XML:

 

<IPFIX>
 
<Message-header>
   
<Version-number>10</Version-number>
   
<Length>36</Length>
   
<Export-time>1425576673</Export-time>
   
<Sequence-number>2</Sequence-number>
   
<Observation-domain-id>10</Observation-domain-id>
 
</Message-header>
 
<Set>
   
<Template-Set>
     
<Template-Set-header>
       
<Set-id>2</Set-id>
       
<Length>21</Length>
     
</Template-Set-header>
     
<Template-Records>
       
<Template-record>
         
<Template-record-header>
           
<Template-id>2</Template-id>
           
<Field-count>2</Field-count>
         
</Template-record-header>
         
<Field-specifier>
           
<Enterprise-bit>0</Enterprise-bit>
           
<Information-element-identifier>300</Information-element-identifier>
           
<Field-length>2</Field-length>
         
</Field-specifier>
         
<Field-specifier>
           
<Enterprise-bit>1</Enterprise-bit>
           
<Information-element-identifier>0</Information-element-identifier>
           
<Field-length>2</Field-length>
           
<Enterprise-number>255</Enterprise-number>
         
</Field-specifier>
       
</Template-record>
        
<Padding>0</Padding>
     
</Template-Records>
   
</Template-Set>
 
</Set>
</IPFIX>

 

Awesome!

 

/Roger

 

[1] DFDL = Data Format Description Language. More info at: http://www.ogf.org/dfdl

 

[2] IPFIX = IP Flow Information Export. More info at: https://tools.ietf.org/html/rfc7011

 



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS