Search This Blog

Tuesday, November 13, 2018

What is XML namespace?

XML namespace are similar to package in Java and used to provide a way to avoid conflict between two xml tags of same name but different sources. XML namespace is defined using xmlns attribute at top of the XML document and has following syntax xmlns:prefix=’URI’. later that prefix is used along with actual tag in XML documents. Here is an example of using XML namespace :
1<root xmlns:i88="http://it.i88.ca/marketing"
2  <i88:client>
3      <i88:number>188</i88:number>
4   </i88:client>
5</root>