package csvfields

  1. Overview
  2. Docs

Module Csvfields.XmlSource

Automatic conversion of OCaml field types into XML. This is used for excel communication functions

Sourcetype xml

Abstract representation of the xml type

Sourcemodule type Xmlable = sig ... end

The functions provided by the with xml camlp4 extension, and that need to be provided in a hand made conversion to be used by the extension.

Sourceval to_string : xml -> string

Basic conversions

Sourceval to_string_fmt : xml -> string
Sourceval to_human_string : xml -> string
Sourcemodule Parser_state : sig ... end
Sourceval stateful_of_string : Parser_state.t -> string -> xml

Thread safe provided each thread uses a different Parser_state.t

Sourceval of_file : string -> xml
Sourceval tag : xml -> string option

Basic traversal

Sourceval attributes : xml -> (string * string) list
Sourceval children : xml -> xml list
Sourceval contents : xml -> string option
Sourceval child : xml -> string -> xml option
Sourceval kind : xml -> [ `Leaf | `Internal ]
Sourceval xml_data : string -> xml
Sourceexception Illegal_atom of xml

Exceptions that could be raised by to_xml and of_xml

Sourceexception Unexpected_xml of xml * string
Sourceval check_extra_fields : xml -> string list -> unit
  • raises Unexpected_xml,

    Illegal_atom Used by the with xml extension

XSD definition functions

Sourceval complex_type : xml list -> xml

An xsd complexType.

Sourceval decomplexify : xml list -> xml
Sourceval decomplexify_opt : xml list -> xml option
Sourceval decomplexify_list : xml list -> xml list option
Sourceval type_of_simple : xml list -> string
Sourceval wrap : xml -> xml

Standard wrapping to generate the necessary namespaces that are used in the automated conversions

Sourcemodule Restriction : sig ... end

Restriction generation

Sourceval xsd_element : ?attr:(string * string) list -> name:string -> xml list -> xml
Sourceval xml_element : ?attr:(string * string) list -> name:string -> xml list -> xml
Sourcemodule type Atom = sig ... end
Sourcemodule Make (Atom : Atom) : Xmlable with type t := Atom.t
Sourceval to_xml : to_string:('a -> string) -> 'a -> xml list

Helper functions to create the conversion functions by hand

Sourceval of_xml : of_string:(string -> 'a) -> xml -> 'a
Sourceval create_node : tag:string -> body:xml list -> xml

Creating an internal element in the xml tree

Sourceval create_data : string -> xml

Creating a leaf in the xml tree

Sourcetype 'a of_xml = xml -> 'a

Conversion functions used by the camlp4 extension. Not to be used by hand

Sourceval unit_of_xml : unit of_xml
Sourceval bool_of_xml : bool of_xml
Sourceval string_of_xml : string of_xml
Sourceval char_of_xml : char of_xml
Sourceval int_of_xml : int of_xml
Sourceval float_of_xml : float of_xml
Sourceval int32_of_xml : Core.Int32.t of_xml
Sourceval int64_of_xml : Core.Int64.t of_xml
Sourceval nativeint_of_xml : Core.Nativeint.t of_xml
Sourceval big_int_of_xml : Big_int.big_int of_xml
Sourceval nat_of_xml : Nat.nat of_xml
Sourceval num_of_xml : Num.num of_xml
Sourceval ratio_of_xml : Ratio.ratio of_xml
Sourceval list_of_xml : ?tag:string -> (xml -> 'a) -> 'a list of_xml
Sourceval array_of_xml : tag:string -> (xml -> 'a) -> 'a array of_xml
Sourceval option_of_xml : tag:string -> (xml -> 'a) -> 'a option of_xml
Sourceval ref_of_xml : (xml -> 'a) -> 'a Core.ref of_xml
Sourceval lazy_t_of_xml : (xml -> 'a) -> 'a Core.Lazy.t of_xml
Sourceval recursive_of_xml : string -> (xml -> 'a) -> 'a of_xml
Sourcetype 'a to_xml = 'a -> xml list
Sourceval xml_of_unit : unit to_xml
Sourceval xml_of_bool : bool to_xml
Sourceval xml_of_string : string to_xml
Sourceval xml_of_char : char to_xml
Sourceval xml_of_int : int to_xml
Sourceval xml_of_float : float to_xml
Sourceval xml_of_int32 : Core.Int32.t to_xml
Sourceval xml_of_int64 : Core.Int64.t to_xml
Sourceval xml_of_nativeint : Core.Nativeint.t to_xml
Sourceval xml_of_big_int : Big_int.big_int to_xml
Sourceval xml_of_nat : Nat.nat to_xml
Sourceval xml_of_num : Num.num to_xml
Sourceval xml_of_ratio : Ratio.ratio to_xml
Sourceval xml_of_ref : ('a -> xml list) -> 'a Core.ref to_xml
Sourceval xml_of_lazy_t : ('a -> xml list) -> 'a Core.Lazy.t to_xml
Sourceval xml_of_list : tag:string -> ('a -> xml list) -> 'a list to_xml
Sourceval xml_of_array : tag:string -> ('a -> xml list) -> 'a array to_xml
Sourceval xml_of_option : tag:string -> ('a -> xml list) -> 'a option to_xml
Sourcetype to_xsd = xml list
Sourceval xsd_of_unit : to_xsd
Sourceval xsd_of_bool : to_xsd
Sourceval xsd_of_string : to_xsd
Sourceval xsd_of_char : to_xsd
Sourceval xsd_of_int : to_xsd
Sourceval xsd_of_float : to_xsd
Sourceval xsd_of_int32 : to_xsd
Sourceval xsd_of_int64 : to_xsd
Sourceval xsd_of_nativeint : to_xsd
Sourceval xsd_of_big_int : to_xsd
Sourceval xsd_of_list : string -> to_xsd -> to_xsd
Sourceval xsd_of_array : string -> to_xsd -> to_xsd
Sourceval xsd_of_nat : to_xsd
Sourceval xsd_of_num : to_xsd
Sourceval xsd_of_ratio : to_xsd
Sourceval xsd_of_ref : to_xsd -> to_xsd
Sourceval xsd_of_lazy_t : to_xsd -> to_xsd
Sourceval xsd_of_option : string -> to_xsd -> to_xsd
Sourcemodule type X = sig ... end
Sourcemodule Write (X : X) : sig ... end
OCaml

Innovation. Community. Security.