April 28, 2013

How to Develop XML Documents

I recently had some issues with XML holding data. Lots of repeated data, and large object models caused a little bit of an issue creating these by hand. So how should you go about using XML?

I found an interesting article on the definitions of XML document types: http://www.rpbourret.com/xml/XMLAndDatabases.htm. The article pointed out 2 xml types, Data and Document.

Data-centric xml, is more machine processed and used for transportation of data between systems. This is not generated/read by humans, like rss feeds, and instead read into other systems for processing. On the other hand, document-centric xml is processed more like html. The mark-up is described and manipulated by humans to do work. While the article goes on to describe how to integrate these types of xml documents into an xml-centric database, I got a good sense of how to describe and organize xml that was causing me grief.

I think most of the issues I have had with XML recently is that I am looking at data-centric xml and hand editing it. If I was to do any hand-editing, I should describe something a bit looser like HTML, or build a system that generates the XML.

\*UPDATE\* 5/9/2013

So, at work we figured out our issue with XML. We ended up adding another layer of abstraction, so that we could specify the repeated data in a variable and we use a utility to generate the xml files for each environment. Just goes to show, sit down with everyone and you will find a solution to a shitty situation.