Namespaces
Use xmlns prefixes to combine vocabularies without collisions.
What you will be able to do
- Declare xmlns on the root or the scope where it is used.
- Use xmlns:prefix for prefixed names.
- The URI is the identity, not the prefix.
- Attributes without a prefix are in no namespace.
In plain English
Namespaces qualify element and attribute names. A prefix is only a shorthand for a URI. Different prefixes can point to the same namespace, so compare the URI, not the prefix.
<feed xmlns="http://www.w3.org/2005/Atom"
xmlns:x="https://example.com/x">
<title>EduByte</title>
<x:meta x:version="1" />
</feed>Your turn
EasyDeclare a namespace
Add a default Atom namespace to a feed element.
HTML · starter
<feed>Check your understanding before moving on.
Knowledge checkQuestion 1
What identifies a namespace?
Select an answer to continue
Study tools
Make it yours.
Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.
Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign inFinished reading?
Lock in what you just learned.
0%
Mark this lesson complete to save your place and move one step closer to the certificate.