XML uses namespaces to prevent name conflicts in markup, with the ultimate goal of allowing markup from different XML-based vocabularies to coexist peacefully in a single document. ActionScript supports namespaces both as part of E4X and as a general programming tool. This section describes how to work with namespaces using E4X syntax but assumes prior knowledge of the concepts expressed by the W3C definition of namespaces in XML. For an introduction to namespaces in XML, see the following online resources:
For information on the non-XML uses of namespaces in ActionScript programming, see Chapter 17.
We've already learned how to access elements and attributes not qualified by a namespace. To learn the additional techniques required to access elements and attributes qualified by a namespace, let's look at a new XML fragment example, shown in Example 18-14. The fragment depicts part of a hypothetical furniture catalog. As you read the example, pay attention to the following namespace-related items: