Difference between revisions of "XML namespace"

From Wiki @ Karl Jones dot com
Jump to: navigation, search
 
Line 27: Line 27:
  
 
* [http://en.wikipedia.org/wiki/XML_namespace XML namespace] @ Wikipedia
 
* [http://en.wikipedia.org/wiki/XML_namespace XML namespace] @ Wikipedia
 +
 +
[[Category:Computer science]]
 +
[[Category:Markup languages]]
 +
[[Category:XML]]

Latest revision as of 09:39, 21 April 2016

In XML, XML namespaces provide uniquely named elements and attributes. See Namespace.

Definition

XML namespaces are defined in a W3C recommendation.

Namespaces resolve ambiguity

An XML instance may contain element or attribute names from more than one XML vocabulary.

If each vocabulary is given a namespace, the ambiguity between identically named elements or attributes can be resolved.

Example

A simple example would be to consider an XML instance that contained references to a customer and an ordered product.

  • Both the customer element and the product element could have a child element named id
  • References to the id element would therefore be ambiguous
  • Placing them in different namespaces resolves the ambiguity

See also

External Links