<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <link rel="stylesheet" href="style.css" type="text/css"> <meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type"> <link rel="Start" href="index.html"> <link rel="previous" href="Pxp_dtd_parser.html"> <link rel="next" href="Pxp_marshal.html"> <link rel="Up" href="index.html"> <link title="Index of types" rel=Appendix href="index_types.html"> <link title="Index of exceptions" rel=Appendix href="index_exceptions.html"> <link title="Index of values" rel=Appendix href="index_values.html"> <link title="Index of class methods" rel=Appendix href="index_methods.html"> <link title="Index of classes" rel=Appendix href="index_classes.html"> <link title="Index of class types" rel=Appendix href="index_class_types.html"> <link title="Index of modules" rel=Appendix href="index_modules.html"> <link title="Index of module types" rel=Appendix href="index_module_types.html"> <link title="Pxp_types" rel="Chapter" href="Pxp_types.html"> <link title="Pxp_document" rel="Chapter" href="Pxp_document.html"> <link title="Pxp_dtd" rel="Chapter" href="Pxp_dtd.html"> <link title="Pxp_tree_parser" rel="Chapter" href="Pxp_tree_parser.html"> <link title="Pxp_core_types" rel="Chapter" href="Pxp_core_types.html"> <link title="Pxp_ev_parser" rel="Chapter" href="Pxp_ev_parser.html"> <link title="Pxp_event" rel="Chapter" href="Pxp_event.html"> <link title="Pxp_dtd_parser" rel="Chapter" href="Pxp_dtd_parser.html"> <link title="Pxp_codewriter" rel="Chapter" href="Pxp_codewriter.html"> <link title="Pxp_marshal" rel="Chapter" href="Pxp_marshal.html"> <link title="Pxp_yacc" rel="Chapter" href="Pxp_yacc.html"> <link title="Pxp_reader" rel="Chapter" href="Pxp_reader.html"> <link title="Intro_trees" rel="Chapter" href="Intro_trees.html"> <link title="Intro_extensions" rel="Chapter" href="Intro_extensions.html"> <link title="Intro_namespaces" rel="Chapter" href="Intro_namespaces.html"> <link title="Intro_events" rel="Chapter" href="Intro_events.html"> <link title="Intro_resolution" rel="Chapter" href="Intro_resolution.html"> <link title="Intro_getting_started" rel="Chapter" href="Intro_getting_started.html"> <link title="Intro_advanced" rel="Chapter" href="Intro_advanced.html"> <link title="Intro_preprocessor" rel="Chapter" href="Intro_preprocessor.html"> <link title="Example_readme" rel="Chapter" href="Example_readme.html"><title>PXP Reference : Pxp_codewriter</title> </head> <body> <div class="navbar"><a href="Pxp_dtd_parser.html">Previous</a> <a href="index.html">Up</a> <a href="Pxp_marshal.html">Next</a> </div> <center><h1>Module <a href="type_Pxp_codewriter.html">Pxp_codewriter</a></h1></center> <br> <pre><span class="keyword">module</span> Pxp_codewriter: <code class="code"><span class="keyword">sig</span></code> <a href="Pxp_codewriter.html">..</a> <code class="code"><span class="keyword">end</span></code></pre>Generate O'Caml code for creating large constant XML trees<br> <hr width="100%"> <br> See also <a href="Pxp_marshal.html"><code class="code"><span class="constructor">Pxp_marshal</span></code></a> for direct marshalling functions.<br> <pre><span class="keyword">val</span> <a name="VALwrite_document"></a>write_document : <code class="type">Pervasives.out_channel -><br> ('a <a href="Pxp_document.node.html">Pxp_document.node</a> #<a href="Pxp_document.extension.html">Pxp_document.extension</a> as 'a) <a href="Pxp_document.document.html">Pxp_document.document</a> -><br> unit</code></pre><div class="info"> Writes O'Caml code to the <code class="code">out_channel</code> so that when the code is compiled and executed, a fresh document is created with the same contents as the passed document: <p> <pre></pre><code class="code"> <span class="string">"let create_document ?enable_namespace_processing config spec = ...;;"</span> </code><pre></pre> <p> If you compile the code and call <code class="code">create_document config spec</code> the function creates a document tree which is (almost) equal to the passed document. <p> The following properties may not be equal:<ul> <li>Parsed entities</li> <li>Whether a declaration occurs in an external entity or not</li> </ul> <ul> <li><code class="code">config</code>: The configuration to assume for re-creating the tree</li> <li><code class="code">spec</code>: a <a href="Pxp_document.html#TYPEspec"><code class="code"><span class="constructor">Pxp_document</span>.spec</code></a></li> <li><code class="code">enable_namespace_processing</code>: You can pass here a namespace_manager to enable the namespace code (default: no namespace processing)</li> </ul> <br> </div> <pre><span class="keyword">val</span> <a name="VALwrite_subtree"></a>write_subtree : <code class="type">Pervasives.out_channel -><br> ('a <a href="Pxp_document.node.html">Pxp_document.node</a> #<a href="Pxp_document.extension.html">Pxp_document.extension</a> as 'a) <a href="Pxp_document.node.html">Pxp_document.node</a> -><br> unit</code></pre><div class="info"> Writes O'Caml code to the <code class="code">out_channel</code> so that when the code is compiled and executed, a fresh tree is created with the same contents as the passed tree: <p> <pre></pre><code class="code"> <span class="string">"let create_subtree dtd spec = ...;;"</span> </code><pre></pre> <p> If you compile the code and call <code class="code">create_subtree dtd spec</code> the function creates a DTD object which is equal to the passed object. <p> <ul> <li><code class="code">dtd</code>: a DTD object</li> <li><code class="code">spec</code>: a Pxp_document.spec</li> </ul> <br> </div> </body></html>