XML standards - personal suggestions

  • September 3, 2010
  • James Skemp
  • article

As I prepare to create another XML data file, I started looking at the standards I use to create XML files, and what the recommendations are.

Elements

In the past I've used camel case, but on a recent file used Pascal case instead. I think this was more becauase I've started to using Pascal case for public items (variables), and camel case for private items, as that's fairly standard in development.

I generally stay away from underscores, as camel and Pascal case are both perfectly readable, in my opinion.

Hyphens seem to be generally frowned upon, due to various language restrictions.

Suggestion: camel case.

XSD

The other question was versioning of XSD (or DTD) files. According to the 2004 article Best practices for Web services versioning, the W3C recommends the company name, a date stamp (year and month), but IBM recommends (in the article) including the day as well.

I've been slowly moving these documents over to my media.jamesrskemp.com domain, under either a xsd or dtd folder. Looking at the W3C listing of Recommended Doctype Declarations to use in your Web document, this doesn't seem to be all that horrible, realizing of course that the are DTD references and not XSD (true XML) references.

Another alternative would be xsd.jamesrskemp.com/date/file.xsd and dtd.jamesrskemp.com/date/file.dtd, but this is basically the same as using a sub-directory before (although it does simplify things).

Suggestion: http://whatever/YYYY/MM/DD/file.ext, with all older items staying where they are.