Usually tutorials tell you to use your own domain name when making a new XML namespace. Not everybody owns a domain, it costs money, and the site might be unrelated to the purpose that you are using the XML for.
What is a good alternative?
In this answer, the example just has some_identifier
, however Wikipedia says it is a URI. URIs can be URLs or URNs.
URLs can provide a link to the schema, however the primary purpose of the namespace is to be a unique identifier, so a URN fits better.
How do you generate a unique identifier? UUIDs are good for identifiers, so I searched and there is even an example on W3C:
<?xml:namespace ns='urn:uuid:C4ED1820-6207-11d1-A29F-00AA00C14882/'
src='http://www.w3.org' prefix='w3c' ?>
Why don't people use UUIDs more often? What are the disadvantages of UUID namespace or advantages of a domain-based namespace? If your domain expires you might lose it and have to change all your namespaces.