aboutsummaryrefslogtreecommitdiff
path: root/lib/xml.ml
diff options
context:
space:
mode:
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 ^ "\"") ^