<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <link rel="stylesheet" href="advice.css" type="text/css"/>
    </head>
    <body>
        <h1>Default namespaces in XQuery</h1>
        <p>
A document such as that saved from Google earth defines the URI for the default namespace:
<code>&lt;kml xmlns="http://earth.google.com/kml/2.0"&gt; 
...
&lt;/kml&gt;</code>


Simply trying to access the nodes in this document will not work:
<code>//Placemark[name='arnolfine']</code>
produces no output.  

</p>
        <p>To access the nodes in the default namespace, you must declare a namespace in the XQuery with the same URI 
as that referenced in the declaration in the root element.

<code>declare namespace a = "http://earth.google.com/kml/2.0";</code>
and reference the nodes as
<code>//a:Placemark[a:name='Arnolfine']</code>
Now returns the selected node. 
</p>
        <p>Namespaces divide the filestore so that Placemark nodes in another document with a different namespace will not be located by the query above.</p>
    </body>
</html>
