0% found this document useful (0 votes)
57 views

XML Namespaces

XML namespaces allow elements and attributes from different XML document types to be combined without name conflicts by providing unique identifiers. They avoid element name clashes that can occur when integrating XML documents from separate applications by allowing developers to prefix element names and differentiate their meaning and semantics.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views

XML Namespaces

XML namespaces allow elements and attributes from different XML document types to be combined without name conflicts by providing unique identifiers. They avoid element name clashes that can occur when integrating XML documents from separate applications by allowing developers to prefix element names and differentiate their meaning and semantics.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

XML Namespaces

 It is possible to have two document types have elements with same


name, but different meanings and semantics.
 Using XML namespaces we can differentiate elements and attributes of
different XML document types from each other when combining them
together into other documents or processing multiple documents
simultaneously.
 XML Namespaces provide a method to avoid element name conflicts.
 In XML, element names are defined by the developer. This often
results in a conflict when trying to mix XML documents from different
XML applications.

Eg: <student>
<BTECH>
<course> Computer Science </course>
<age> 22 </age>
</BTECH>
<MTECH>
<course> DataScience </course>
<age> 24 </age>
</MTECH>
</student>

Here would be a name conflict for <course> and <age>, but the elements
have different content and meaning.

Name conflicts in XML can easily be avoided using a name prefix.

<student xmlns:ug="http://www.w3.org/2001/XMLSchema"
xmlns:pg="http://www.w3.org/2001/XMLSchema" >
<BTECH>
<ug:course> Computer Science </ug:course>
<ug:age> 22 </ug:age>
</BTECH>
<MTECH>
<pg:course> DataScience </pg:course>
<pg:age> 24 </pg:age>
</MTECH>
</student>

You might also like