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

Re: When is it appropriate/good to format data as XML?

  • From: "G. Ken Holman" <gkholman@CraneSoftwrights.com>
  • To: "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>
  • Date: Mon, 25 Feb 2019 16:44:50 -0500

Re:  When is it appropriate/good to format data as XML?
I wonder if Randall Monroe follows XML-Dev and saw the humour in Friday's XML-Dev post when he wrote today's xkcd webcomic ... the quote that follows the link below is the alternative text one sees when hovering over the comic image:

https://www.xkcd.com/2116/
"At some point, compression becomes an aesthetic design
choice. Luckily, SVG is a really flexible format, so
there's no reason it can't support vector JPEG artifacts."

. . . . . . Ken

At 2019-02-22 18:06 +0000, Costello, Roger L. wrote:
Hi Folks,

Clearly the marketplace does not believe that XML is appropriate/good for every type of data.

Consider:

- Although there is an XML format for image data (SVG), most images in use today are not formatted as XML/SVG. Most images are formatted as binary JPEG, GIF, PNG, etc. files.

Why is that?

Why is it that there is far more usage of JPEG than SVG?

Is it simply because an XML-encoding of image data is too huge? Is size the reason? Or is there more to it?

The JPEG standard was defined prior to XML. There existed JPEG parsers and tools well before there existed XML parsers and tools. Perhaps the reason that JPEG was never supplanted by XML is simply because of inertia - it would have taken too much effort and expense to replace the existing JPEG toolset?

Wikipedia says that XML "defines a set of rules for encoding documents."

Perhaps image data is not document-oriented; is that why most images are not in the XML format?

Note: I am not clear what it means for data to be (or not be) document-oriented.

XML-formatted data can be beautiful.

Binary-formatted data can also be beautiful.

Scenario: There exists data about a person's name and date of birth (DOB). The data consists of an ASCII string representing the person's name and an ISO 8601 date-time string value representing the DOB. We may wrap the text data in tags to produce XML such as this:

<Person>
<Name>John Doe</Name>
<DOB>2000-02-06T20:13:35</DOB>
</Person>

Alternatively, the data might consist of a 4-byte integer representing the person's DOB in number of seconds since Epoch and a null-terminated ASCII string representing the person's name. The name and DOB can be compactly represented in binary with this series of hex digits:

4A 6F 68 6E 20 44 6F 65 00 EF D5 9D 38

You might argue that this series of hex digits is not readable, but to a machine it can be very readable (processable).

Both formats are beautiful.

With DFDL (Data Format Description Language) we have tremendous agility in converting binary to XML and vice versa.

When is it appropriate/good to format data as XML?

When is it *not* appropriate/good to format data as XML?

/Roger

--
Contact info, blog, articles, etc. http://www.CraneSoftwrights.com/x/ |
Check our site for free XML, XSLT, XSL-FO and UBL developer resources |
Streaming hands-on XSLT/XPath 2 training class @ US$45 (5 hours free) |



[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.