Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...


The recommended use of prefixes and namespaces is that these entities should be declared on the first element of that namespace. This prevents "operational diffiulties", 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.

<OAI-PMH
xmlns="http://www.openarchives.org/OAI/2.0/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="

http://www.openarchives.org/OAI/2.0/Image Added


http://www.openarchives.org/OAI/2.0/OAI-PMH.xsdImage Added

"
>
<...>
<metadata>
<didl:DIDL
xmlns:didl="urn:mpeg:mpeg21:2002:02-DIDL-NS"
xmlns:dii="urn:mpeg:mpeg21:2002:01-DII-NS"
xmlns:dcterms="http://purl.org/dc/terms/"
xsi:schemaLocation="
urn:mpeg:mpeg21:2002:02-DIDL-NS

http://standards.iso.org/.../didl.xsdImage Added


urn:mpeg:mpeg21:2002:01-DII-NS

http://standards.iso.org/.../dii.xsdImage Added

"
>
<...>
</didl:DIDL>
</metadata>
</...>
<OAI-PMH>

Wiki Markup
\\
*According to the proclamation in the same document (\[*http://www.w3.org/TR/REC-xml-names/#ns-using*|http://www.w3.org/TR/REC-xml-names/#ns-using]), the DARE agreement will be that it is also possible to declare prefixes and namespaces in the ancestors of the document.\*

"

Anchor
nsc-NSDeclared
nsc-NSDeclared
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 , but not recommended uses of prefixes and namespaces.

<OAI-PMH
xmlns="http://www.openarchives.org/OAI/2.0/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:didl="urn:mpeg:mpeg21:2002:02-DIDL-NS"
xmlns:dii="urn:mpeg:mpeg21:2002:01-DII-NS"
xmlns:dcterms="http://purl.org/dc/terms/"
xsi:schemaLocation="
http://www.openarchives.org/OAI/2.0/
http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd
urn:mpeg:mpeg21:2002:02-DIDL-NS

http://standards.iso.org/.../didl.xsdImage Added


urn:mpeg:mpeg21:2002:01-DII-NS

http://standards.iso.org/.../dii.xsdImage Added

"
>
<...>
<metadata>
<didl:DIDL>
<...>
</didl:DIDL>
</metadata>
</...>
<OAI-PMH>

...