Today's Code Snippet comes from Rob O. Rob was working in a company (as a contractor) on different projects for almost a year before he was asked to sit in on a meeting with two vendors and two business analysts. Rob failed to notice during the discussion one of the third parties furiously writing notes every time they were asked about XML.

They had not gotten very far with the technical details of the project, but the business analysts knew what they wanted. Buzz-word compliance. The buzz-word: XML.

When Rob was not being ignored like a third-grade class-president (I have no idea what that means) he was being asked if his system would be able to handle sending and receiving the various files and messages as XML which, of course, it could.

What Rob failed to notice during the discussion was how one of the third parties was furiously writing notes every time they were asked about XML. "Yes," they would reply with an enthusiastic nod, "Our system will handle XML."

Many months passed, and then one bright Autumn day, Rob was given the specification and began working. After discovering the technical documentation was severely lacking, he requested an example file. Here is that file.

<?xml version="1.0" encoding="iso8859-1" ?>

<import tag="1stTEST" type="data" mode="update">

<options>

<dateformat mmddyyyy="true"/>

<notification>

<EMail>example@example.com</EMail>

</notification>

</options>

<fields>

<field name="name" type="char" mapsto="person.data"/>

<field name="officeid" type="char" mapsto="custom.locationid"/>

<field name="startyear" type="char" mapsto="person.yearstarted"/>

<field name="personelid" type="int" mapsto="person.id"/>

<field name="dob" type="date" mapsto="person.dateofbith"/>

<field name="sex" type="char" mapsto="person.sex"/>

<field name="modified" type="date" mapsto="record.modified"/>

</fields>

<csvdata columnheaders="false">

<![CDATA[

"Jack Wade",214,2002,111012,07/04/1975,"M",02/11/2006

"Sam Davidson",214,1999,104841,10/15/1967,"M",02/10/2006

"Denise V Law",214,1998,104660,01/21/1971,"F",02/17/2006

"Lisa Blake",214,1989,100987,08/01/1982,"F",01/21/2006

"Andrew Match",214,1991,101074,12/25/1980,"M",02/28/2006

]]>

</csvdata>

</import>



Follow up emails were sent, but no, this was the exact and only format that would be accepted by their system.

A perfectly legal XML document, Buzz word compliance accomplished!