Chapter 15

Namespaces Revisited

In This Chapter

bullet Knowing the lingo

bullet Adding a namespace to the result document

bullet Working with multiple namespaces

X ML uses namespaces to distinguish a set of element names from another group. It does so by associating a namespace identifier (or prefix) with a URI. By this time, using the xsl: prefix in your stylesheets to designate the http://www.w3.org/1999/XSL/Transform namespace is probably second nature for you. That’s the basic concept of a namespace.

When your source and result documents use the default namespace, you can ignore namespaces altogether during your transformations. However, XSLT also allows you to add namespaces to your result document or carry them over from the source document. In this chapter, I talk about how you can do this by using XSLT.

Speaking the Namespace Lingo

XML namespaces have their own lingo to describe the parts that make up namespaces and element names. In Chapter 3, I talk about the namespace URI and the associated prefix, but other terms, such as QName, NCName, local name, and expanded name, also come into play when working with namespaces. Knowing the lingo gives you a better understanding of namespaces, but ...

Get XSLT for Dummies 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.