Table of contentsAppendices |
5 Using Qualified NamesUsing Qualified NamesIn XML documents conforming to this specification, element names are given as [qualified names] , as follows: Element Names
An example of a qualified name serving as an element name: <!-- the 'price' element's namespace is http://ecommerce.example.org/schema --> <edi:price xmlns:edi='http://ecommerce.example.org/schema' units='Euro'>32.18</edi:price> Attributes are either [namespace declarations] or their names are given as [qualified names] : Attribute
An example of a qualified name serving as an attribute name: <x xmlns:edi='http://ecommerce.example.org/schema'> <!-- the 'taxClass' attribute's namespace is http://ecommerce.example.org/schema --> <lineItem edi:taxClass="exempt">Baby food</lineItem> </x>Prefix Declared The namespace prefix, unless it is This constraint 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. Such declarations may not be read by software which is based on a non-validating XML processor. Many XML applications, presumably including namespace-sensitive ones, fail to require validating processors. If correct operation with such applications is required, namespace declarations MUST be provided either directly or via default attributes declared in the internal subset of the DTD. Element names and attribute names are also given as qualified names when they appear in declarations in the DTD: Qualified Names in Declarations
add
Note that DTD-based validation is not namespace-aware in the following
sense: a DTD constrains the elements and attributes that may appear in
a document by their uninterpreted names, not by (namespace name, local
name) pairs. To validate a document that uses namespaces against a
DTD, the same prefixes must be used in the DTD as in the instance.
A DTD may however indirectly constrain the namespaces used in a valid
document by providing |