XML namespace: Difference between revisions

Content deleted Content added
No edit summary
m Reverted edits by 182.71.111.146 (talk) to last version by 173.218.108.5
Line 1:
oviding'''XML namespaces''' are used for providing uniquely named [[Data element|elements]] and attributes in an [[XML]] document. They are defined in a [[W3C]] [[W3C recommendation|recommendation]].<ref>{{cite web|last=Bray|first=Tim|title=Namespaces in XML 1.0|url=http://www.w3.org/TR/xml-names/|publisher=[[W3C]]|accessdate=9 October 2010|coauthors=Dave Hollander, Andrew Layman, Richard Tobin, Henry S. Thompson|month=December|year=2009}}</ref> An XML instance may contain element or attribute names from more than one XML vocabulary. If each vocabulary is given a [[Namespace (computer science)|namespace]], the ambiguity between identically named elements or attributes can be resolved.
 
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 would remove the ambiguity.