The Cover Pages [画像:The OASIS Cover Pages: The Online Resource for Markup Language Technologies]
SEARCH | ABOUT | INDEX | NEWS | CORE STANDARDS | TECHNOLOGY REPORTS | EVENTS | LIBRARY
Namespaces in XML

Contents

Summary

The purpose of an XML namespace is to allow the deployment of XML vocabularies (in which element and attribute names are defined) in a global environment and to reduce the risk of name collisions in a given document when vocabularies are combined. For example, the MathML and SVG specifications both define the set element. Although XML data from different formats such as MathML and SVG can be combined in a single document, in this case there could be ambiguity about which set element was intended. XML namespaces reduce the risk of name collisions by taking advantage of existing systems for allocating globally scoped names: the URI system. When using XML namespaces, each local name in an XML vocabulary is paired with a URI (called the namespace URI) to distinguish the local name from local names in other vocabularies. The use of URIs confers additional benefits. First, each URI/local name pair can be mapped to another URI, grounding the terms of the vocabulary in the Web. These terms may be important resources and thus it is appropriate to be able to associate URIs with them... Another benefit of using URIs to build XML namespaces is that the namespace URI can be used to identify an information resource that contains useful information, machine-usable and/or human-usable, about terms in the namespace. This type of information resource is called a namespace document. When a namespace URI owner provides a namespace document, it is authoritative for the namespace..." ["XML namespaces", Architecture of the World Wide Web, Volume One ]

"We envision applications of Extensible Markup Language (XML) where a single XML document may contain elements and attributes (here referred to as a "markup vocabulary") that are defined for and used by multiple software modules. One motivation for this is modularity: if such a markup vocabulary exists which is well-understood and for which there is useful software available, it is better to re-use this markup rather than re-invent it. Such documents, containing multiple markup vocabularies, pose problems of recognition and collision. Software modules need to be able to recognize the elements and attributes which they are designed to process, even in the face of "collisions" occurring when markup intended for some other software package uses the same element name or attribute name. These considerations require that document constructs should have names constructed so as to avoid clashes between names from different markup vocabularies. This specification describes a mechanism, XML namespaces, which accomplishes this by assigning expanded names to elements and attributes..." [Namespaces in XML 1.1]

"Namespaces, originally designed to provide names for XML elements and attributes, have been adopted much more broadly by the web community. They are now used not simply for elements and attributes but for function names, tokens, and identifiers for ever more purposes..." [The Disposition of Names in an XML Namespace]

The names in a namespace form a collection:

  • sometimes it is a collection of element names (DocBook and XHTML, for example)
  • sometimes it is a collection of attribute names (XLink, for example)
  • sometimes it is a collection of functions (XQuery 1.0 and XPath 2.0 Data Model)
  • sometimes it is a collection of properties (FOAF)
  • sometimes it is a collection of concepts (WordNet), and many other uses are likely to arise.

There's no requirement that the names in a namespace only identify items of a single type; elements and attributes can both come from the same namespace as could functions and concepts or any other homogeneous or heterogeneous collection you can imagine. The names in a namespace can, in theory at least, be defined to identify any thing or any number of things..." [Associating Resources with Namespaces]

Specification Publication Milestones

[August 06, 2009] "W3C Proposed Edited Recommendation: Namespaces in XML 1.0 (Third Edition)." By Tim Bray, Dave Hollander, Andrew Layman, Richard Tobin (et al), W3C Technical Report. Members of the W3C XML Core Working Group published the Third Edition of Namespaces in XML 1.0 as W3C Proposed Edited Recommendation. "XML Namespaces provide a simple method for qualifying element and attribute names used in Extensible Markup Language documents by associating them with namespaces identified by URI references. The Third Edition as proposed incorporates all outstanding errata." A colored diff-marked version highlights the changes (added text, changed text, deleted text). The review period is open until 14-September-2009. "There are several editorial changes, including a number of terminology changes and additions intended to produce greater consistency. The non-normative appendix "The Internal Structure of XML Namespaces" has been removed. The BNF has been adjusted to inter-connect properly with all editions of XML 1.0, including the fifth edition."

[August 16, 2006] Namespaces in XML 1.0 (Second Edition) . W3C Recommendation. 16-August-2006. Edited by Tim Bray (Textuality), Dave Hollander (Contivo, Inc.), Andrew Layman (Microsoft), Richard Tobin (University of Edinburgh and Markup Technology Ltd). See also Namespaces in XML 1.1 Requirements . With errata page and public archives for 'xml-names-editor@w3.org' list.

[February 2004] Namespaces in XML 1.1 . W3C Recommendation. 4-February-2004. Edited by Tim Bray (Textuality), Dave Hollander (Contivo, Inc), Andrew Layman (Microsoft), and Richard Tobin (University of Edinburgh and Markup Technology Ltd). See the news story "Extensible Markup Language (XML) Version 1.1 Published as a W3C Recommendation."

[April 11, 2002] W3C XML Core Working Group Publishes New Working Drafts for Namespaces in XML. The XML Core Working Group has produced two new working draft specifications on namespaces as part of the W3C XML Activity. Namespaces in XML 1.1 is the "first draft of a new 1.1 revision of the Namespaces in XML specification which will incorporate several errata to the 1.0 specification, and will make one substantive change: the provision of a mechanism to undeclare prefixes." Namespaces in XML 1.1 Requirements presents the requirements for the development of Namespaces in XML version 1.1. XML namespaces "provide a simple method for qualifying element and attribute names used in Extensible Markup Language documents by associating them with namespaces identified by URI references." The Requirements document clarifies that the Namespaces in XML 1.1 specification will apply only to XML version 1.1 documents; note that some examples in the WD mistakenly use version 1.0 identifier (<?xml version="1.0"?>) where "1.1" is intended. According to the WG's explanation, the Namespaces in XML 1.0 "has the ability to undeclare the default namespace, but doesn't provide a facility to undeclare namespaces with prefixes; an obvious syntax for such functionality would be an empty namespace attribute value (xmlns:prefix=""); this omission has had adverse consequences on infoset manipulations and serializers." Other specifications negatively affected by the V1.0 limitation include XML-Signature Syntax and Processing, SOAP Version 1.2 part 1: Messaging Framework, XML Inclusions (XInclude) 1.0, XQuery 1.0, and XPath 2.0 and XQuery 1.0 Data Model. [Full context]

[January 14, 1999] On January 14, 1999, the World Wide Web Consortium issued a press release announcing the publication of "Namespaces in XML" as a W3C Recommendation. References: REC-xml-names-19990114, World Wide Web Consortium 14-January-1999. The document editors include Tim Bray (Textuality), Dave Hollander (Hewlett-Packard Company), and Andrew Layman (Microsoft). XML namespaces "provide a simple method for qualifying element and attribute names used in Extensible Markup Language documents by associating them with namespaces identified by URI references. An XML namespace is a collection of names, identified by a URI reference (RFC2396), which are used in XML documents as element types and attribute names. The 'Namespaces in XML' specification resolves potential name clashes by using the Web addressing infrastructure. The new specification allows authors to mix two or more XML-based languages in one document without conflict or ambiguity, thus promoting the modular development and reuse of XML languages and applications. The modularity and simplicity of XML technology combined with namespaces paves the way for future developments, such as the work in progress in W3C's XML Schema Working Group, and data exchange based on W3C's Resource Description Framework (RDF) architecture."

[July 10, 1999] W3C Proposal for CSS Namespace Enhancements. The W3C has published a working draft document on CSS Namespace Enhancements which constitutes one document in a modular set of Working Drafts which will define the next level of CSS (Cascading Style Sheets). Reference: W3C Working Draft 25-June-1999; the editor is Peter Linss of Netscape Communications. The WD offers a "proposal for making CSS namespace-aware, such that styles can be applied to XML documents which use multiple namespaces, correctly selecting by the namespace used, regardless of the namespace prefix which happens to be used. The goal is to provide the ability for CSS selectors to operate effectively against XML documents that make use of XML namespaces. This document defines a new at-rule, additional selector modifiers, and a modification to the attr() value for the 'content' property. The following user/author needs are addressed: (1) Ability to specify type selectors that apply to element types within a given namespace. (2) Ability to specify attribute selectors that apply to attributes within a given namespace. (3) Ability to address attributes within a given namespace with the attr() function." And the rationale: "In XML namespaces, a namespace is identified solely by a URI reference. A prefix mechanism is defined to bind namespace URIs to XML names forming qualified names. Since namespace prefixes are defined within the XML document, and furthermore only apply to a limited scope within the document, the prefixes are not suitable for use outside the XML markup. Since a style sheet author can not, in general, know a priori which prefixes an XML author will map to a particular namespace, or to which namespace a particular prefix is bound in any given context, the stylesheet author must have some mechanism to identify namespaces by their URI." For CSS references, see "W3C Cascading Style Sheets".

[September 16, 1998] A W3C Working Draft "Namespaces in XML" was published on September 16, 1998. References: WD-xml-names-19980916, World Wide Web Consortium Working Draft 16-September-1998. The editors are Tim Bray (Textuality), Dave Hollander (Hewlett-Packard Company), and Andrew Layman (Microsoft). With the publication of this working draft, the Namespace specification entered its 'last call' for comments.

[August 03, 1998] The W3C released a new working draft of "Namespaces in XML." References: WD-xml-names-19980802, World Wide Web Consortium Working Draft 2-August-1998. Its editors are Tim Bray (Textuality), Dave Hollander (Hewlett-Packard Company), and Andrew Layman (Microsoft). The working draft is available in HTML and XML format. Abstract: "XML namespaces provide a simple method for qualifying names used in Extensible Markup Language documents by associating them with namespaces identified by URI." Document status: "This draft embodies a large-scale revision of the namespace specification. While it is unfinished in some respects, the Working Group intends to keep the features it describes functionally unchanged unless problems are discovered during early implementation work. To discover such problems as quickly as possible, a special editorial team has been formed to receive feedback from implementors during a one-month period beginning with the publication of the working draft and ending shortly after the XML Working Group meeting in Montreal August 22-23. Please send implementation experience reports to xml-names-issues@w3.org." Jon Bosak (W3C XML WG Chair) posted a related announcement; James Clark posted a recipe for implementation in Java ("it is really easy to implement").

[May 26, 1998] The World Wide Web Consortium (W3C) released a new version of the document "Namespaces in XML" as a Working Draft. References: WD-xml-names-19980518, World Wide Web Consortium Working Draft 18-May-1998. The authors are: Tim Bray (Textuality), Dave Hollander (Hewlett-Packard Company), and Andrew Layman (Microsoft). The XML Working Group expects that the namespace facility will "become an integral part of some future version of the XML specification." The XML namespaces design has two principal motivations for allowing XML names (e.g., element type names and attribute names) to be qualified by a domain or schema name: (1) the desire to provide a mechanism for distinguishing between multiple DTDs or schemas represented in a single XML document, and (2) the desire to provide hints about a domain or schema to search engines and other indexing tools. The XML namespace facility provides for universal names my using "qualified names" in markup: a qualified name contains "a single colon, separating the name into a namespace prefix and the local name. The prefix, which is mapped to a URI, selects a namespace. The combination of the universally managed URI namespace and the local namespace produces names that are guaranteed universally unique."

The first Working Draft of the W3C XML document Namespaces in XML was released on March 27, 1998. It was produced as part of the XML Activity, and was previously released in January as a W3C 'NOTE'. The document editors are: Tim Bray (XML co-editor, Textuality), Dave Hollander (Hewlett-Packard Company), and Andrew Layman (Microsoft). References: W3CWD-xml-names-19980327, World Wide Web Consortium Working Draft 27-March-1998. The namespaces draft "describes a simple method for qualifying certain names used in Extensible Markup Language documents by associating them with namespaces, identified by URI." In the simplest case, the namespace problem is undeniable and the proposed XML namespace solution is straight-forward (indirection being required by the RFC's lexical rules for URIs). Pieces of text containing XML markup which might be "cut and pasted" across domains without respect for the (implicit or explicit) source document schemas/DTDs could result in ambiguity as well as name collision. So: declarations in the form of XML processing instructions may be put into the prolog of an XML document, as exemplified in <?xml:namespace ns="http://iso-countries.iso.org/199804.html" prefix="cn9804" ?>, and the corresponding prefixes may be added to elements, attributes and processing instructions of the source document instance: (e.g.,) <cn9804:name>Boatia</cn9804:name>. In these cases, a processor would be able to make sense of an encoded name element such as "Boatia" by referring to the authority list stored in or referenced by the resource given as a namespace identifier, viz., 'http://iso-countries.iso.org/199804.html'. Users should observe the warnings in the working draft, as well as in the cautionary note from Jon Bosak, concerning the provisional status of the syntax. The draft states: "The XML Working Group will not allow early implementation to constrain their ability to make changes to this specification prior to final release." The XML Working Group anticipates that the namespace facility presented (provisionally) in this draft will be integrated into a future version of the XML specification.

W3C announced the availability of a NOTE on Namespaces in XML, as part of the W3C XML Activity. References: NOTE-xml-names-19980119, Version 1.0, dated 19-January-1998. The editors are Tim Bray (Textuality), Dave Hollander (Hewlett-Packard Company), and Andrew Layman (Microsoft); Murata Makoto contributed the operational scenarios in the examples section. The document abstract says: "XML Namespaces is a proposal for a simple method to be used for qualifying names used in Extensible Markup Language (XML) documents by associating them with schemas, identified by URI." This NOTE submitted to the Consortium represents a formulation based upon significant prior work, some of which is referenced by entries in the XML Page. The current document is available in HTML and XML format. The NOTE may be obtained as "NOTE-xml-names" from the W3C Web site; or see the dedicated entry in the XML Page.

XML name spaces are elaborated in the NOTE summary as follows: "We envision applications of XML in which a document instance may contain markup defined in multiple schemas. These schemas may have been authored independently. One motivation for this is that writing good schemas is hard, so it is beneficial to reuse parts from existing, well-designed schemas. Another is the advantage of allowing search engines or other tools to operate over a range of documents that vary in many respects but use common names for common element types. These considerations require that document constructs should have universal names, whose scope extends beyond their containing document. This specification proposes a mechanism, XML Namespaces, to accomplish this. XML Namespaces are based on the use of qualified names, similar to those long used in programming languages. Names are permitted to contain a colon, separating the name into two parts, the namespace name and the local name. The namespace name identifies a schema's URI. The combination of the universally-managed URI namespace and the local schema namespace produces names that are guaranteed universally unique."

Principal References

General References: Articles, Papers, News, Blogs

SEARCH
Advanced Search
ABOUT
Site Map
CP RSS Channel
Contact Us
Sponsoring CP
About Our Sponsors

NEWS
Cover Stories
Articles & Papers
Press Releases

CORE STANDARDS
XML
SGML
Schemas
XSL/XSLT/XPath
XLink
XML Query
CSS
SVG

TECHNOLOGY REPORTS
XML Applications
General Apps
Government Apps
Academic Apps

EVENTS
LIBRARY
Introductions
FAQs
Bibliography
Technology and Society
Semantics
Tech Topics
Software
Related Standards
Historic
Last modified: January 02, 2010

Hosted By
OASIS - Organization for the Advancement of Structured Information Standards

Sponsored By

IBM Corporation
ISIS Papyrus
Microsoft Corporation
Oracle Corporation

Primeton

XML Daily Newslink
Receive daily news updates from Managing Editor, Robin Cover.

Newsletter Subscription
Newsletter Archives
[画像:Globe Image]

Document URI: http://xml.coverpages.org/namespaces.htmlLegal stuff
Robin Cover, Editor: robin@oasis-open.org


AltStyle によって変換されたページ (->オリジナル) /