#xmlns-names

built-in shelf

Purpose

#xmlns-names is a built in read-only string shelf displaying the currently active set of XML namespace/prefix mappings. The keys on the shelf are the element prefixes, and the values are the corresponding namespace names (URIs).

Example:

While parsing the content of the following element

  <a xmlns:omdoc="http://www.omnimark.com/docs/"
     xmlns:omtbl="http://www.omnimark.com/table.dtd">
the shelf will contain
  • an item with key omdoc and value http://www.omnimark.com/docs/, and
  • an item with key omtbl and value http://www.omnimark.com/table.dtd/.

A namespace name consisting of a zero length string indicates the absence of a namespace. Encountering this explicitly causes the prefix to be removed from the shelf if it already exists, or otherwise simply not added.

Example:

When parsing the instance

  <a xmlns:foo="bar">
    <b xmlns:foo="">
            
Immediately following the start tag for a, the #xmlns-names shelf has an entry with key foo and value bar. Inside element b, this shelf item is removed. After the end of element b (but still within element a) the shelf item will be restored.

Example:

The default namespace is represented by a shelf item with the empty string as the key.

  <a xmlns="foo">

The #xmlns-names shelf is saved before each start tag, and restored after each end tag. The shelf is saved and cleared at the start of each markup-parse.