Namespaces review

Without the genus, we don’t know what animal these species are:

  • glauca: a pine tree (Picea glauca) or a small yellow flower (Agoceris glauca)?
  • leucocephalus: a cactus (Pilosocereus leucocephalus) or a bald eagle (Haliaeetus leucocephalus)?

Without knowing the language, we don’t know these words mean:

  • the (English definite article or a French hot drink?)
  • bad (English adjective or German noun for bath)

Without a namespace designation, we don’t know what these elements mean:

  • p (TEI paragraph or HTML block element?)
  • div (TEI textual division or HTML grouping element?)
  • fileDesc (TEI or EAD?)

With the namespace, all is clear:

  • ]]>
  • ]]>
  • ]]>

The namespace prefix is somewhat like a genus or language name: it tells us more precisely what language we are speaking (and hence what the semantics of the element are)

Namespaces function like genus names in taxonomy or like languages. They allow us to understand the context for given words. So for example, glauca can specify different species, depending upon the genus name, and the can mean be either an English article, or the French word for tea. Similarly, p means something different in HTML than it does in the TEI. Namespaces allow us to clear up this confusion, by providing the language that a given element is being used in.

The namespace prefix is somewhat like a genus or language name: it tells us more precisely what language we are speaking (and hence what the semantics of the element are).

This tutorial is complete, please see links below to continue:

The XSLT Processing Model, slide 10 of 10