.TH "Eliom_content" 3o 2014-07-10 OCamldoc "" .SH NAME Eliom_content \- This module allows creating valid HTML content, or other XML formats. .SH Module Module Eliom_content .SH Documentation .sp Module .BI "Eliom_content" : .B sig end .sp This module allows creating valid HTML content, or other XML formats\&. .sp .sp .sp .sp .PP .B === XML tree manipulation within Eliom is based on the TyXML library .B but Eliom is using a custom representation for XML values (see .B Eliom_content\&.Xml)\&. Then, Eliom_content redefines the two high level .B interfaces (Eliom_content\&.Svg, Eliom_content\&.Html5) that are provided by .B TyXML for valid XML tree creation and printing\&. .B .B \- If you want to generate typed HTML, use Eliom_content\&.Html5, .B \- If you want to write untyped html, use Eliom_content\&.Html_text, .B \- If you want to generate typed svg, use Eliom_content\&.Svg\&. .B .B Modules Eliom_content\&.Html5, Eliom_content\&.Svg contain two .B sub\-modules: Eliom_content\&.Html5\&.F, Eliom_content\&.Html5\&.D .B corresponding to tow different semantics\&. .B They also contain a module Eliom_content\&.Html5\&.C that allows to .B inject client\-side content into server\-side content\&. .B .B .B Functional semantics .B .B .B The F modules provides functions to create elements with functional .B semantics: they are standard OCaml values\&. .B .B Use this module: .B \- if your application does not have a client\-side part .B (server\-side generated Web site) .B \- or if the client\-side is not written with Eliom, .B \- or if you do not need to use this node from the client\-side program .B (no injection %n on this node) .B and want to avoid the extra attributes added by module D\&. .B .B If you use a F\-node n in an injection (%n), .B it is considered as any OCaml value, NOT precisely the copy you (possibly) .B inserted in the page\&. For example, To_dom\&.of_element %n will not refer .B to the element in the page, but create a new DOM node\&. .B .B .B DOM semantics .B .B .B The D module provides functions to create elements with DOM semantics: .B Firstly, they behave like DOM nodes, e\&.g\&. they can only be added once to the .B DOM tree even when appended several times\&. .B Secondly, those values have an identifier, .B which means they can be referred to .B on client side (by %variable) or used with the functions in .B {% <> %} and .B {% <> %}\&. .B .B In case of doubt, always use D\-nodes when you are writing a .B client\-server Eliom app\&. You can also mix F\-nodes and D\-nodes\&. .B .B .B Client\-side value injection .B .B .B The C modules provides functions to inject client\-side elements and attributes .B into server\-side content\&. .B .B Please read .B {% <> %} .B to learn how to generate HTML\&. === .PP .I module type Forms = .B sig end .sp Abstract signature for links and forms creation functions, for concrete instances see .B Eliom_content\&.Html5 , or .B Eliom_content\&.Html_text \&. .sp .sp .I module Xml : .B sig end .sp Low\-level XML manipulation\&. .sp .sp .I module Svg : .B sig end .sp Building and pretty\-printing valid SVG tree\&. Information about Svg api can be found at .sp .sp .I module Html5 : .B sig end .sp Building and printing valid HTML5 tree\&. Information about Html5 api can be found at \&. .sp .sp .I module Html_text : .B sig end .sp Generate untyped html as text\&. .sp .sp