Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
Provide types and pretty printing for XML.
type document = {
version : string;
Version, usually 1.0
*)encoding : string;
Encoding (only current encoding supported now)
*)standalone : bool;
Standalone attribute
*)element : node;
Document root element
*)}
Representation of an XML document.
validate_identifiers elt
validates that identifiers in the document are unique and non-empty.
deduplicate elt
traverses elt
and removes all sub-elements with duplicating identifiers.
When several elements have the same identifier the first (in the DSF traversal order) element is preserved and all subsequent are removed.
If all children of a parent are duplicates of some other elements, then the father is still preserved with an empty list of children (unless it is itself a duplicate of some other element).
val new_attr : string -> string -> attr
Build an attribute.
val new_text : string -> node
Build a new text node.
val output_attr : out_channel -> (string * string) -> unit
Output an attribute.
val output_node : out_channel -> string -> node -> unit
Output a node on the given channel.
val output_doc : out_channel -> document -> unit
Output an XML document to the given output channel.
val output : document -> unit
Output the given XML document on the standard output.
val output_file : string -> document -> unit
Output the given XML document on the named file.