simont: A picture of me in 2016 (Default)
simont ([personal profile] simont) wrote2006-10-17 11:36 am

XML OF DEATH

If you're designing an XML representation of some type of data, and you want a key-value sort of organisation, this is inherently reasonably well supported by XML. If you want to set the key ‘foo’ to the value ‘bar’, you can simply set up your DTD so that it lets you write

<sometagorother foo=bar />

Now occasionally I can understand that you might want to layer your own key-value structure on top of this:

<set key="foo" value="bar" />

because this approach gives you the ability to add extra attributes alongside each key/value pair, which might be useful for all sorts of vaguely sensible reasons: expiry dates, permissions, conditionalisation, you name it. Also it doesn't require you to specify the full set of possible keys in the DTD, which is obviously useful.

However, when I see a third layer of key-value structure on top of even that …

<method name="SetVariable">
<arg key="name" value="foo" />
<arg key="value" value="bar" />
</method>

… I really do start to wonder whether someone's brain has been EATEN BY PARASITIC XML MEMES OF DEATH.

[identity profile] pjc50.livejournal.com 2006-10-17 02:21 pm (UTC)(link)
It could be worse. Our software has at least 7 different lex/yacc parsers in it for various file formats, most of which have slightly underspecced syntax and vastly underspecced semantics. XML would by comparison be a blessing: one, and only one parser, from which data can be extracted easily by OO code. The files would be huge, but the existing formats aren't all that great sizewise.