XML is quite common nowadays, especially in the application integration business that I am involved in. However, I still see companies making big mistakes when they decide to start using XML (for example as the exchange format with their business partners). This series of posts is about mistakes (or at least clumsiness) in using XML that I noticed during several projects.
Not making (useful) use of namespaces
As blogged before I had situations where I received XML files to describe the interface file without a schema (XSD). In this situation I did receive a schema, actually several schemas. Unfortunately, they forgot (?) to make use of XML namespaces. In each different XSD they added a description of the same xml type ‘OrderType’. You can imagine the rework you have if you have to change this ‘OrderType’; they have to modify all XSD’s and we had to regenerate all our JAXB objects. It would be much better if they supplied a separate XSD for the order element, gave it a namespace and import that in the other schemas. Another big advantage of using namespace is the possibility to distinct different versions of the same schema. I will clarify this issue in the next post.