Erik Price
Posts: 39
Nickname: erikprice
Registered: Mar, 2003
|
|
Re: Plain Text and XML
|
Posted: May 5, 2003 8:43 AM
|
|
Dave Thomas says: People think, "Once I've got my data in XML that's all I've got to do. I've now got self-describing data," but the reality is they don't. They're just assuming that the tags that are in there somehow give people all the information they need to be able to deal with the data.
One of the most useful parts of any XML file is the comments that are used to help explain things. There are faculties for making XML more human-readable, people simply have to make use of them.
When I hear someone say "XML is self-describing", I don't take that to mean that they think an XML document all by itself can tell you everything you need to know about it. My interpretation of this is that one doesn't necessarily have to draw upon an outside source to decode the meanings of the various tags. Certainly, some systems will use XML in ways that are only slightly more readable than binary formats, in which case, yes you do need to refer to an outside source to understand the file. And there are ways to handle more complex scenarios where you need a DTD or XSD or some kind of data dictionary to understand what is going on in the XML document. But in many cases, the XML document itself can do all of the work.
A big advantage of using XML is the fact that it's pretty widely-known. Using org.apache.commons.digester , I was able to give the users of a simple command-line tool I wrote a means of configuring the tool from a simple XML file (when I say simple, I'm talking about 5 or 6 elements). I provided an extensively commented sample XML file that could be used as a template for later configurations. If I need to extend the features of this file, I can do so easily without fear that my users will have to learn new, unfamiliar syntax for the configuration file (they will only need to learn any new elements or attributes that are added), as long as I remain within the XML standard. And chances are good that I'll be able to find a parser, perhaps one as easy to use as Digester, that can accommodate the changes, so I won't have to roll my own.
In short, I think a large degree of the responsibility for ensuring that XML documents are human-readable is with the author, or the author of the tool that will generate the documents. It's not the XML format itself that has an inherent problem with being human-readable.
|
|