class type namespace_scope =The recursive class typeobject
..end
namespace_scope
represents the original
namespace declarations found in the XML text. A single namespace_scope
object contains a list of declared namespaces
[ (dp1, uri1); (dp2; uri2); ... ]
corresponding to the "xmlns"-type declarations found in a single
XML element:
<element xmlns:dp1="uri1" xmlns:dp2="uri2" ... >
For the declaration of a default namespace xmlns="uri"
the pair
("",uri)
must be included in the list. The special pair ("","")
means that the former default namespace is "undeclared".
Furthermore, the namespace_scope
object may have a parent
namespace_scope
, representing the namespace declarations in the
surrounding XML text.
The namespace_scope
objects are connected with the namespace_manager
to allow translations from the namespace prefixes found in the XML
text (also called "display prefixes" from now on) to the normalized
prefixes stored in the namespace_manager
, and vice versa.
The namespace_scope
objects are intentionally immutable in order to
allow memory sharing.
method namespace_manager : namespace_manager
namespace_manager
to which this scope object is
connectedmethod parent_scope : namespace_scope option
method declaration : (string * string) list
(display_prefix, uri)
.method effective_declaration : (string * string) list
(display_prefix, uri)
.
Prefixes hidden by earlier declarations are suppressed in the listmethod display_prefix_of_uri : string -> string
Namespace_not_in_scope
when the declaration cannot be found.method display_prefix_of_normprefix : string -> string
Namespace_not_in_scope
when the declaration cannot be found, and
Namespace_prefix_not_managed
when the
normalized prefix is unknown to the namespace manager.method uri_of_display_prefix : string -> string
Not_found
when the declaration cannot be found.method normprefix_of_display_prefix : string -> string
Not_found
when the declaration cannot be found, and
Namespace_not_managed
when the
namespace manager does not know the namespace.