XML Element or Attribute-Centric?

There are numerous articles on the web discussing the advantages and disadvantages of attribute-centric versus element-centric XML. Most correctly come to the conclusion that “it depends” and provide criteria that tend to weight the answer in one direction or the other.


My contribution to those criteria is this: If an element is logically similar to a database record, and may in fact have come from a database row, or may eventually be stored in a database row, use attribute-centric.

We know without looking at any schema that each attribute will at most once and maps to a column.


With element-centric data, we don’t as easily know whether an element that occurs once is just occurring once for this particular parent element or whether it may occur multiple times for some other parent.

While a schema will tell us that, using attribute-centric XML for record-like data makes its nature obvious and clear and, in my experience, easier to parse.

For learn how Acumen can help with your other IT needs, contact us today!