From 9b22f650dafeb8dc193dadd1a10182724382c6a7 Mon Sep 17 00:00:00 2001 From: Clombrong Date: Wed, 25 Jun 2025 18:06:07 +0200 Subject: chore: move comments to correct location --- lib/xml.ml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/xml.ml') diff --git a/lib/xml.ml b/lib/xml.ml index dff9652..840aaf0 100644 --- a/lib/xml.ml +++ b/lib/xml.ml @@ -7,9 +7,9 @@ type element = { children : (element, string) Either.t list; } +(** [tree s] is an [element option] representing the XML element inside of stream [s], + if [s] is a complete element from start to end. *) let tree s : element option = - (** [tree s] is an [element option] representing the XML element inside of stream [s], - if [s] is a complete element from start to end. *) let element (namespace, name) attributes children = Either.Left { namespace; @@ -27,12 +27,12 @@ let tree s : element option = let opt_el = tree ~text ~element s in Option.bind opt_el (Either.fold ~left:Option.some ~right:(fun _ -> None)) -let element_to_string ?(indent = 2) (el : element) = - (** [element_to_string element] is a string representation of the underlying XML in - [element], for debugging purposes. +(** [element_to_string element] is a string representation of the underlying XML in + [element], for debugging purposes. - Note this isn't serialization: namely, XML namespaces are inferred and don't exist - in the actual [element]. *) + Note this isn't serialization: namely, XML namespaces are inferred and don't exist + in the actual [element]. *) +let element_to_string ?(indent = 2) (el : element) = let rec element_to_string parent {local_name; attributes; children; namespace} = let attributes = (if parent == namespace then "" else " xmlns=\"" ^ namespace ^ "\"") ^ -- cgit v1.2.3