Extended.XmlmAdditional Xmlm functions.
Simple base-type constructors that make it much easier to avoid trivial type errors.
Typical usage:
module Xmlm = struct include Xmlm include Extended.Xmlm (Xmlm) end val name : ?uri:string -> string -> Xmlm.name(name ?uri str) is the expanded name (uri,local); the default uri is "".
(string_of_name (uri,n)) is "n" iff (uri = "") and is "uri:n" otherwise.
val attr : Xmlm.name -> string -> Xmlm.attribute(attr name str) is the attribute name with value str.
val tag : ?attrs:Xmlm.attribute list -> Xmlm.name -> Xmlm.tag(tag ?attrs name) is the tag name with attributes attrs; the default attrs is [].
val wrap :
?uri:string ->
?attrs:Xmlm.attribute list ->
Xmlm.output ->
string ->
('a -> 'b) ->
'a ->
unit(wrap ?uri ?attrs o n f x) applies (f x), which is presumed to output XML on o, in between a pair of (`El_start (tag ?attrs (name ?uri n))) and `El_end signals.
val wrapc :
?uri:string ->
?attrs:Xmlm.attribute list ->
Xmlm.output ->
string ->
string ->
unit(wrapc ?uri ?attrs o n data) outputs on o (`El_start (tag ?attrs (name ?uri n))), followed by (`Data data), followed by `El_end.