A Namespace is a unique string prefix to every named object in a schema. The string is made unique by incorporating the domain name of the the organization that created the vocabulary.
In the MISMO schema you will see that the namespace string is " http://www.mismo.org/residential/2009/schemas". This namespace is in the form of a URL. Typically there is no page at this location. In a namespace the string is used as a URI.
The root schema will use the MISMO namespace twice:
- xmlns="http://www.mismo.org/residential/2009/schemas" -- Marks everything inside the schema as belonging to the MISMO namespace
- targetNamespace="http://www.mismo.org/residential/2009/schemas" -- A way for the schema to signal to outside schema or systems what namespace this schema is defining.
There is also the need to tell the schema where to find the files for other namespaces, as in <xsd:import namespace="http://www.w3.org/1999/xlink" schemaLocation="xlink.xsd"/>
These xsd:import and xsd:include point to other schema files. Those files may in turn have xsd:import and xsd:include pointing to still other files.
There is an inconsistent implementation of how different platforms treat the xsd:import found in child schema files. Some implementation the namespace resolver gets lost. The cause for the difference is in a vague description in the W3C XML Schema specifications. Different organizations interpreted it differently.
Therefore, the best practice is to also place the xsd:import in root schema file as well as in the places where it is actually used. This technique gives the namespace file resolver a heads up about what is coming. When it gets to the xsd:import in the child file it notices that it already has that definition set and moves on.
Hi Greg, I just sent an email to info@mismo.org, and I hope it finds its way to you. I'm very interested in MISMO and found your blog by searching around.
ReplyDelete