Article

XML schemas—we’re not all on the same page

On a project, don’t expect that just because you you are working to the same end, you will all be thinking the same way, with the same end goals.

A recent discussion on xml schemas served to remind me of this.

We were setting up standards for the passing of data as xml between two companies.

There was some initial agreement. We would use schemas, and if the xml failed the schema validation it wouldn’t get sent. But that was about it.

One party wanted the schemas to be as loose as possible. He wanted everything typed as extra-long strings, so that it never failed validation at all. He wanted the code at the recieving end to pick up any problems.

Another party wanted dates more specific, so that dates prior to the go-live date could never be sent.

Still another party wanted the xsd to be future proof. For example, each file has its own unique ID. We set this to a maximum of six characters—but what happens when we send the millionth file? (Given that we were only sending this file once a week, I suspect the software will be well and truly obsolete by that time. Not to mention that the schema would be the least of our worries. If the length was written into the schema it would also have been written into the code as well, and that’s where our most serious problems will be—in the code.)

Then you have the technical dreamers, who get sidetracked by technicalities. The xsd date standard is YYYY-MM-DD, or you can create your own data type if you wish. Not these people. They get carried away with a technical discussion on the relative merits of why W3C chose that particular standard when, say, YYYYMMDD would have been better.

We persevered. We got a standard, and it’s been pretty robust so far, coping with all the idiosyncracies people have thrown at it. The xml that’s coming from the various supplies looks consistent, and feels consistent. That’s all you can really ask from an effective standard, I think.

Comments (No comments)

There are no comments for this post so far.

Post a comment