<!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="Up" href="Pxp_dtd.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_dtd.Entity</title> </head> <body> <div class="navbar"> <a href="Pxp_dtd.html">Up</a> </div> <center><h1>Module <a href="type_Pxp_dtd.Entity.html">Pxp_dtd.Entity</a></h1></center> <br> <pre><span class="keyword">module</span> Entity: <code class="code"><span class="keyword">sig</span></code> <a href="Pxp_dtd.Entity.html">..</a> <code class="code"><span class="keyword">end</span></code></pre>Useful properties of entities: The following submodule exports all stable properties of the entity classes. Please use this module, and not <code class="code"><span class="constructor">Pxp_entity</span></code> to access entities. <p> Note that the types <code class="code">entity</code> and <code class="code">entity_id</code> are also exported by <a href="Pxp_types.html"><code class="code"><span class="constructor">Pxp_types</span></code></a>.<br> <hr width="100%"> <pre><span class="keyword">val</span> <a name="VALget_name"></a>get_name : <code class="type">Pxp_entity.entity -> string</code></pre><div class="info"> Return the name of the entity.<br> </div> <pre><span class="keyword">val</span> <a name="VALget_full_name"></a>get_full_name : <code class="type">Pxp_entity.entity -> string</code></pre><div class="info"> The full name includes the ID, too (for diagnostics messages)<br> </div> <pre><span class="keyword">val</span> <a name="VALget_encoding"></a>get_encoding : <code class="type">Pxp_entity.entity -> Pxp_core_types.I.rep_encoding</code></pre><div class="info"> Return the encoding of the internal representation of the entity<br> </div> <pre><span class="keyword">val</span> <a name="VALget_type"></a>get_type : <code class="type">Pxp_entity.entity -> [ `External | `Internal | `NDATA ]</code></pre><div class="info"> Returns the type of the entity.<br> </div> <pre><span class="keyword">val</span> <a name="VALreplacement_text"></a>replacement_text : <code class="type">Pxp_entity.entity -> string</code></pre><div class="info"> Return the replacement text of the entity. Works for both internal and external entities. The replacement text is the "right side" of the entity definition.<br> </div> <pre><span class="keyword">val</span> <a name="VALget_xid"></a>get_xid : <code class="type">Pxp_entity.entity -> Pxp_core_types.I.ext_id option</code></pre><div class="info"> Returns the external ID for external and NDATA entities, and None for internal entities <p> TRAP: The external ID may be a relative SYSTEM ID, and it is not known to which base ID the relative ID must be resolved. So the external ID may be meaningless.<br> </div> <pre><span class="keyword">val</span> <a name="VALget_resolver_id"></a>get_resolver_id : <code class="type">Pxp_entity.entity -> Pxp_core_types.I.resolver_id option</code></pre><div class="info"> Returns the resolver ID for external entities, and None for other entities. This is the version as returned by the <code class="code">active_id</code> method by the resolver. The resolver ID contains more information than the external ID, for example the base URL relative to which SYSTEM IDs should be interpreted.<br> </div> <pre><span class="keyword">val</span> <a name="VALget_notation"></a>get_notation : <code class="type">Pxp_entity.entity -> string option</code></pre><div class="info"> Returns the notation of NDATA entities, and None for the other entity types<br> </div> <pre><span class="keyword">val</span> <a name="VALcreate_internal_entity"></a>create_internal_entity : <code class="type">name:string -> value:string -> <a href="Pxp_dtd.dtd.html">Pxp_dtd.dtd</a> -> Pxp_entity.entity</code></pre><div class="info"> Creates an internal entity. The name and the value must be encoded in the same encoding as the DTD. Note that if the entity is to be used as parameter entity, the first and the last characters of the value should be spaces.<br> </div> <pre><span class="keyword">val</span> <a name="VALcreate_ndata_entity"></a>create_ndata_entity : <code class="type">name:string -><br> xid:Pxp_core_types.I.ext_id -><br> notation:string -> <a href="Pxp_dtd.dtd.html">Pxp_dtd.dtd</a> -> Pxp_entity.entity</code></pre><div class="info"> Creates an NDATA entity. The name and the notation must be encoded in the same encoding as the DTD. The external ID must be encoded as UTF-8 string (like all external IDs).<br> </div> <pre><span class="keyword">val</span> <a name="VALcreate_external_entity"></a>create_external_entity : <code class="type">?doc_entity:bool -><br> ?system_base:string -><br> name:string -><br> xid:Pxp_core_types.I.ext_id -><br> resolver:<a href="Pxp_reader.resolver.html">Pxp_reader.resolver</a> -> <a href="Pxp_dtd.dtd.html">Pxp_dtd.dtd</a> -> Pxp_entity.entity</code></pre><div class="info"> Creates a reference to an external entity. The name must be encoded in the same encoding as the DTD. The external ID must be encoded as UTF-8 string (like all external IDs). <p> <ul> <li><code class="code">doc_entity</code>: If true, the entity is a document entity. XML requires some additional restrictions for document entities. The default for the argument is false.</li> <li><code class="code">system_base</code>: The base URL if SYSTEM identifiers are passed as <code class="code">xid</code></li> </ul> <br> </div> <pre><span class="keyword">val</span> <a name="VALfrom_external_source"></a>from_external_source : <code class="type">?doc_entity:bool -><br> name:string -> <a href="Pxp_dtd.dtd.html">Pxp_dtd.dtd</a> -> Pxp_dtd.source -> Pxp_entity.entity</code></pre><div class="info"> Creates an external entity that reads from the passed <a href="Pxp_types.html#TYPEsource"><code class="code"><span class="constructor">Pxp_types</span>.source</code></a><br> </div> <pre><span class="keyword">val</span> <a name="VALentity_id"></a>entity_id : <code class="type">Pxp_entity.entity -> Pxp_lexer_types.entity_id</code></pre><div class="info"> Returns the abstract entity ID<br> </div> <pre><span class="keyword">val</span> <a name="VALlookup"></a>lookup : <code class="type">Pxp_lexer_types.entity_id -> Pxp_entity.entity</code></pre><div class="info"> Looks the entity up for an entitiy ID<br> </div> <pre><span class="keyword">val</span> <a name="VALcreate_entity_id"></a>create_entity_id : <code class="type">unit -> Pxp_lexer_types.entity_id</code></pre><div class="info"> Create a new abstract entity ID. This ID can be used whereever an <code class="code">entity_id</code> is expected but no entity is available, except that the back coercion <code class="code">lookup</code> is not supported, and will raise <code class="code"><span class="constructor">Invalid_argument</span></code>.<br> </div> </body></html>