XML TutorialLesson 8Free preview
XML Namespaces
This lesson is part of XML · All levels
Summary
XML namespaces prevent name collisions when two different libraries use the same element name, e.g. <harga> of the store module and tax module. Namespace is declared via the xmlns attribute and usually uses a URI as a unique identifier. With prefixes like xmlns:tp, each element indicates which namespace it uses.
Key points
- Namespace prevents intermodal or interstandard name conflicts
- Default declaration using the xmlns attribute
- Namespace prefixed with xmlns:prefix="URI"
- URI is used as a unique identifier, not to be opened as a web page
- The prefix on the element indicates the namespace of the element's origin
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.