← Prev in month ← Prev in thread
Next in thread → Next in month →

Re: [xml-dev] When is it appropriate/good to format data as XML?

From
G. Ken Holman <>
To
"" <>
Date
2019-02-25T21:44:50Z
ID
<>
Thread
Re: [xml-dev] 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) |
← Prev in month ← Prev in thread
Next in thread → Next in month →