What are namespaces in XML?
Each tag in an XML file should have a unique name. However, you might have a tag name that means one thing in one context, but a different thing in a different context. For this, you have namespaces to uniquely identify the tags.
Example
<education:onlineCourse>
In the above example:
education
is the namespace.onlineCourse
is the tag.- The namespace acts as a "prefix" to the tag. They are separated by a colon.
Sources
- MDN Web Docs
- Learn API Technical Writing: JSON and XML for Writers by Peter Gruenbaum
- W3 Schools