declared and mapped to a prefix that contains only legal characters. In the scope of that declaration, the prefix serves as a proxy for the namespace URI. Here is an example that you have already seen as Listing 1-15: <?xml version=1.0?> <xsl:stylesheet xmlns:xsl= version=1.0> <xsl:output method=html/> <xsl:template match=/> <!-- The rest of the program goes here --> </xsl:template> </xsl:stylesheet> The second line of this code contains a namespace declaration that maps the URI to a prefix. (The prefix for this particular namespace is usually xsl, but any prefix would do as long as it is associated with the right URI.) Syntactically, the declaration is an attribute. The name of the attribute consists of a reserved sequence of characters, xmlns, followed by a colon and the prefix to which the namespace URI is mapped; the value of the attribute is the namespace URI. The scope of the declaration includes the element whose start tag contains that dec- laration and all the descendants of that element (unless there is another declaration with more local scope, as discussed shortly). The XML 1.0 Perspective vs. the XML Namespaces  Perspective A namespace declaration is an attribute only from the naive perspective of the pre-namespace XML 1.0 recommendation. From the perspective of namespace- aware specifications (such as XPath, DOM, or the infoset), this is not an attribute at all but a namespace declaration: it is not an attribute node in the DOM or XPath tree, and it is not an attribute information item in the documents infoset. A related fact of some importance is that the following two documents are the same from the XML Namespaces perspective but different from the XML 1.0 perspective: <a:doc xmlns:a=><a:p>some text</a:p></a:doc> <b:doc xmlns:b=><b:p>some text</b:p></b:doc> Because DTDs originate with XML 1.0, they are namespace unaware and use the XML 1.0 perspective. This creates validation problems discussed in the next chapter. 54 Chapter 2