Knowledge Systems Laboratory, Stanford University
17
Declaring Namespaces
uA namespace is declared as an attribute specification of attribute xmlns or an attribute whose prefix is xmlns:
„Example:  <x xmlns:edi = 'http://ecommerce.org/schema'>
„          <!-- the "edi" prefix is bound to
„             http://ecommerce.org/schema for the "x"
„             element and contents -->
„       </x>
uA declaration applies to the element where it is specified and to all elements within the content of that element, unless overridden by another namespace declaration with the same attribute name
„Example:  <!-- both namespace prefixes are available
„            throughout -->
„     <bk:book xmlns:bk = 'urn:loc.gov:books'
„              xmlns:isbn = 'urn:ISBN:0-395-36341-6'>
„        <bk:title> Cheaper by the Dozen </bk:title>
„        <isbn:number> 1568491379 </isbn:number>
„     </bk:book>