Module Pxp_tree_parser


module Pxp_tree_parser: sig .. end
The type of indexes over the ID attributes of the elements. This type is the minimum requirement needed by the parser to create such an index.

exception ID_not_unique
class type ['a Pxp_document.node #Pxp_document.extension as 'a] index = object .. end
class ['a Pxp_document.node #Pxp_document.extension as 'a] hash_index : object .. end
val default_extension : 'a Pxp_document.node Pxp_document.extension as 'a
A "null" extension; an extension that does not extend the functionality
val default_spec : ('a Pxp_document.node Pxp_document.extension as 'a) Pxp_document.spec
Specifies that you do not want to use extensions.
val default_namespace_spec : ('a Pxp_document.node Pxp_document.extension as 'a) Pxp_document.spec
Specifies that you want to use namespace, but not extensions
val parse_document_entity : ?transform_dtd:(Pxp_dtd.dtd -> Pxp_dtd.dtd) ->
?id_index:('a Pxp_document.node #Pxp_document.extension as 'a)
index ->
Pxp_types.config ->
Pxp_dtd.source -> 'a Pxp_document.spec -> 'a Pxp_document.document
Parse a closed document, i.e. a document beginning with <!DOCTYPE...>, and validate the contents of the document against the DTD contained and/or referenced in the document.

If the optional argument ~transform_dtd is passed, the following modification applies: After the DTD (both the internal and external subsets) has been parsed, the function ~transform_dtd is called, and the resulting DTD is actually used to validate the document.

If the optional argument ~transform_dtd is missing, the parser behaves in the same way as if the identity were passed as ~transform_dtd.

If the optional argument ~id_index is present, the parser adds any ID attribute to the passed index. An index is required to detect violations of the uniqueness of IDs.

val parse_wfdocument_entity : ?transform_dtd:(Pxp_dtd.dtd -> Pxp_dtd.dtd) ->
Pxp_types.config ->
Pxp_dtd.source ->
('a Pxp_document.node #Pxp_document.extension as 'a) Pxp_document.spec ->
'a Pxp_document.document
Parse a closed document (see parse_document_entity), but do not validate it. Only checks on well-formedness are performed.

The option ~transform_dtd works as for parse_document_entity, but the resulting DTD is not used for validation. It is just included into the returned document (e.g. useful to get entity declarations).

val parse_content_entity : ?id_index:('a Pxp_document.node #Pxp_document.extension as 'a)
index ->
Pxp_types.config ->
Pxp_dtd.source -> Pxp_dtd.dtd -> 'a Pxp_document.spec -> 'a Pxp_document.node
Parse a file representing a well-formed fragment of a document. The fragment must be a single element (i.e. something like <a>...</a>; not a sequence like <a>...</a>...). The element is validated against the passed DTD, but it is not checked whether the element is the root element specified in the DTD.

If the optional argument ~id_index is present, the parser adds any ID attribute to the passed index. An index is required to detect violations of the uniqueness of IDs.

val parse_wfcontent_entity : Pxp_types.config ->
Pxp_dtd.source ->
('a Pxp_document.node #Pxp_document.extension as 'a) Pxp_document.spec ->
'a Pxp_document.node
Parse a file representing a well-formed fragment of a document (see parse_content_entity). The fragment is not validated, only checked for well-formedness.