Xmlc.TreeTree representation of XML
type t = | Element of {
} | |||
| Data of string | (* Type of a XML tree *) |
make_element ?attributes ?children name returns a new element node of an XML tree with name and optional children and attributes.
val make_data : string -> tmake_data v returns a new data element of an XML tree with value v.
val to_seq : t -> Xmlm.signal Stdlib.Seq.tto_seq tree returns a sequence of XML signals that represent tree.
val pp : t Fmt.tpp returns a pretty printer.
Currently this uses Xmlm to return an XML reprepresentation. In the future this might be made prettier with coloured printing and such.
parser is a Xmlc parser that can be used to parse a XML tree from a stream of XML signals.
parse_trees parser forrest applies parser[ on a sequence of
trees [forrest].
val get_root_attribute : Xmlm.name -> t -> string optionget_root_attribute name tree returns the attribute value of attribute name from the root element of tree.