diff options
author | Clombrong <cromblong@egregore.fun> | 2025-06-25 18:06:07 +0200 |
---|---|---|
committer | Clombrong <cromblong@egregore.fun> | 2025-06-25 18:06:07 +0200 |
commit | 9b22f650dafeb8dc193dadd1a10182724382c6a7 (patch) | |
tree | d1d64e6b0fbef0c00273cd03f5c33efa90797ff9 /lib/xml.ml | |
parent | 5f52ab70862cfa8332ec5bd9d1dc3d3f6af37d16 (diff) |
chore: move comments to correct location
Diffstat (limited to 'lib/xml.ml')
-rw-r--r-- | lib/xml.ml | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -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 ^ "\"") ^ |