aboutsummaryrefslogtreecommitdiff
path: root/lib/xml.ml
diff options
context:
space:
mode:
authorClombrong <cromblong@egregore.fun>2025-06-25 18:06:07 +0200
committerClombrong <cromblong@egregore.fun>2025-06-25 18:06:07 +0200
commit9b22f650dafeb8dc193dadd1a10182724382c6a7 (patch)
treed1d64e6b0fbef0c00273cd03f5c33efa90797ff9 /lib/xml.ml
parent5f52ab70862cfa8332ec5bd9d1dc3d3f6af37d16 (diff)
chore: move comments to correct location
Diffstat (limited to 'lib/xml.ml')
-rw-r--r--lib/xml.ml14
1 files changed, 7 insertions, 7 deletions
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 ^ "\"") ^