Why XML Doesn't Suck 416
Richard Eriksson writes "Recalling the earlier discussion on why XML sucks for programmers, Tim Bray clarifies his stance on his co-creation, XML, and gets back on his pulpit to declare that XML Doesn't Suck. He writes: 'Let's look at some of XML's chief virtues, then I'll address some of the XML-sucks arguments, in the same spirit that Sammy Sosa addresses a fastball.'"
Sammy Sosa analogy maybe not the best (Score:5, Funny)
You mean he strikes out swinging on three pitches while trying to jack the ball in the stands instead of trying to make contact?
Why XML doesn't suck ... (Score:5, Funny)
Besides, it is a great buzz word!!!
Re:Why XML doesn't suck ... (Score:2)
nuts! (Score:2, Insightful)
XML is very useful. It's not XML's fault that Microsoft isn't implementing it.
Re:nuts! (Score:2)
XML is technically very useful, it's easily parsed, but it's an awfully hyped technology.
Re:nuts! (Score:3, Informative)
Re:nuts! (Score:5, Informative)
Are you smoking crack? I hate Microsoft as much as the next guy, but have you seen
Granted, MS hasn't backported everything to XML (think we'll ever see an XML registry?) but everything going forward has XML tattooed all over it. I happen to love XML, but if anything Microsoft tends toward the zealous side.
Re:nuts! (Score:5, Informative)
Ppppppht! *sprays water all over monitor* Microsoft's not "implementing it?" What in the heck do you mean by that? Have you taken a look at anything in the .NET suite lately? The entire system is built on XML. The solution files, project files, assembly manifests, application configuration files, setup binding files - they're all XML! Visual Studio .NET is build extensively on XML, and the .NET API includes some very intuitive and powerful classes for reading, manipulating, and building XML documents. I suggest you do at least a cursory investigation before spouting something so outrageously inaccurate next time.
Re:nuts! (Score:5, Funny)
Micro$oft sure has some balls extending the "eXtensible Markup Language"...
Re:Why XML doesn't suck ... (Score:3, Funny)
1) "XM... did you just say HTML?"
2) Are you using the
3) *left hook*
Re:Why XML doesn't suck ... (Score:5, Insightful)
Perhaps, but those meetings are about the fact that the department over there uses technology X and the department over here uses technology Y and the company saves $$$ if the two departments can actually talk because right now you pay people to do data entry twice and you pay more senior people to deal with the discrepancies.
These managers ask their tech people "How do we deal with this problem" and they hear "XML" and take that up the chain.
The bottom line is that in a company, system integration costs are the biggest expense in IT. XML decouples data from platforms and that makes integration easier and saves big bucks. So it becomes a buzzword because upper management needs buzzwords to describe things that enable.
Re:Why XML doesn't suck ... (Score:3, Informative)
I certainly agree that 3rd normal form schemas have advantages above even this. The only problem is that RDBMS schemas are tightly coupled to the individual database application that uses them and can't really exist without, well, an RDBMS. Both properties hamper system integration issues.
You might examine Oracle 9iR2's XML database capabilities, by the way.
Conversion... (Score:4, Interesting)
That said, the challenge stems from MV-fields. Those nifty things in PICK which give you the power of keeping associated fields within one table, with as many associations as you like. (for good or for bad, bad usually when it's been abused or good housekeeping neglected.) Piling MV stuff into CSV is just plain icky. Normalizing it first is also icky. However XML may offer a simple, elegant way of keeping it all together in the shape it existed in (which may be important down the road if someone has to produce a report from it (auditors, second guessers, or a55-covering because some account didn't have the right amount of debits or credits for years and the difference needs to be found.)
I'm off to explore XML more fully. There's probably yet-another O'Reilly book in my future...
Hang on... (Score:5, Funny)
Re:Hang on... (Score:5, Informative)
Re:Hang on... (Score:4, Funny)
Argh! You are right. I meant "180". Where's the "preview" button on the brain?
Re:Hang on... (Score:3, Funny)
I added one for myself a few weeks ago when I added a windowed case-mod and neon lights...
Re:Hang on... (Score:5, Informative)
Going around in circles yet ending up where you started? I think you mean 180.
We're going to turn this team around 360 degrees.
- Jason Kidd, upon his drafting to the Dallas Mavericks
That sounds like the Mavs., going around in circles but never really going anywhere.
- Me.
Well, then anyway, they're not all that bad at the moment, best motion offense in the league.
Re:Hang on... (Score:3, Funny)
"Two wrongs don't make a right, but three lefts do."
Re:Hang on... (Score:5, Insightful)
And to stay on topic, XML sucks for some things and doesn't suck for others, just like any other technology. A hammer claw is a fine tool for removing a nail, but not as useful for removing a splinter from your finger. Less energy needs to be spent on arguing whether technologies like XML suck or not, and more energy needs to be put into studying their most practical and optimal uses.
Re:Hang on... (Score:5, Funny)
"That depends on what the definition of 'sucks' is..."
No, I can see him saying that.
Re:Hang on... (Score:2, Funny)
Re:Hang on... (Score:3, Funny)
This reminds me of the Dilbert strip where Dogbert gives Ratbert a book titled something like:
"Conversational Geometry for Idiots"
Nope, no contradiction here. (Score:3, Insightful)
RTFAs.
(One could argue that no good parsing solution is itself a weakness of XML, but IMHO the problem is that we got stuck going down the wrong road(s) for parsing, with SAX and DOM, both of which look good on paper but lack a certain practicality. If in five years there's still no good solution then maybe it
Apple Uses XML (Score:2, Informative)
Steve likes it, he really likes it!
I DO hate XML (Score:5, Interesting)
Just my 2 cents.
Re:I DO hate XML (Score:2)
Re:I DO hate XML (Score:2)
Cuts both ways.
Re:I DO hate XML (Score:5, Interesting)
I think the original poster's point was that XML allows for so much abiguousness, that every tool seems to do it differently and none of them can understand each other. The standard should be so strict as to *require* that if the same representation of a "piece of data" is made by two different tools, the representation should be exactly the same. No reason to say, "oh, you can put an endline there if you want, or you can end a tag these two different ways, whatever suits your fancy.
Sure, the tools should have been written so that they all followed whatever standard is out there, but we all know that that doesn't happen. The standard should *force* the tool writer to be anal about the standard and follow all the conventions.
A good compiler should do as good a job as possible to warn you of errors, before they become runtime errors (because those are harder to find). In the same way, a language should be designed such that more errors are compiler than run-time. In the same way, a standard should nearly impossible to create a file that doesn't follow the standard perfectly and still work. XML folks actually tout the opposite as a benefit!
A tool is written and most of the time is tested with itself, and thus *seems* to work, but doesn't really.
Re:I DO hate XML (Score:3, Insightful)
XML does allow for ambiguity. However, it also allows for a lot of control -- it's just that many users don't make use of it.
If you wanted to, you could write an XML document without any sort of DTD or schema. It validates, because there's nothing to validate it against. Similarly, many companies create XML files without bothering to create schemas, and so they run into problems because they didn't define their own document structures first.
XML has its own standard, but that standard isn't meant to ex
Re:I DO hate XML (Score:3, Insightful)
computers don't have to deal with the xml schema, it's someone's implementation of how to handle schema's is where the problem comes in.
just my quarter.
You're confusing SOAP with XML - SOAP is the issue (Score:3, Insightful)
I don't like SOAP for most uses as it's overly complex for things like simple RPC style calls. Simple XML over HTTP can work just fine for how most people use the thing - it's not like everyone is doing distributed transactions or things that really take advantage of the SOAP envelope.
Proper SOAP toolsets abstract developers from XML (Score:3, Insightful)
Re:I DO hate XML (Score:3, Informative)
XML isn't a language. It is a metalanguage. It is vague by design, to allow arbitrary languages to be created.
XML is not a programming panacea. It is for structured data.
Suck it up.
Re:I DO hate XML (Score:2)
Re:I DO hate XML (Score:5, Informative)
LOL, so true. Maybe
XML document == data in a well defined format
XSL/XSLT == tells how to display XML data(think FOP), but is itself a valid XML document
XPATH == XML query language, which after you look a few examples it isn't too hard
SVG == vector graphic format stored in an XML data stream
XML itself is not hard, but until you figure out how all the many pieces fit together it can be confusing. Another thing to keep in mind is that you don't have to use every piece to make use of XML.
XML is so good... (Score:3, Funny)
Re:XML is so good... (Score:5, Insightful)
Why do people argue about apples and carrots? (Score:5, Insightful)
You're both right.
XML is great for certain things, chief among them being human-readable / manipulatable data storage.
XML sucks because of certain things, chief among them being complexity / verbosity.
I think it's safe to say that XML is a niche -- not universal -- language. If we all accept that it's fine for certain things, but not for others, then we can all get along and go back to ripping Microsoft to shreds.
Re:Why do people argue about apples and carrots? (Score:2)
The problem is that most people like to live in a black and white world where some things suxors and some things rule -- whether it's for data formatting protocols or for politics.
The larger my life experiences database grows, the more I realize that being overly accepting of things that rule or overly dismissive of things that suxors is normally a mistake. Actually using my brain to analyze things and see how they may or may not apply in any given situation is more mentally taxing, but p
Re:Why do people argue about apples and carrots? (Score:4, Insightful)
Of course it's not a universal language; nothing is. But just because it's not the right tool for storing executables, doesn't make it a niche language, anymore then Perl or C are niche languages. Its "niche" is storing data in a computer-parsable, yet human-readable, extendable format. That's a lot of stuff.
Re:Why do people argue about apples and carrots? (Score:5, Insightful)
XML Doesn't Suck:
while working on a new java servlet app my text editor (Jedit) noticed I was working on an xml file (web.xml). it auto-downloaded the DTD, and the was able to gently remind me of missing or misplaced elements. This was so useful that I created a DTD for my home-rolled xml files, and Jedit was able to soft-validate and autocomplete those too. Not because Jedit understood what I was doing, but because it understands xml. Wicked cool, and "for free."
XML Sucks:
well, then I tried to read a simple XML config file into my java app using Apache Digester (candy-coated SAX parser). for a while I scratched my head wondering "why the hell do I need a stack and callbacks to read simple data?" attributes are fetched differently from tag contents. it is extremely non-intuitive. Eventually after poring over enough examples I "got it," but the process is so far divorced from what I actually want to do that I almost didn't get there.
anyway, at least now I have a more balanced view than "xml r0x" or "xml suxx0rs." what's needed is an XML api that is fast and makes immediate sense.
Re:Why do people argue about apples and carrots? (Score:3, Insightful)
The explanation of your problem explains how SAX processors work, which isn't how you want to process your XML obviously. The correct solution is to use another processor that processes your XML the way you require.
Re:Why do people argue about apples and carrots? (Score:3, Informative)
"what's needed is an XML api that is fast and makes immediate sense."
Since you're talking Java, it already exists and it's called JDOM [jdom.org].
And for the record, I'm firmly in the "doesn't suck" camp.
Real world XML NOT human readible! (Score:3, Insightful)
XML was designed to be universally machine readible. In this sense, rather than depending on byte codes, positional values, INT/WORD/DWORD etc. etc. differences (not to mention time and d
/. Mirror, Just in case (Score:3, Informative)
XML Doesn't Suck This is going to be fun. XML first saw the light of day in November 1996 and between then and 1999 or so I spent most of my time trying to convince people that XML was a good idea and they should use it. In recent years, though, my XML-related work has been much less, due to my role at Antarctica, and has been focused on corner cases and weird interactions, due to my participation in the W3C TAG. So it's going to be a refreshing change to get on the old familiar pulpit and preach the XML gospel a bit.
I'm doing this because quite a few people reacted to my article by saying "See, a co-inventor of XML admits that it sucks, like I've been saying all along." (Many of them obviously hadn't read the article, but anyhow). Some of the XML-sucks arguments were:
It's verbose
XML does a lousy job of what Lisp S-expressions could do decades ago.
XML does a lousy job of what comma-delimited files could do decades ago.
XML has a stupid design with two completely different mechanisms for holding content (elements and attributes), and then there's that weird "mixed content" thing.
XML can't make up its mind whether it wants to be a tree or a sequence.
XML is nice and straightforward but to use it you have to learn all this seriously ugly and complex stuff like XPath and XML Schema.
Bah. Sticks and stones, etc. Let's look at some of XML's chief virtues, then I'll address some of the XML-sucks arguments, in the same spirit that Sammy Sosa addresses a fastball.
XML Has Internationalization Pretty Well Nailed Sometime in the last few years, native speakers of English became a minority of Net users, and I'm quite certain they're a minority among users of computers in general. Up until the late nineties, I suspect that the vast majority of application writers basically didn't understand i18n issues, didn't care, and many didn't think they needed to (i18n is an abbreviation for "internationalization"). Those that did often thought they could get away with hacks like switching Microsoft Code Pages or using the much-loathed ISO 2022.
XML, I think, gets a lot of the credit for changing that. In XML, there's no ambiguity - a document is a sequence of characters, and characters are numbers, and the numbers mean what Unicode/ISO10646 says they mean. There are lots of different ways to store those numbers as bytes in data files, but XML forces you to say which one you're using right up front. Larry Wall said it best: "An XML document knows what encoding it's in."
Basically, XML doesn't let you get away with ignoring the issues. While there is some ongoing tinkering with XML's i18n facilities, that's mostly because Unicode/10646 itself has been changing.
If I had to pick the biggest contribution XML has made to the world, this would be it - forcing people to learn the issues and start doing the right thing.
XML Can Represent Pretty Well Anything I don't need to expand on this very much except to note that XML has been used to represent, without loss of information, algebra, bibles, computer programs, database records, email, filings to regulators, GIS data, human-resource data, iTunes collections, journal entries, KR data, logic, manuals, network maps, ontologies, purchase orders, queries against databases, remote procedure calls, schemas, transactions against commerce servers, update logs, vector graphics, winecellar inventories, XXX movie metadata, yearly calendars, and Zen koans. OK, I don't know for sure about the koans.
That's a lot of syntaxes that didn't have to be invented.
XML Forces Syntax-Level Interoperability "Interoperability" has been a mantra since I've been in t
Why XML doesn't suck (Score:2, Insightful)
One word: Marketing
I have no doubt that most people would agree that there are just-as-easy-to-understand standards out there, and for certain tasks, some are much better. The advantages that XML has are that it'll expand to fit most any application (which is matched), and most everyone already knows how to use it, through knowing how to use HTML, if nothing else (which isn't really matched).
The reason most everyone knows how to use it is that, at one point, the right people jumped on the XML marketing
XML Confers Longevity (Score:5, Interesting)
Will XML really solve this problem? Hopefully the OpenOffice format will help, but if Microsoft maintains its marketshare (and keeps its XML generation limited or even proprietary), are we really better off?
I'll just stick with LaTeX.
basically why it doesn't suck (Score:5, Interesting)
1. the data and/or fields added at anytime WITHOUT breaking anything
2. the data is in a heiracherical format, reducing data replication and allowing for a more sophisticated data structure.
3. the daya can be changed by a text editor.
4. and BECAUSE the data is text, it compresses REALLY well.
Re:basically why it doesn't suck (Score:5, Insightful)
The data compresses so well because it's encoded in a highly inefficent manner. Your average compression algorithm will be able to find more redundancy and give you a better % compressed, but it still won't compare with a human actually packing the data tightly together in the first place.
or, to take a more information theory POV, there is a certain amount of information in your post, which can be compressed down X percent by default. That same information has to be encoded in the XML version, and has the additional overhead of XML to deal with, so even compresed it will always be larger than the compacted and compresed binary only version.
XML has a lot of strengths, but compactness is not one of them.
Re:basically why it doesn't suck (Score:3, Insightful)
I strongly suggest you take a complex MS Word document, and convert it into StarOffice 5.0 format, then into OpenOffice 1.0 (XML) format. The filesize of the OpenOffice 1.0 (XML) document will be FAR smaller than either
Re:basically why it doesn't suck (Score:2)
day sales
1 32
2 23
3 22
And let's write it in xml
<dataset>
<row>
<day>
1
</day>
<sales>
32
</sales>
</row>
<row>
<day>
2
</day>
<sales >
23
</sales>
</row>
<row>
<day>
3
</day>
<sales>
22
</sales>
</row>
</table>
I think you can see the redundancy here. Both are text, no matter how you compress it the second will be larger
What's the big deal? (Score:5, Interesting)
Why are there so many
Re:What's the big deal? (Score:2, Insightful)
Re:What's the big deal? (Score:3, Informative)
The power of XML comes not out of its syntax but out of the tools that are there for it and what you can do with them.
The nice (if obvious) tool for XML is the parser. XML is specified so that any computer science undergrad could write one in a couple weeks. As a result, there are a lot of parsers out there and they all do the same thing. This makes
I agree, XML does not suck (Score:5, Interesting)
Not ony can I transform their content into different views or formats, but (for example) the same XML file that is used to provide software documentation also is used to build the software GUI and provide tool tips and other forms of context sensitive help.
No database required. No parsing required. Just a couple libraries and tools, and we're set to go.
Re:I agree, XML does not suck (Score:3, Insightful)
How long will it be before XML, which may be simple and easy to make consistent now, is "extended" into a similar monster, only to be replaced by some other "savior" specification?
Why is it so difficult for us to recognize that, except for the most basic of things, automation is hard.
Re:I agree, XML does not suck (Score:2)
Automation is hard? I write a little stylesheet, similar to writing a
money laundering via XML (Score:2, Funny)
Try to stop seeing things in Black and White (Score:4, Insightful)
XML is much worst that lots of other choices in certain situations.
Why can't you see the shades of grey, and insist on seeing all in black and white ?
Have fun,
Daniel
Code embedded in XML (Score:5, Interesting)
I saw a letter to Dr. Dobbs recently that was saying that XML needed to have the ability to embed things like Visual Basic and javascript in it to be really useful. I think that this is a horrible idea. The whole point of XML was to have a generic data model, i.e. one parser to rule them all.
I've been able to do thing like export MySQL schemas into XML, then using XSLT generate an entire set of base classes providing persistent objects. What was once weeks worth of work, now takes an afternoon (from concept to final product). The whole set is entirely consistent, no misspelled names or changed signatures. When bugs were found, I fixed all the files in one place and rerun the XML/XSLT script. Massive productivity boost. If that isn't an argument on why XML doesn't suck I don't know what is.
The idea of embedding code in XML is a perverse distortion of what XML is really about. XML would suck if one uses it for unintended purposes. I don't use a hammer to tighten machine bolts, well I guess some people do.
If xml was a programming languge.... (Score:2, Funny)
<function name="main">
<if:xml sucks="true">
<printf>XML sucks as a programming language</printf>
<else>
<printf>XML rules as a programming language</printf>
</else>
</if:xml>
</function
The ironic thing is... (Score:2)
All in the Tools (Score:2)
Tim Bray's Original Post Was Off Base (Score:5, Informative)
There are more classes of APIs supported on multiple platforms for processing XML such as pull-based APIs and cursor based APIs which are represented by the System.Xml.XmlReader [microsoft.com] and System.Xml.XPath.XPathNavigator [microsoft.com] in the
Tim Bray's original problem was that he doesn't have a pull-based API for XML parsing in Perl. I pointed out in my kuro5hin diary [kuro5hin.org] how the pseudo code he showed as being his ideal for processing XML already exists in C# and
Re:Tim Bray's Original Post Was Off Base (Score:2)
PIs?
Java Pull-based APIs (Score:3, Interesting)
everyone should read ... (Score:3, Funny)
Some of you may already have read it, but it's on-topic nonetheless.
A bit off topic... (Score:3, Interesting)
"Slashdot and Stupidity I visit Slashdot once per day, sometimes more, because they seem to do a really good job of relaying the geek zeitgeist. It's a long time since I read much of the follow-ups, but I thought I ought to this time, and I'm reminded why. How can a publication that caters (on the face of it) to smart people attract the attention of so many shallow, drivelling morons?"
"Interactivity Again There were a few smart things there in among the chaff on
http://www.tbray.org/ongoing/When/200x/2003/03/
XML is just XML (Score:2, Informative)
Programming for XML is more work, but in the end, it forces you to be more structured and disciplined to work with it. You are always working with standard way of constructing data and messages, rather than having to reinvent a new wheel
XML is fine. The W3C is what sucks (Score:3, Insightful)
They can't help it though, the W3 committees are infested by the same lifers who destroyed SGML. It would be refreshing to see a standards committee for once run by people who are suspicious of standards committees. Right now the XML world is run by the people who live off of the small cred being on a committee lends to their consulting biz, etc. so they have no motivation to ever finish the committee's works.
XML is way too verbose (Score:2)
A simple look up table and RLEing the results with a checksum can offer significant savings.
For an exercise, try sending a 900 K XML file off to a server and wait till it's done. Then look at the XML and see how you could make it smaller. It's kinda obvious and sad that it wasn't done in the first place.
XML as dough (Score:4, Insightful)
But XML is not for that!
XML is like dough. Nobody eats raw dough (it's probably OK to eat it, but it ISN'T tasty), but eats cookies and bread instead.
XML is NOT for user and/or administrator usual exposure, XML is for application data transfer.
And applications that require XML to be written by human are only half done: they should be used in combination with HumanInput -> XML generation programs.
From a Programmer's perspectice (Score:2, Informative)
XML precision sucks (Score:3, Insightful)
There are IEEE specifications for numbers that are exact down to the bit. And processors actually comply to them.
Now convert your number to text, using a decimal representation (as AFAIK is recommended for XML). What you get is typically not the number you had before.
Re:XML precision sucks (Score:3, Insightful)
A recommendation is just that, a recommendation. If you have more important goals then do something more appropriate. XML doesn'
It's just a layer (Score:2, Insightful)
So when you read the file, you parse the text, then the XML, then your tags to get your data into a usable state. XML is is just a way of formatting text. That's where the "meta" comes in. It's not a document type, it's just a standard for creating document types.
The only way XML makes data long
Some people just don't "get" XML (Score:5, Insightful)
1 - XML sucks as a language
Repeat after me, XML is NOT a language. Certainly not in the sense that C++ is a language. XML is a standard that defines how one structures data.
2 - XML is bloated, I can send binary much cheaper/easier
DUH. If your application is fine using binary data transfer, then USE it. HOWEVER, many applications that either have to A) communicate with other applications or B) have to deal with varying data sets benefit greatly from using XML. Anyone who has been programming for any length of time knows that while binary is more compact, it is less flexible and potentially more error prone. Want to add a new field in the middle of your data, boy you better not get your software versions mixed. Want to write an app that can do reasonably intelligent things with ANY data it recieves, binary is not the way to go. As with all things in life, use the tool for that which it was intended (vs some peoples view that it is the end all be all of data representation).
3 - It's slow
Same as 2 above. If absolute performance is an issue, then by all means, use whatever representation gives you what you need. XML is about flexibility and standardization, NOT performance.
4 - It's complex
Well as complex as you want to make it, and it does sometimes encourages more complexity than is really needed, but it doesn't FORCE you into it. If you want/need schemas, go for it. If you need the functionality but in a simpler form, then do that (unless of course you need to communicate with another system expecting a schema, but his is obvious). It's just like C++, you don't HAVE to use templates and multiple inheritence (hell, you don't even have to create classes if you don't want/need), you use the parts of the tool that are useful and provide benefit, you don't use them just because they're there.
So I don't see what all the bruhaha is about. It has it's strengths, it has it's weaknesses. As with anything, relatively, new, people are trying it in various places. Some of these places not really fit, others do. I've designed apps that benefited greatly, others I've dismissed xml for entirely.
Questions, questions, questions.... (Score:2, Funny)
How do I encode properties (fields) of my data: child elements or element attributes?
How do I join the preceding-sibling namespace descendent ancestor-or-self following axis of evil?
Electronic Data Interchange (EDI) (Score:4, Interesting)
However, we charge by the kilocharacter of data you send and receive per month. So, for us, XML is awesome, because it increases the size of an ASCII-X12 or EDIFACT document by a factor of 5-a lot more (usually somewhere around 15-20 I think).
X12 and EDIFACT are standards for business document exchange that have been around for a while, but people are converting to XML because they think it's better (eventhough, usually, they just use the X12 or EDIFACT format, but with XML tags).
For example, a line item record may go from something like this:
LIN:0001
to something like this:
<LIN_GROUP>
<LIN>
<LIN_01>0001</LIN_01>
</LIN>
</LIN_GROUP>
It's not always that bad, but it can also be much worse. (Imagine replacing each instance of "LIN" above with "Line_Item" and "LIN_01" with "Line_Item_Number".) (And why won't that semi-colon after the LIN_01 end tag go away?)
so-- for us, XML doesn't suck-- it increases our revenue. For our clients, it's sucks, because it increases their monthly bill.
Yes, but... (Score:3, Insightful)
Hate to burst your bubble, Tim, but this is the same justification that Microsoft to defend their monopoly on PC operating systems. There wouldn't be any portability issues if everyone used Windows(but there might be stability issues!)
And I agree with the notion that standards are a good thing, however, I have to be realistic at the same time. Any standard sufficiently broad to cover all of the possible bases will be so general as to be useless, or at the least, very inefficient in a large number of cases. The reasons why different standards crop up is because different users have different needs and values. In the UNIX community, portability, stability, and interoperability are highly regarded, where as in the Windows community, flashy GUI's and speed are often more important. Hence, two widely different systems.
The portability of XML is nice. The fact that it can represent just about anything is also nice. But the nature of XML precludes indexing, which means if I'm searching for a particular record in an XML dataset, I might have to read the entire file. Not a problem for small databases, but for mainframe size databases, this is simply unworkable.
No, XML doesn't suck. But then again, it's not a silver bullet either. Need I say the adage about hammers and nails?
Just do one thing for me (Score:3, Interesting)
Just make </> close whatever the last tag was. That instantly cuts the size of the files in almost half, and makes them easier to read as well.
And yes, it could be confusing in a heavily nested file, but nothing says you have to use them. It would be a godsend for database columns.
Re:Just do one thing for me (Score:3, Insightful)
Spot the 'lite' user of XML. If you're dealing with anything of any size, complexity or (let's face it) use, then that's a really good idea for unmaintable, buggy XML.
XML==Hierarchical database? (Score:3, Interesting)
XML is really nice (Score:3, Interesting)
Human-readable.
As a programmer, this is the most useful property a data stream can take on. Why? Debugging. The reasoning here is twofold:
1. Non-parallel development of opposite ends of the data stream:
It's quite a challenge to develop the code which produces the data and the code which uses the data at the same time. If it doesn't work, you don't know where the problem is. With a human-readable format, you can simply pipe the data in or out of the app directly from a text file, and verify that it's correct yourself.
2. Debugging:
Something of an extention of the previous, if you have two bits of code communicating through XML, you can log the bad transmission and read it yourself to find out if the bug is in transmission or reception.
Now, I won't pretend that XML is the only human-readable data-structuring format, but it has a lot of nice advantages over the others, each of which is covered in the article. XML makes apps a pain to develop, but a breeze to debug--and the debugging is far more important!
Solve this Problem (Score:3, Interesting)
Assuming something more efficient, like <class><studentId>, where you simply reference students by an id rather than inlining each student's data, removes the reduplication problem. However, everything else becomes harder. First, you have to be able to reference a student by its id, so you use a hashtable. Next you either have to require that student data comes first, or you have an update phase where you update each of your class objects. Lastly, XSLT isn't cake anymore (show me the roster for class X including all the students details).
Although this problem exists in any other application that parses data that contains internal references, it's still a major pain-in-the-ass.
What's the best way to tackle this situation?
XML definitely does not suck, XSL does somewhat (Score:3, Interesting)
XSL/XSLT on the other hand can be a pain to use in anything other than trivial transforms, in my unschooled opinion. The concept of recursive processing is great, but the math/logic syntax available is byzantine (eg "variable" is really a constant).
*sigh* I know this will get modded offtopic, but seriously... anyone agree with me, or do you actually like writing transform logic and processing in XSL? Please comment.
XML is a primary innovation (Score:4, Informative)
We don't need schemas, stylesheets, xpaths,... just simple XML. And yet we can write very rich code in XML instead of in native code. Today we're producing about 25 lines of final code for 1 line of XML, and we're pushing this up all the time. My current project generates workflow engines from XML definitions, building a 10k workflow application from a single 500-line XML file.
My point is that XML is not just a handy way to store data. It is a meta language, able to formally define any concept, no matter how abstract. This is an incredible but subtle thing. The power comes not from XML technology itself, which is really very, very simple once you ignore the W3C fluff. The power comes from the freedom that XML technology gives you, namely the ability to abstract your problem to as high a level as your mind can take it, and to solve it at that level.
This is difficult, and takes time, but as the XML space settles down it will become clear that this is the real value of the technology.
The 'con' arguments all appear to be related to people trying to use XML in the wrong place, for the wrong thing, or to replace existing abstractions that work perfectly well.
Re:XML is a primary innovation (Score:3, Interesting)
XML for Koan (Score:3, Funny)
"XML Can Represent Pretty Well Anything"
"XML has been used to represent, without loss of information...yearly calendars, and Zen koans. OK, I don't know for sure about the koans."
<koan attribute_to="Chao-chou">
<question asked_by="random monk">
Does a dog have Buddha-nature or not?
</question>
<response master="true" smileQuizzically="true" useMuResponse="true"/>
</koan>
Good For Interchange / Bad For Applications (Score:4, Insightful)
However, because XML is such a huge buzzword now, people are proposing (or insisting on) using it as a format at the heart of complicated applications. Where anyone would have said 'Use a database' a few years ago.
In doing so, people are losing sight of the essential beauty of the relational data model. With a RDBM, you, the programmer, have tremendous flexibility about *how* you view your data. This is a huge win inside of an application. XML forces you to commit to one specific view of your data. Yes, if that data needs to live forever and yes, if that data needs to get sent to someone else, than by all means, store it in an XML file. But if you need to *do* something with that data, you're going to be much happier with a relational db.
-Dan
Re:Good For Interchange / Bad For Applications (Score:3, Interesting)
This is why XML serves best as an interchange format, where files are immutable snapshots of more complex data sets. Perfect for EDI-type apps or reports, but not for "live" data.
I know from experience with MCAD files (Pro/E, etc.) that static snapshot-type files are much easier to generate and work with than "live" files (files that are modified, stored, modified again, stored, ad nauseum). This is because data that changes over time has to st
XML only sucks if you apply it where XML sucks... (Score:3, Insightful)
I work for a publishing services firm that is focusing on XML-based production of print and online materials, ranging from books to scientific journals to grade-school testing applications.
Simply put, XML is the best tool available for storing content to be databased, searched, rendered in multiple formats and broken apart and reconstituted into custom documents. XML also lends itself nicely to the representation of complex mathematics using MathML. Because of this, we've based many of our production processes on XML.
One particular journal we produce is a heavily mathematical, 250 page weekly scientific journal. This journal is produced in both print and online forms, as well as being databased by the publisher. Using tools such as Arbortext Epic (www.arbortext.com [arbortext.com]) for content editing and Advent 3B2 (www.advent3b2.com [advent3b2.com]) for semi-unattended formatting we are able to produce the journal with a staff of only 10 people. A year ago, it took twice as many people and the end product was not nearly as flexible. In this application, XML rocks.
However, using XML in every application imaginable without considering whether or not it's the appropriate tool can be quite foolish. A hammer is great for pounding on things, but is pretty worthless in nearly every other application. A lot of the frustration felt by coders implementing XML solutions is due to the fact that it may not be the best tool for the job.
Why XML is a language (Score:3, Informative)
A language is the set of all ways a grammar allows symbols to be combined.
(of course, a grammar is a set of rules on how to combine symbols.)
Under the formal definition, XML is indeed a language. It is not a language useful for defining algorithms, admittedly.
Can we stop with this "XML is not a language" now?
XML is undeniably a good thing. (Score:3, Insightful)
Then, it's also as easy on the software side to reflect those changes. The fashionable arguments people use against it (why is it so fashionable to bash anything that happens to be a buzzword?) are non sequiturs in terms of what XML is intended for.
I use it, hell I probably overuse it. It's so damn easy to parse that I don't want to waste time building a custom format just to save that extra 1K of space or 1/100th of a second.
XML Sucks (Score:3, Insightful)
I could care less whether "<", "(", "{" or any other character begins a tag. The structure of
beats by a mile.Data should be stored in a way that is easy to parse and unambiguous to design. XML would have been better designed with a way to represent pointers (e.g. LET/LETREC) than the silly attributes and other syntactic nonsense.
-m
XML is Verbose...compresses beautifully-- NOT!! (Score:5, Informative)
But bureaucrats being what they are (and bureaucrats being in charge of environmental agencies), they've been told that XML is a GOOD THING, and want to force everything into that mold. And it doesn't fit!
Call it the "law of the instrument," as someone (Poul Anderson, I think, put it:
That's XML, to a tee!XML is great (Score:3, Interesting)
My company makes apps for the military. These type of apps make heavy use of binary messages exchanged over a network. Up until now, there were numerous errors in the specification, different type systems and other problems between departments. With XML, we managed to do the following:
1) make a standard for expressing messages. Since messages are tree structures (struct embedded in struct etc), XML is ideal for it.
2) made a tool to write messages and group them according to context. Now specification docs can be automatically produced by the tool and handed over to subcontractors, whereas previously they were written by hand, contained many errors and had different styles. Now all these problems are gone, changes are documented and saved in the configuration and versioning/control system, messages are automatically versioned and the whole procedure is automated to the point that it takes a few clicks to modify a message and produce a new specification.
3) made tools which can prepare scenarios for testing these messages automatically. This saved us a lot work!!! it is quite a big amount to test every field of every struct of each message from the up to 10000 message a combat system has (and each message can contain hundrends of numeric fields)!!! thanks to XML, each field's bit width, range, default value, minimum and maximum value and enumeration is known beforehand from the XML data produced for the specification, so by using XSLT messages are automatically converted to C, C++, ADA and Java code along with the relevant code to send, receive and validate each message.
One of the true benefits of XML is that data are not tied to a specific application. For my company, it has saved us a lot of work, because there is no need to bloat one app with all the functionality, we can make several separate tools which do one job only and operate on those XML data.
Re:XML! (Score:2)
Slight clarification (Score:2)
Oh, you'll be able to read (parse) it... you just won't be able to understand what it means once parsed!!