[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Converting binary data to XML

  • From: "Costello, Roger L." <costello@mitre.org>
  • To: "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>
  • Date: Fri, 4 Oct 2019 16:37:28 +0000

Converting binary data to XML

Hi Folks,

Scenario: You electronically receive book data from a supplier. The data is in binary. You want to convert the data to XML so that you can leverage the large suite of XML tools that the marketplace provides.

Here is an excerpt of an input that you receive, displayed in a hex editor:

You could implement your own custom parser to process the input data. But that’s not the declarative way. You want to simply describe the input and then feed that description into a tool that will parse the data based on your description – Hey tool, here’s my description of the input’s format, now you figure out how to parse it.

So, you need a language for declaratively describing the format of the input data. In other words, you need a data format description language. Such a language exists! It’s called DFDL (Data Format Description Language). DFDL is a language for describing data formats, both text and binary. Interestingly, DFDL is an XML language! A DFDL processor takes two inputs: the input data and a document that describes the format of the input data. That document is called a DFDL schema.

I created a DFDL schema that describes the format of the binary book data. I handed my DFDL schema and the input data to a DFDL processor which then parsed the data based on my description. The output is XML.

The binary is converted to XML! Pretty neat, don’t you think? Want to learn more about DFDL? Here is my updated DFDL tutorial:

http://www.xfront.com/DFDL/index.html

/Roger



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


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.