Namespaces avoid name clashes using URIs as identifiers, commonly prefixed:
<svg xmlns="http://www.w3.org/2000/svg">...</svg>
xmlns:foo declares prefix foo for elements in that namespace.
Going deeper
In production XML work, Namespaces matters when documents, stylesheets, or apps must stay maintainable across teams and releases—not only in isolated demos.
Common pitfalls
Watch for copy-paste configs, skipping validation or tests, and mixing concerns (structure vs presentation vs behavior) in one layer.
Practice
- Apply one technique from this lesson in the playground.
- Write one interview-style sentence explaining when you would use namespaces on a real project.
Interview prep
- Why XML namespaces?
Prevent element name collisions when mixing vocabularies (SVG inside HTML, SOAP envelopes, etc.).