# Index of class methods

A
active_id [Pxp_reader.resolver] | Returns the actually used resolver ID.
add [Pxp_tree_parser.index] | Add the passed node to the index.
add [Pxp_tree_parser.hash_index] | Add the passed node to the index.
add_attribute [Pxp_dtd.dtd_element] | `add_attribute name type default extdecl`: add an attribute declaration for an attribute with the given name, type, and default value.
add_element [Pxp_dtd.dtd] | add the given element declaration to this DTD.
add_gen_entity [Pxp_dtd.dtd] | `add_gen_entity e extdecl`: add the entity `e` as general entity to this DTD (general entities are those represented by `&name;`).
add_namespace [Pxp_dtd.namespace_manager] | `add_namespace np uri`: adds a new namespace to the object.
add_node [Pxp_document.node] | Deprecated! Use `append_node` instead.
add_notation [Pxp_dtd.dtd] | add the given notation to this DTD.
add_par_entity [Pxp_dtd.dtd] | add the given entity as parameter entity to this DTD (parameter entities are those represented by %name;).
add_pinstr [Pxp_dtd.dtd] | add the given processing instruction to this DTD.
add_pinstr [Pxp_document.document] | Adds a processing instruction to the document container.
add_pinstr [Pxp_document.node] | `add_pinstr pi`: Adds the processing instruction `pi` to the set of processing instructions attached to this node.
add_uri [Pxp_dtd.namespace_manager] | `add_uri np uri`: adds `uri` as alias URI to the namespace identified by the normprefix `np` (see above for detailed semantics).
allow_arbitrary [Pxp_dtd.dtd_element] | This method sets the `arbitrary_allowed` flag for this element.
allow_arbitrary [Pxp_dtd.dtd] | This method sets the `arbitrary_allowed` flag.
append_node [Pxp_document.node] | `append_node n`: Adds the node `n` at the end of the list of children.
arbitrary_allowed [Pxp_dtd.dtd_element] | Returns whether arbitrary attributes are allowed or not.
arbitrary_allowed [Pxp_dtd.dtd] | Returns whether arbitrary contents are allowed or not.
as_declaration [Pxp_dtd.namespace_manager] | Returns the list of normprefixes and primary URIs.
attribute [Pxp_dtd.dtd_element] | get the type and default value of a declared attribute, or raise `Validation_error` if the attribute does not exist.
attribute [Pxp_document.node] | `attribute name` returns the value of the attribute `name`.
attribute_names [Pxp_dtd.dtd_element] | get the list of all declared attributes
attribute_names [Pxp_document.node] | Returns the list of all attribute names of this element.
attribute_type [Pxp_document.node] | `attribute_type name`: returns the type of the attribute `name`.
attribute_violates_standalone_declaration [Pxp_dtd.dtd_element] | `attribute_violates_standalone_declaration name v`: Checks whether the attribute `name` violates the standalone declaration if it has value `v`.
attributes [Pxp_document.node] | Returns the list of `(name,value)` pairs describing all attributes (declared attributes plus defined attributes).
attributes_as_nodes [Pxp_document.node] | Returns all attributes (i.e.
C
change_encoding [Pxp_reader.resolver] | Changes the external encoding.
classify_data_node [Pxp_document.node] | `classify_data_node n`: Classifies the passed data node `n`, and returns whether it is reasonable to append the data node to the list of subnodes (using `append_node`).
clone [Pxp_reader.resolver] | Every resolver can be cloned.
clone [Pxp_document.extension] | `clone` is called when the node is to be duplicated, and as a followup action, also the extension must be cloned.
close_in [Pxp_reader.resolver] | Closes the resolver
comment [Pxp_document.node] | Returns `Some text` if the node is a comment node and if `text` is the comment string (without the delimiters `<!--` and `-->`).
complement_attlist [Pxp_document.node] | `complement_attlist ()`: Adds attributes that are declared in the DTD but are currently missing: `#IMPLIED` attributes are added with `Implied_value`, and if there is a default value for an attribute, this value is added.
content_dfa [Pxp_dtd.dtd_element] | return the DFA of the content model if there is a DFA, or `None`.
content_model [Pxp_dtd.dtd_element] | get the content model of this element declaration, or `Unspecified`
create_data [Pxp_document.node] | `create_data dtd cdata`: This method is usually only called on exemplars to create fresh nodes of the same class as the examplars.
create_element [Pxp_document.node] | `create_element ~name_pool_for_attribute_values ~position ~valcheck ~att_values dtd ntype att_list`: This method is usually only called on exemplars to create fresh nodes of the same class as the examplars.
create_other [Pxp_document.node] | `create_other ~position dtd ntype`: This method is usually only called on exemplars to create fresh nodes of the same class as the examplars.
D

data [Pxp_document.node]

This method returns what is considered as the data of the node which depends on the node type: Data nodes: the method returns the character string the node represents, Element nodes, super root nodes: the method returns the concatenated character strings of all (direct or indirect) data nodes below this node, Comment nodes: the method returns the comment string (without delimiters), or it raises `Not_found` if the comment string is not set (see also the `comment` method below for an alternate way of getting the comment string), Processing instructions: the method returns the data part of the instruction, or `""` if the data part is missing (see also the `pinstr` method below for an alternay way of accessing processing instructions), Attribute nodes: the method returns the attribute value as string, or it raises `Not_found` if the attribute is implied., Namespace nodes: the method returns the namespace URI Domain.

declaration [Pxp_dtd.namespace_scope] | Returns the list of namespace declarations of this scope (i.e.
delete [Pxp_document.node] | Deprecated alias for `remove`
disallow_arbitrary [Pxp_dtd.dtd_element] | Clears the `arbitrary_allowed` flag
disallow_arbitrary [Pxp_dtd.dtd] | Clears the `arbitrary_allowed` flag again
display [Pxp_document.document] | Write the document to the passed output stream; the passed encoding used.
display [Pxp_document.node] | `display stream enc`: Write the contents of this node and the subtrees to the passed `stream` encoded as `enc`.
display_prefix [Pxp_document.node] | For namespace-aware implementations of the node class, this method returns the display prefix of the element or attribute.
display_prefix_of_normprefix [Pxp_dtd.namespace_scope] | Translates the normalized prefix to the corresponding display prefix as declared in this object or any parent object.
display_prefix_of_uri [Pxp_dtd.namespace_scope] | Translates the URI to the corresponding display prefix as declared in this object or any parent object.
dtd [Pxp_document.document] | Returns the DTD of the root element.
dtd [Pxp_document.node] | Returns the DTD.
dump [Pxp_document.document] |
dump [Pxp_document.node] |
E
effective_declaration [Pxp_dtd.namespace_scope] | Returns the list of namespace declarations of this scope and all parent scopes.
element [Pxp_dtd.dtd] | looks up the element declaration with the given name.
element_names [Pxp_dtd.dtd] | returns the list of the names of all element declarations.
encoding [Pxp_dtd.proc_instruction] |
encoding [Pxp_dtd.dtd_notation] |
encoding [Pxp_dtd.dtd_element] | Return the encoding of the strings
encoding [Pxp_dtd.dtd] | returns the encoding used for character representation
encoding [Pxp_document.document] | Returns the string encoding of the document = the encoding of the root element = the encoding of the element tree = the encoding of the DTD.
encoding [Pxp_document.node] | Get the encoding which is always the same as the encoding of the DTD.
entity_id [Pxp_document.node] | Returns the `entity_id` object.
ext_id [Pxp_dtd.dtd_notation] |
extension [Pxp_document.node] | Returns the extension object of this node.
externally_declared [Pxp_dtd.dtd_element] | returns whether the element declaration occurs in an external entity.
F
find [Pxp_tree_parser.index] | Finds the node with the passed ID value, or raises `Not_found`
find [Pxp_tree_parser.hash_index] | Finds the node with the passed ID value, or raises `Not_found`
G
gen_entity [Pxp_dtd.dtd] | `let e, extdecl = obj # gen_entity n`: looks up the general entity `e` with the name `n`.
gen_entity_names [Pxp_dtd.dtd] | returns the list of all general entity names
get_normprefix [Pxp_dtd.namespace_manager] | Return the normprefix for a URI, or raises `Namespace_not_managed`.
get_primary_uri [Pxp_dtd.namespace_manager] | Return the primary URI for a normprefix, or raises `Namespace_prefix_not_managed`.
get_uri_list [Pxp_dtd.namespace_manager] | Return all URIs for a normprefix, or `[]` if the normprefix is unused.
I
id [Pxp_dtd.dtd] | get the identifier for this DTD.
id_attribute_name [Pxp_dtd.dtd_element] | Returns the name of the attribute with type ID, or `None`.
id_attribute_name [Pxp_document.node] | Returns the name of the (at most one) attribute being declared as type `ID`.
id_attribute_value [Pxp_document.node] | Returns the string value of the (at most one) attribute being declared as type `ID`.
idref_attribute_names [Pxp_dtd.dtd_element] | Returns the names of the attributes with type IDREF or IDREFS.
idref_attribute_names [Pxp_document.node] | Returns the names of the attributes being declared as type `IDREF` or `IDREFS`.
index [Pxp_tree_parser.hash_index] | Returns the hash table mapping IDs to nodes.
init_rep_encoding [Pxp_reader.resolver] | A resolver can open an input source, and returns this source as `Lexing.lexbuf` (and as its advanced version, `Netulex.ULB.unicode_lexbuf`).
init_root [Pxp_document.document] | Set the root element.
init_warner [Pxp_reader.resolver] |
init_xml_version [Pxp_document.document] | Set the XML version string of the XML declaration.
insert_nodes [Pxp_document.node] | `insert_nodes ~pos nl`: Inserts the list of nodes `nl` in-place into the list of children.
internal_adopt [Pxp_document.node] |
internal_delete [Pxp_document.node] |
internal_init [Pxp_document.node] |
internal_init_other [Pxp_document.node] |
internal_set_pos [Pxp_document.node] |
iter_namespaces [Pxp_dtd.namespace_manager] | Iterates over all namespaces contained in the object, and calls the passed function for every namespace.
iter_nodes [Pxp_document.node] | `obj#iter_nodes f` iterates over the regular children of `obj`, and calls the function `f` for every child `ch` as `f ch`.

iter_nodes_sibl [Pxp_document.node]

`obj#iter_nodes f` iterates over the regular children of `obj`, and calls the function `f` for every child as `f pred ch succ`: `ch` is the child, `pred` is `None` if the child is the first in the list, and `Some p` otherwise; `p` is the predecessor of `ch`, `succ` is `None` if the child is the last in the list, and `Some s` otherwise; `s` is the successor of `ch` The regular children are the nodes returned by `sub_nodes`, see there for an explanation.

L
lexer_factory [Pxp_dtd.dtd] | Returns a lexer factory for the character encoding
local_validate [Pxp_document.node] | Deprecated alias for `validate_contents`
localname [Pxp_document.node] | For namespace-aware implementations of the node class, this method returns the local part of the name of the element or attribute.
lookup_or_add_namespace [Pxp_dtd.namespace_manager] | `lookup_or_add_namespace p uri`: first, the method looks up if the namespace for `uri` does already exist.
N
name [Pxp_dtd.dtd_notation] |
name [Pxp_dtd.dtd_element] | returns the name of the declared element
names_of_required_attributes [Pxp_dtd.dtd_element] | get the list of all attributes that are specified as required attributes
namespace_manager [Pxp_dtd.dtd] | For namespace-aware implementations of the node class, this method returns the namespace manager.
namespace_manager [Pxp_dtd.namespace_scope] | Returns the `namespace_manager` to which this scope object is connected
namespace_manager [Pxp_document.node] | For namespace-aware implementations of the node class, this method returns the namespace manager.
namespace_scope [Pxp_document.node] | Returns additional information about the namespace structure in the parsed XML text.
namespace_uri [Pxp_document.node] | For namespace-aware implementations of the node class, this method returns the namespace URI of the element, attribute or namespace.
namespaces_as_nodes [Pxp_document.node] | Returns the namespaces found in the `namespace_scope` object and all parent scope objects (except declarations that are hidden by more recent declarations).
next_node [Pxp_document.node] | Returns the successor of this node in the list of regular children of the parent, or raise `Not_found` if this node is the last child.
node [Pxp_document.extension] | `node` is the link from the extension to the main node.
node_path [Pxp_document.node] | Returns the list of node positions describing the location of this node in the whole tree.
node_position [Pxp_document.node] | Returns the position of this node in the list of all children of the parent node.

node_type [Pxp_document.node]

Returns the type of the node: `T_element t`: The node is an element with name `t`, `T_data`: The node is a data node, `T_comment`: The node is a comment node, `T_pinstr n`: The node is a processing instruction with target `n`, `T_super_root`: The node is a super root node, `T_attribute n`: The node is an attribute with name `n`, `T_namespace p`: The node is a namespace with normalized prefix `p` Domain.

normprefix [Pxp_document.node] | For namespace-aware implementations of the node class, this method returns the normalized prefix of the element or attribute.
normprefix_of_display_prefix [Pxp_dtd.namespace_scope] | Translates the display prefix to the corresponding normalized prefix as declared in this object or any parent object.
notation [Pxp_dtd.dtd] | looks up the notation declaration with the given name.
notation_names [Pxp_dtd.dtd] | Returns the list of the names of all added notations
nth_node [Pxp_document.node] | `nth_node n` returns the n-th regular child, `n >= 0`.
O
only_deterministic_models [Pxp_dtd.dtd] | Succeeds if all regexp content models are deterministic.
open_in [Pxp_reader.resolver] | This is the old method to open a resolver.
open_rid [Pxp_reader.resolver] | This is the new method to open a resolver.
optional_list_attribute [Pxp_document.node] | `optional_list_attribute name`: Returns the value of the attribute `name` as string list, i.e.
optional_string_attribute [Pxp_document.node] | `optional_string_attribute name`: Returns the value of the attribute `name` as optional string, i.e.
orphaned_clone [Pxp_document.node] | Returns a clone of the node and the complete tree below this node (deep clone).
orphaned_flat_clone [Pxp_document.node] | return a clone of this element where all subnodes are omitted.
P
par_entity [Pxp_dtd.dtd] | looks up the parameter entity with the given name.
par_entity_names [Pxp_dtd.dtd] | returns the list of all parameter entity names
parent [Pxp_document.node] | Get the parent node, or raise `Not_found` if this node is a root node.
parent_scope [Pxp_dtd.namespace_scope] | Returns the parent object, if any
parse_pxp_option [Pxp_dtd.proc_instruction] | Parses a PI containing a PXP option.
pinstr [Pxp_dtd.dtd] | looks up all processing instructions with the given target.
pinstr [Pxp_document.document] | Return all PIs for a passed target string.
pinstr [Pxp_document.node] | `pinstr n` returns all processing instructions that are attached to this object and that have a target specification of `n`.
pinstr_names [Pxp_dtd.dtd] | Returns the list of the names (targets) of all added pinstrs
pinstr_names [Pxp_document.document] | Return all target strings of all PIs.
pinstr_names [Pxp_document.node] | Returns the targets of all processing instructions that are attached to this object.
position [Pxp_document.node] | Returns a triple `(entity,line,pos)` describing the location of the element in the original XML text.
previous_node [Pxp_document.node] | Returns the predecessor of this node in the list of regular children of the parent, or raise `Not_found` if this node is the first child.
Q
quick_set_attributes [Pxp_document.node] | Deprecrated alias for `set_attributes`
R
raw_root_name [Pxp_document.document] | The unprocessed name of the root element (second arg of `init_root`)
remove [Pxp_document.node] | Removes this node from the tree.
remove_nodes [Pxp_document.node] | `remove_nodes ~pos ~len ()`: Removes the specified nodes from the list of children.
rep_encoding [Pxp_reader.resolver] | Return the representation encoding, as set by `init_rep_encoding`
required_list_attribute [Pxp_document.node] | `required_list_attribute name`: Returns the value of the attribute `name` as string list, i.e.
required_string_attribute [Pxp_document.node] | `required_string_attribute name`: Returns the value of the attribute `name` as string, i.e.
reset_attribute [Pxp_document.node] | `reset_attribute n`: If the attribute `n` is a declared attribute, it is set to its default value, or to `Implied_value` if there is no default (the latter is performed even if the attribute is `#REQUIRED`).
root [Pxp_dtd.dtd] | get the name of the root element if present.
root [Pxp_document.document] | Returns the root element, or fails if there is not any.
root [Pxp_document.node] | Gets the root node of the tree.
S
set_attribute [Pxp_document.node] | `set_attribute ~force n v`: Sets the attribute `n` of this element to the value `v`.
set_attributes [Pxp_document.node] | `set_attributes al`: Sets the attributes of this element to `al`.
set_cm_and_extdecl [Pxp_dtd.dtd_element] | `set_cm_and_extdecl cm extdecl`: set the content model to `cm`.
set_comment [Pxp_document.node] | `set_comment c`: Sets the comment string contained in comment nodes if `c = Some s`.
set_data [Pxp_document.node] | `set_data s`: This method sets the character string contained in data nodes.
set_id [Pxp_dtd.dtd] | set the identifier.
set_namespace_manager [Pxp_dtd.dtd] | Sets the namespace manager as returned by `namespace_manager`.
set_namespace_scope [Pxp_document.node] | `set_namespace_scope scope`: Sets the namespace scope object.
set_node [Pxp_document.extension] | `set_node n` sets the link to the main node to `n`.
set_nodes [Pxp_document.node] | `set_nodes l`: Sets the list of children to `l`.
set_root [Pxp_dtd.dtd] | set the name of the root element.
set_standalone_declaration [Pxp_dtd.dtd] | Sets the 'standalone' declaration.
standalone_declaration [Pxp_dtd.dtd] | Whether there is a 'standalone' declaration or not.
sub_nodes [Pxp_document.node] | Returns the regular children of the node as list.
T
target [Pxp_dtd.proc_instruction] |
U
uri_of_display_prefix [Pxp_dtd.namespace_scope] | Translates the display prefix to the corresponding URI as declared in this object or any parent object.
V
validate [Pxp_dtd.dtd_element] | checks whether this element declaration (i.e.
validate [Pxp_dtd.dtd] | ensures that the DTD is valid.
validate [Pxp_document.node] | `validate ()`: Calls `validate_contents` and `validate_attlist`, and ensures that this element is locally valid.
validate_attlist [Pxp_document.node] | `validate_attlist ()`: Checks whether the attribute list of this element matches the declared attribute list.
validate_contents [Pxp_document.node] | `validate_contents ?use_dfa ?check_data_nodes ()`: Checks that the subnodes of this element match the declared content model of this element.
value [Pxp_dtd.proc_instruction] |
W
warn [Pxp_core_types.S.symbolic_warnings] |
warn [Pxp_core_types.S.collect_warnings] |
write [Pxp_dtd.dtd] | `write os enc doctype`: Writes the DTD as `enc`-encoded string to `os`.
write [Pxp_document.document] | Write the document to the passed output stream; the passed encoding used.
write [Pxp_document.node] | `write stream enc`: Write the contents of this node and the subtrees to the passed `stream` encoded as `enc`.
write_ref [Pxp_dtd.dtd] | `write_ref os enc`: Writes a reference to the DTD as `enc`-encoded string to `os`.
X
xml_standalone [Pxp_document.document] | Returns whether this document is declared as being standalone.
xml_version [Pxp_document.document] | Returns the XML version from the XML declaration.