XSchema Spec, Section 3, Draft 1 (Namespaces)
Simon St.Laurent
SimonStL at classic.msn.com
Mon Jun 29 21:28:45 BST 1998
Section 3 of the XSchema Specification follows. Note that there are a
considerable number of questions raised. One guy with a whiteboard can only
make so many connections.
As always, a prettier HTML version of this will be posted shortly at
http://purl.oclc.org/NET/xschema.
Simon St.Laurent
Dynamic HTML: A Primer / XML: A Primer / Cookies
3.0 XSchema and Namespaces
XSchema uses namespaces for its own operations and also supports schemas that
take advantage of namespace facilities. XSchema processors are responsible
only for elements that use the XSchema namespace appropriate to the version of
XSchema they are processing. (This namespace is identified with the prefix
XSC: throughout this document; see 3.3 below for alternatives.) Information
in other namespaces may be passed to other applications as the processor deems
appropriate.
Please note: the information in this section is based on the 18 May 1998
"Namespaces in XML" Working Draft and is subject to change if needed to
maintain conformance with that specification.
3.1 The XSchema Namespace
XSchemas created using XSchema 1.0 should include the following namespace
declaration after the XML prolog but before the appearance of DTD information
and the XSC:XSchema element. This namespace declaration identifies elements
prefixed with XSC: as elements that should be processed by an XSchema
processor and also identifies the version number of the XSchema specification
used.
<?xml:namespace ns="http://www.purl.org/NET/XSchema/v1" prefix="XSC"?>
This declaration is required. XSchema processors must always check for this
declaration to properly recognize the prefix that will identify XSchema
elements.
3.2 Interaction with Other Namespaces
XSchemas will often support document sets that have their own namespaces.
Because prefixes may change from document to document, and to provide the
simplest possible solution, XSchema provides a mechanism for declaring
namespaces within XSchemas. This allows documents and the XSchemas used to
verify them to track the same namespace using different prefixes if necessary.
<!ELEMENT XSC:Namespace (Doc?)>
<!ATTLIST XSC:Namespace
prefix CDATA #REQUIRED
ns CDATA #REQUIRED
src CDATA #IMPLIED>
The XSC:Namespace element and its contents very similar to the
<?xml:namespace?> processing instruction. The attributes of the XSC:Namespace
element correspond to the prefix, ns, and src productions in the Namespaces
Working Draft. The ns attribute for the namespace element is the most
important part, containing a unique identifier that will be used to link the
elements declared in an XSchema to their counterparts in the document. The ns
attribute will contain a URI, typically a URL. (Note that #-separated
identifiers are prohibited in the namespaces draft.) The src attribute can
supplement the ns attribute if the unique identifier provided is not a URL but
needs (perhaps) to be retrieved. The prefix attribute provides an identifier
prefix that will be used throughout the XSchema to identify elements belonging
to this particular namespace.
The ns attribute contains the key value that will be used to map XSchema
element declarations to elements instance appearing in documents. So long as
the ns attributes underlying the (possibly different) prefixes used in the
XSchema and the document are the same, the mapping should work correctly. If
namespaces are used which have different ns names, the mapping will be broken
and the processor should report errors.
*** - Should namespaces be forced to appear at the beginning of the XSchema
document, as they are required to appear before DTDs?
*** - Should namespace declarations in a parent XSC:XSchema element hold in
XSC:XSchema subelements, or should they start over?
3.3 Note Regarding Namespace Usage
Namespaces are still in development at this time, and as such are subject to
dramatic change.
This specification was written making several assumptions, which may or may
not prove to be true as the Namespaces draft evolves:
1. The only part of a namespace declaration that genuinely identifies the
namespace is the ns production. The src is for additional information, and
the prefix only serves as a proxy for the full ns production. This has
several implications, the simplest of which allows developers to create
XSchemas using prefixes other than XSC by specifying a different prefix in the
namespace declaration described in Section 3.1.
2. The URLs in a namespace declaration will not need to be retrieved. The
XSchema namespace declaration uses a PURL (permanent URL) provided by the
OCLC. (For details on PURLs, visit http://purl.org.) PURLs use redirection to
maintain a permanent address for sites that may change address. While XSchema
specification information may be stored at the location to which the PURL
server redirects visitors, XSchema applications should not rely on any of that
information being there.
xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)
More information about the Xml-dev
mailing list