XML Namespaces

As you can see from the previous examples, when it's possible to define several different implementations of a tag, there's the potential for name collision. People have a tendency to use familiar names over and over again, relying on the context to remove any ambiguity. For example, consider the word strike. If the context is the sport of bowling, a strike is the act of knocking down all the pins with the first ball. In the context of organized labor, it's when the workers voluntarily stop working. And in the context of baseball, it's when the pitcher throws the baseball in a certain area.

A namespace can be considered the application of a context. In most cases, it's the application of a prefix, which can be either explicit ...

Get Sams Teach Yourself XML in 24 Hours 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.