XML Bad Practices
Hard to Memorise Names
Good language design should make it harder for people to make mistakes. One of the most basic part of that is using regular, easy to remember identifiers so as to avoid typos.
With that in mind, something in the following non-exhaustive list should strike one as wrong:
- http://www.w3.org/1999/xlink
- http://www.w3.org/2000/svg
- http://www.w3.org/1999/xhtml
- http://www.w3.org/2002/xforms
- http://www.w3.org/2001/xml-events
- http://www.w3.org/1999/02/22-rdf-syntax-ns#
- http://www.w3.org/2000/01/rdf-schema#
- http://www.w3.org/2002/07/owl#
- http://www.w3.org/2001/XMLSchema
- http://www.w3.org/2001/XMLSchema-instance
- http://www.w3.org/1998/Math/MathML
- http://www.w3.org/1999/XSL/Transform
- http://www.w3.org/1999/XSL/Format
- http://www.w3.org/2003/05/soap-encoding
- http://www.w3.org/2003/05/soap-envelope
- http://www.w3.org/2003/06/wsdl
W3C is an easy target in this area, but they are by no means alone:
- http://schemas.microsoft.com/winfx/2006/xaml/presentation
- http://schemas.microsoft.com/client/2007
- http://schemas.microsoft.com/office/word/2003/wordml
- and many, many more…
There are arguments in favour of impossible to remember namespace URIs, but
as anyone who's had to produce an XSLT style sheet outputting XHTML, SVG,
XLink, XML Events, and MathML can attest these arguments are not grounded in
pragmatic reality. They are too easy to get wrong, and
— in part due to broken tools — lead to bugs that are sometimes difficult for
users to uncover. Thankfully, the W3C is now on a more mnemonic namespace
assignment policy rooted at http://www.w3.org/ns/*
.