namespace declarations - the declarations of the namespaces used within the metadata part, each of which is prefixed with xmlns. Namespace declarations within the metadata part fall into two categories:
- metadata format specific namespace(s) - every metadata part must include one or more xmlns prefixed attributes that define the correspondence between a metadata format prefix - e.g. didl - and the namespace URI (as defined by the XML namespace specification ) of the respective metadata format. Some metadata formats employ tags from multiple namespaces, requiring multiple xmlns prefixed attributes - in the example below under 'XML validation', there are declarations for both oai_dc and dc.
- xml schema namespace - every metadata part must include the attribute xmlns:xsi, the value of which must always be the URI shown in the example, which is the namespace URI for XML schema.
- xsi:schemaLocation - the value of which is a "URI, URL" pair; the first is the namespace URI (as defined by the XML namespace specification) of the metadata that follows in this part, and the second is the URL of the XML schema for validation of the metadata that follows.
The recommended use of prefixes and namespaces is that these entities should be declared on the first element of that namespace. This prevents "operational difficulties", as described in http://www.w3.org/TR/REC-xml-names/#ns-using .
"Using prefixes may lead to operational difficulties in the case where the namespace declaration attribute is provided, not directly in the XML document entity, but via a default attribute declared in an external entity."
Example of the recommended use of prefixes and namespaces.
Another argument is that for example a DIDL document is considered an autonomous entity that can exist outside a OAI record. When making a snippet from this DIDL document it should be valid according to a XML validator on its own. Thus does not need any namespace declaration texts that was left in the OAI-PMH xml.
According to the proclamation in the same document
(http://www.w3.org/TR/REC-xml-names/#ns-using), the DRIVER agreement will be that it is also possible to declare prefixes and namespaces in the ancestors of the document.
"The namespace prefix, unless it is xml or xmlns, MUST have been declared in a namespace declaration attribute in either the start-tag of the element where the prefix is used or in an ancestor element (i.e. an element in whose content the prefixed markup occurs)."
Example of the optional uses of prefixes and namespaces.