X-Git-Url: http://git.nguyen.vg/gitweb/?p=tatoo.git;a=blobdiff_plain;f=src%2Ftree.mli;h=b64b0ffa82b72972e6d980bd12f0411ec28eaeef;hp=c75fd269c87107d8dfbee7151b914845367a2acb;hb=5cfe8f8725b83eadae6923a10929b5db9204049c;hpb=48457c0a99124a16ab29d7b84bcca85e0f3185a4 diff --git a/src/tree.mli b/src/tree.mli index c75fd26..b64b0ff 100644 --- a/src/tree.mli +++ b/src/tree.mli @@ -49,6 +49,12 @@ val first_child : t -> node -> node Returns [nil] if [n] is a leaf. Returns [nil] if [n == nil]. *) +val first_child_x : t -> node -> node +(** [first_child t n] returns the first child which is not an attribute + of node [n] in tree [t]. + Returns [nil] if [n] is a leaf. Returns [nil] if [n == nil]. +*) + val next_sibling : t -> node -> node (** [next_sibling t n] returns the next_sibling of node [n] in tree [t]. Returns [nil] if [n] is the last child of a node. @@ -62,7 +68,10 @@ val parent : t -> node -> node *) val is_leaf : t -> node -> bool -(** Return true if the node is a *) +(** Return true if the node is a leaf or an attribute *) + +val is_attribute : t -> node -> bool +(** Return true if the node is an attribute *) val tag : t -> node -> QName.t (** Returns the label of a given node *) @@ -81,3 +90,6 @@ val preorder : t -> node -> int val print_xml_preorder : out_channel -> t -> node -> unit (** Outputs the tree with IDs for nodes as an XML document on the given output_channel *) + +val debug_node : Format.formatter -> t -> node -> unit +(** DEBUG *)