Purpose of Namespaces

Contact Us or call 1-877-932-8228
Purpose of Namespaces

Purpose of Namespaces

As described above, one purpose of namespaces is to provide a unique identifier for a group of element and attribute declarations.

Another purpose is to allow instance documents to be made up of a combination of such groups without having name conflicts. For example, we could hold the book schema and song schema we have worked on throughout this course in separate namespaces. Now suppose you wanted to use both schemas to create a book of songs. Both songs and books can have Title elements. This could potentially be a source of confusion as an application might not understand which Title element to apply. By specifying which namespace the Title elements come from, the confusion is removed.

Next