I'm looking for some ideas for good naming conventions for xsd target namespaces.
Basically I just need to make a definite decision on how to name the target namespace of my xsd so I try to get it right the first time. Changing it later would require changes to another system which is not in my control.
Do you have any experience from past XML schema creations on what is a good and working solution? I've tried to find information online, but most examples just use very generic target namespaces like "http://exampleSchema" and similar. I'm actually trying to find some real life examples.
A namespace name is a uniform resource identifier (URI). Typically, the URI chosen for the namespace of a given XML vocabulary describes a resource under the control of the author or organization defining the vocabulary, such as a URL for the author's Web server.
What Is an XML Namespace? An XML namespace is a collection of names that can be used as element or attribute names in an XML document. The namespace qualifies element names uniquely on the Web in order to avoid conflicts between elements with the same name.
The prefix xmlns is used only to declare namespace bindings and is by definition bound to the namespace name http://www.w3.org/2000/xmlns/ . It MUST NOT be declared or undeclared. Other prefixes MUST NOT be bound to this namespace name.
When you use multiple namespaces in an XML document, you can define one namespace as the default namespace to create a cleaner looking document. The default namespace is declared in the root element and applies to all unqualified elements in the document. Default namespaces apply to elements only, not to attributes.
W3C's own practices for long-lived URI selection are a pretty good baseline for XML namespace URIs. See Cool URIs don't change for some suggestions, with the exception that a namespace URI need not be retrievable and so some of those guidelines may not apply.
XSLT uses the following:
http://www.w3.org/1999/XSL/Transform
This fits the pattern above. Owner identifier, date, and name; and no versioning component because versioning is handled within the XSLT vocabulary.
In a pinch, you can even get away with
mailto:[email protected]?Subject=2008+XML+Basketweaving+specification
which fits the pattern as well but suggests a point of contact instead of an information repository.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With