I only read the first few posts, but I thought I'd chime in my experience using xml.
A long time ago I built an online job application system, that soon grew to have all kinds of requirements that the client desired. They wanted to display the job application in pdf to print out for interviews. They wanted to import applications into some propietary medical database (it was a hospital). Finally, they also expressed a desire to perhaps be able to import the data to a different system in the future. Internally, I also desired maximum reuse.
When I began refactoring with these objectives, XML as the data format became a strong candidate. I used XSL-FO to transform the xml to a pdf. I used XSLT for templating and this fit nicely with keeping the application in an XML data format. Also, the fact the data is in xml allows future developers to do whatever they want with it. I never got around to importing the data into their propietary medical system, but a general idea that was brainstormed would be to use SOAP to send the application data to the server and somehow import it from there.
With XSL, you can transform xml into anything you want really, heck you could even transform it to office xml to view, say, as a word document. Now people have stated they prefer csv over xml, but I would like someone to explain to me how they handled nested data that is heirarchical in nature as csv?
I mean it's easy to scream why do this:
Code:
<id>2</id>
<name>James</name>
<whatever>blah</whatever>
when you could just do this:
Code:
id,name,whatever
2,James,blah
That is convenient, and in fact it may be better to use route two. But my system required data like this:
Code:
<application id="0002123">
<metadata>
<submitDate>2005-03-02</submitDate>
<recruiter>
... recruiter data ...
</recruiter>
</metadata>
<personalInformation>
... personal info ...
</personalInformation>
<employmentHistory>
<employmentRecord id="21">
<employer>
<name>Evil, Inc.</name>
<address>
<street />
<city />
<zip />
</address>
<supervisor />
</employer>
<startDate />
<endDate />
<leaveReason />
</employmentRecord>
</employmentHistory>
</application>
Although that is a very quick write up off the top of my head, the actual xml is quite complex at times... sending this data as possibly hundreds of csv snippets seems rather redundant, doesn't it?
Bookmarks