Are You an XML Bozo?


#1

Here's a helpful article that documents some common pitfalls to avoid when composing XML documents. Nobody wants to be called an XML Bozo by Tim Bray, the co-editor of the XML specification, right?


This is a companion discussion topic for the original blog entry at: http://www.codinghorror.com/blog/2006/07/are-you-an-xml-bozo.html

#2

I only have occasional need to deal with XML at present so might well be an unwitting Bozo. But many of these rules expressed as Don’ts leave questions begging. For example, #5 if you don’t use an XML parser what do you use?


#3

I on the other hand love xslt :). I’ve yet to run into a problem that requires an impractical solution. And with grouping, regexp and all the goodies of xpath 2.0 it’s even easier to use.
I have rule nr. 1 taped on the wall behind my desk. Whenever someone comes in with an xml-related issue I simply point to the poster. This is usually all it takes :).


#4

Talking of bozos, #17: Can we find the person who came up with the term “astral plane” and beat them to death with their own dungeons and dragons books? Please?


#5

If you need that many rules to get your document format right, you might want to think about a different format.


#6

XSLT haha!

When I first joined this organisation that used an XML database called Tamino that then used XSL files to create webpages, along with the help of some Java.

The whole system was massive, complex and bloody slow.

I re-developed the whole thing using SQL Server 2000 and asp.net pages. It uses a fraction of the size, runs much faster and its very easy to make changes, unlike the XSL system :yuck:


#7

Jeff, it should be noted that using XSLT will (prettymuch) guarantee that your output will be conformant to all of those rules for generating XML.

So although on one hand you say “XSLT is insane”, on the other hand this entire post seems to be an argument in favour of it.


#8

I would like to add a question to that list - Does this problem really require XML ? (Think Ant).


#9

Here’s a good list of things to consider when writing XML:

a href="http://recycledknowledge.blogspot.com/2006/03/writing-out-xml.html"http://recycledknowledge.blogspot.com/2006/03/writing-out-xml.html/a

And when converting HTML to XHTML

a href="http://recycledknowledge.blogspot.com/2006/03/how-to-write-xhtml-even-if-you-dont.html"http://recycledknowledge.blogspot.com/2006/03/how-to-write-xhtml-even-if-you-dont.html/a


#10

you obviously are not a good xslt programmer.


#11

I would like to add a question to that list - Does this problem really require XML
http://biglider.ru/


#12

And of course he recommends… the serializer/XmlWriter! Yes, let’s all write at least 3 lines of code for every element, more if there are attributes!

I don’t have a problem with XML, but the notion that it’s perfectly okay to expect developers to write 500 lines of code comprising 46 routines and 13 classes just to spawn a single document sounds characteristic of an Architecture Astronaut.

Maybe text-based templates aren’t the answer either, but you can use a single routine to escape a full XML string without the ridiculous overhead of a “writer”. IMO, in order for XML to really be productive for developers, the dev tools either have to serialize it automatically (.NET Web Services), or allow it to be written “natively” (Ruby / XLinq). Without simplified support, I’d have to ask if the same problem could be solved with plain-text/CSV or an RDBMS.


#13

Liquid XML Studio is a free XML Editor and graphical schema editor for windows, it provides ‘Well Formed’ checking and validation against external XML Schemas. It also has an XSLT editor which can execute the transform and show the results.
http://www.liquid-technologies.com/XmlStudio/Free-Xml-Editor.aspx


#14

“XML: The Angle Bracket Tax” should be a link pointing to

https://blog.codinghorror.com/xml-the-angle-bracket-tax/