Docs GODI Archive
Projects Blog Link DB

Search GODI:


More options
File doc/godi-frontc/html/Cxml.html GODI Package godi-frontc
 
   Cxml.html    cxml.cmi_pretty    Sources  

Module Cxml


module Cxml: sig .. end
Provide types and pretty printing for XML.

type attr = string * string 
Attribute representation.

type node =
| TEXT of string (*Simple text*)
| COM of string (*Commentary*)
| PI of string * string (*Processing instruction*)
| ELT of string * attr list * node list (*Element*)
Representation of nodes.

type document = {
   version : string; (*Version, usually 1.0*)
   encoding : string; (*Encoding (only current encoding supported now)*)
   standalone : bool; (*Standalone attribute*)
   element : node; (*Document root element*)
}
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.
This web site is published by Informatikbüro Gerd Stolpmann
Powered by Caml