Namespace Basics

If you've done any programming in a language such as C++ or Java, you may have some understanding of namespaces. The role of a namespace in a programming language is to insulate the names of programming constructs defined within a given object from constructs defined in other objects. Java makes extensive use of namespaces to address the problem of name clashing, making it possible to integrate code from multiple sources without the worry of naming problems.

Although XML isn't a programming language, it faces a similar problem when it comes to element names. Consider the movie collection schema covered in the previous two chapters. The schema defines an element named movie that includes a child element named title. But what ...

Get XML Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.