Chapter 15
Namespaces Revisited
In This Chapter
Knowing the lingo
Adding a namespace to the result document
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access