| File doc/godi-frontc/html/Cxml.html |
GODI Package
godi-frontc |
module Cxml: sig .. end
Provide types and pretty printing for XML.
type attr = string * string
Attribute representation.
type node =
| |
TEXT of string |
| |
COM of string |
| |
PI of string * string |
| |
ELT of string * attr list * node list |
Representation of nodes.
type document = {
|
version : string; |
|
encoding : string; |
|
standalone : bool; |
|
element : node; |
}
Representation of an XML document.
val new_simple_doc : node -> document
Build a simple document with default initialization.
elt : Main element of the document.
val new_doc : string -> string -> bool -> node -> document
Build a full document.
vers : XML version.
enc : Document encoding.
sa : Stand-alone attribute.
elt : Document element.
val new_attr : string -> string -> attr
Build an attribute.
name : Name of the attribute.
cont : Content of the attribute.
val new_elt : string -> attr list -> node list -> node
Build a new element.
name : Name of the element.
attrs : Attributes.
children : Children nodes.
val new_text : string -> node
Build a new text node.
text : Content of the node.
val escape_attr : string -> char -> string
Escape the given attribute value for output.
text : Text of the attribute.
quote : Quote character used for the attribute, either '"' or '\''.
val output_attr : Pervasives.out_channel -> string * string -> unit
Output an attribute.
out : Output channel.
(name,text) : text : Value of the attribute.
name : Name of the attribute.
val output_node : Pervasives.out_channel -> string -> node -> unit
Output a node on the given channel.
out : Channel to output to.
indent : Indentation.
node : Node to output.
val output_doc : Pervasives.out_channel -> document -> unit
Output an XML document to the given output channel.
out : Output channel.
doc : Document to output.
val output : document -> unit
Output the given XML document on the standard output.
doc : XML document to output.
val output_file : string -> document -> unit
Output the given XML document on the named file.
Raises Sys_error In case of error during opening of the file.
filename : Path to the file to write to.
doc : XML document to output.