views:

35

answers:

2

Do you use a naming convention for your XML namespaces? And if so, what reasoning lies behind it.

I was actually amazed that hardly anyone wrote about a naming convention for XML namespaces.

Most namespaces I've seen have the format of http://example.org/<some identifier> or http://example.org/scheme/<some identifier>. But that really lacks structuring beyond the initial "company" identifier.

+2  A: 

Namespaces are simply aliases and the only real requirement is for them to be uniquely identifying.

Mostly I have seen:

http://&lt;company name>/<product name>/<version>

Or variations of this.

Oded
+2  A: 

Some companies organize the path of the namespace according to organization boundaries (business units), some according to functional taxonomies (products, technologies, topics).

Building the namespace path along org lines makes it clear who controls items in that area of the namespace, but can become outdated or just plain wrong as companies reorg over time.

Building the namespace path according to topic boundaries requires someone to be the gatekeeper to prevent conflicting uses of a common term in a namespace path. Topic based paths tend to be more stable than org paths.

It's also probably not a bad idea to incorporate a year of definition at the root of your namespace path. That will give you a clean branching off point for future work without muddling previous namespace definitions.

dthorpe