1) I realize namespaces are a means of differentiating between different schemas/vocabularies specified using XML Schema, but I don’t understand why it’s a good idea that a namespace ( for which the schema is developing a vocabulary ) is specified within the schema itself ( via targetNamespace
attribute ).
a) Wouldn’t it be better if we were able to instead associate particular namespace with particular vocabulary/schema within instance documents? That way those writing instance documents would have a complete freedom to associate a schema with whichever namespace name they’d desire?!
b) Only benefit I see in the schema specifying a target namespace is that its creators have an option to put a document at the end of namespace that can describe the elements of that namespace ( assuming schema uses URL for a namespace ). Are there also other benefits?
2) If a schema has no targetNamespace
, you must refer ( within instance document ) to the particular schema using the noNamespaceSchemaLocation
attribute instead of schemaLocation
attribute.
Wouldn’t it be simpler if instead document instance would just specify the location of the schema and let the XML Schema validator figure out whether or not schema specifies a targetNamespace
?
thank you