Namespace Partitions
For each namespace, including the one with no namespace URI, there are a number of namespace partitions:
- an element name partition for the names of element types
- for each element type, a separate element attribute name partition for the names of local attributes specific to that element type
- a global attribute name partition for the names of global attributes that can be used on any type of element, regardless of which namespace contains the element name
Since those partitions exist for each namespace, the collection of namespace partitions can be viewed as a two-dimensional table:
Namespace URI (in xmlns attribute) | Prefix | Element Names | Element Attribute Names | Global Attribute Names |
---|---|---|---|---|
none (xmlns="" ) | none | title (in RSS, OPML, etc.) | <rss version> <opml version> | HTML global attributes such as id and style |
http://www.w3.org/1999/xhtml | default (no prefix) | <a> <link> <form> | <a href> <a rel> <link href> <link rel> <form action> <form method> | |
http://www.w3.org/XML/1998/namespace | xml: | xml:lang xml:space | ||
http://www.w3.org/2000/xmlns/ | xmlns: | default namespace (xmlns= ) and namespace prefix declarations (xmlns:xxx= ) | ||
http://www.w3.org/2001/XMLSchema | xsd: for the HTML examples on this site | <element> <attribute> | <element name> <element ref> <attribute name> <attribute ref> | |
http://www.w3.org/2001/XMLSchema-instance | xsi: for the HTML examples on this site | xsi:type | ||
http://www.w3.org/1998/Math/MathML | math: for the HTML examples on this site | <math> <mo> | <math mode> <mo form> | |
http://www.w3.org/1999/02/22-rdf-syntax-ns# | rdf: for the HTML examples on this site | rdf:RDF rdf:Description rdf:List | rdf:about | |
http://www.w3.org/2000/01/rdf-schema# | rdfs: for the HTML examples on this site | rdfs:Datatype | ||
http://www.w3.org/2000/svg | svg: for the HTML examples on this site | <svg> <rect> | <svg viewBox> <rect width> <rect height> |
When designing schema for one or more sets of objects, you should ensure that no namespace partition (as shown in the table above) contains the same name for two different object types. Otherwise, it will be difficult to create a definition (XML Schema definition or DTD) that properly describes the schema. For example, in the table above the title
element in the "no namespace URL" partition violates this requirement because it is used for RSS channel titles, RSS item titles and OPMN titles.