When Good XML Goes Bad

by Nick Monday, June 02, 2008 11:42 AM

Coding Horror recently went after XML as being a rather poor option for many things.  I generally don't agree with that sentiment, but I do agree with the idea that there is good XML structure and bad.  Here is an example of bad XML structure that is required to use a control library from Janus.  This sample XML snippet is required to define the columns in their grid control:

<Columns Collection="true">
  <Column0 ID="">
    <Caption>Home Term</Caption>
    <EditType>NoEdit</EditType>
    <Position>0</Position>
    <Width>73</Width>
  </Column0>
  <Column1 ID="Column1">
    <Caption>Driver</Caption>
    <EditType>NoEdit</EditType>
    <Key>Column1</Key>
    <Position>1</Position>
  </Column1>
  <!-- ... -->
</Columns>
The controls so far look rather nice, and fairly functional and complete.  At issue here is the use of tag names like "Column0" and "Column1".  A well designed XML structure would just have "Column" tags, and then use some sort of extra identifier... which ironically... they already do!  Yet they require that the tag name matches the identifier.  Definitely not a good use of XML's inherent structure and definition abilities.
Comments are closed

About Me

Nick Schweitzer Nick Schweitzer
Wauwatosa, WI

Contact Me
I'm a Software Consultant in the Milwaukee area. Among various geeky pursuits, I'm also an amateur triathlete, and enjoy rock climbing. I also like to think I'm a political pundit. ... Full Bio

Community Involvement

Twitter

Archives

Flickr Photos

www.flickr.com
This is a Flickr badge showing public photos and videos from Nick_Schweitzer. Make your own badge here.

Standard Disclaimers

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2012 Nick Schweitzer