Class type Pxp_dtd.namespace_scope


class type namespace_scope = object .. end
The recursive class type 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
Returns the namespace_manager to which this scope object is connected
method parent_scope : namespace_scope option
Returns the parent object, if any
method declaration : (string * string) list
Returns the list of namespace declarations of this scope (i.e. the declarations in parent objects are not considered). The list contains pairs (display_prefix, uri) .
method effective_declaration : (string * string) list
Returns the list of namespace declarations of this scope and all parent scopes. The list contains pairs (display_prefix, uri) . Prefixes hidden by earlier declarations are suppressed in the list
method display_prefix_of_uri : string -> string
Translates the URI to the corresponding display prefix as declared in this object or any parent object. Raises Namespace_not_in_scope when the declaration cannot be found.
method display_prefix_of_normprefix : string -> string
Translates the normalized prefix to the corresponding display prefix as declared in this object or any parent object. Raises 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
Translates the display prefix to the corresponding URI as declared in this object or any parent object. Raises Not_found when the declaration cannot be found.
method normprefix_of_display_prefix : string -> string
Translates the display prefix to the corresponding normalized prefix as declared in this object or any parent object. Raises Not_found when the declaration cannot be found, and Namespace_not_managed when the namespace manager does not know the namespace.