Integrating Namespaces in XML Documents

There are a few ways in which we can incorporate Namespaces into our XML documents. All of these methods still use the same syntax we just covered for declaring the Namespace, with some variations on where the declaration is placed, and how the prefixes are used.

A Single Default Namespace

The simplest application of Namespaces is for documents that have only one Namespace, so that a default Namespace can be declared. This is a useful technique for declaring a Namespace for XML documents that you are going to share with other users, either within your organization or in the public, so that if they use the document with other documents, you can avoid Namespace collisions. It is good XML style to include ...

Get Special Edition Using XML, Second Edition 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.