Blame doc/devhelp/libxml2-entities.html

Packit 423ecb
Packit 423ecb
<html>
Packit 423ecb
  <head>
Packit 423ecb
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
Packit 423ecb
    <title>entities: interface for the XML entities handling</title>
Packit 423ecb
    <meta name="generator" content="Libxml2 devhelp stylesheet"/>
Packit 423ecb
    <link rel="start" href="index.html" title="libxml2 Reference Manual"/>
Packit 423ecb
    <link rel="up" href="general.html" title="API"/>
Packit 423ecb
    <link rel="stylesheet" href="style.css" type="text/css"/>
Packit 423ecb
    <link rel="chapter" href="general.html" title="API"/>
Packit 423ecb
  </head>
Packit 423ecb
  <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
Packit 423ecb
    
Packit 423ecb
      
Packit 423ecb
        
Packit 423ecb
          
Packit 423ecb
            Prev
Packit 423ecb
          
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb
          
Packit 423ecb
            Up
Packit 423ecb
          
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb
          
Packit 423ecb
            Home
Packit 423ecb
          
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb
          
Packit 423ecb
            Next
Packit 423ecb
          
Packit 423ecb
        
Packit 423ecb
        libxml2 Reference Manual
Packit 423ecb
      
Packit 423ecb
    
Packit 423ecb
    

Packit 423ecb
      entities
Packit 423ecb
    
Packit 423ecb
    

entities - interface for the XML entities handling

Packit 423ecb
    

this module provides some of the entity API needed for the parser and applications.

Packit 423ecb
    

Author(s): Daniel Veillard

Packit 423ecb
    
Packit 423ecb
      

Synopsis

Packit 423ecb
      
typedef enum xmlEntityType;
Packit 423ecb
typedef struct _xmlHashTable xmlEntitiesTable;
Packit 423ecb
typedef xmlEntitiesTable * xmlEntitiesTablePtr;
Packit 423ecb
xmlEntityPtr	xmlAddDocEntity		(xmlDocPtr doc, 
const xmlChar * name,
int type,
const xmlChar * ExternalID,
const xmlChar * SystemID,
const xmlChar * content);
Packit 423ecb
xmlEntityPtr	xmlNewEntity		(xmlDocPtr doc, 
const xmlChar * name,
int type,
const xmlChar * ExternalID,
const xmlChar * SystemID,
const xmlChar * content);
Packit 423ecb
xmlChar *	xmlEncodeEntitiesReentrant	(xmlDocPtr doc, 
const xmlChar * input);
Packit 423ecb
xmlEntityPtr	xmlGetDocEntity		(const xmlDoc * doc, 
const xmlChar * name);
Packit 423ecb
xmlEntityPtr	xmlGetDtdEntity		(xmlDocPtr doc, 
const xmlChar * name);
Packit 423ecb
xmlEntityPtr	xmlAddDtdEntity		(xmlDocPtr doc, 
const xmlChar * name,
int type,
const xmlChar * ExternalID,
const xmlChar * SystemID,
const xmlChar * content);
Packit 423ecb
xmlEntitiesTablePtr	xmlCopyEntitiesTable	(xmlEntitiesTablePtr table);
Packit 423ecb
void	xmlFreeEntitiesTable		(xmlEntitiesTablePtr table);
Packit 423ecb
xmlEntityPtr	xmlGetParameterEntity	(xmlDocPtr doc, 
const xmlChar * name);
Packit 423ecb
void	xmlDumpEntitiesTable		(xmlBufferPtr buf, 
xmlEntitiesTablePtr table);
Packit 423ecb
void	xmlDumpEntityDecl		(xmlBufferPtr buf, 
xmlEntityPtr ent);
Packit 423ecb
void	xmlCleanupPredefinedEntities	(void);
Packit 423ecb
xmlEntitiesTablePtr	xmlCreateEntitiesTable	(void);
Packit 423ecb
const xmlChar *	xmlEncodeEntities	(xmlDocPtr doc, 
const xmlChar * input);
Packit 423ecb
xmlChar *	xmlEncodeSpecialChars	(const xmlDoc * doc, 
const xmlChar * input);
Packit 423ecb
xmlEntityPtr	xmlGetPredefinedEntity	(const xmlChar * name);
Packit 423ecb
void	xmlInitializePredefinedEntities	(void);
Packit 423ecb
Packit 423ecb
    
Packit 423ecb
    
Packit 423ecb
      

Description

Packit 423ecb
    
Packit 423ecb
    
Packit 423ecb
      

Details

Packit 423ecb
      
Packit 423ecb
        

Structure xmlEntitiesTable

struct _xmlHashTable {
Packit 423ecb
The content of this structure is not made public by the API.
Packit 423ecb
} xmlEntitiesTable;
Packit 423ecb

Packit 423ecb
Packit 423ecb
        
Packit 423ecb
        

Typedef xmlEntitiesTablePtr

xmlEntitiesTable * xmlEntitiesTablePtr;
Packit 423ecb

Packit 423ecb
Packit 423ecb
        
Packit 423ecb
        

Enum xmlEntityType

enum xmlEntityType {
Packit 423ecb
    XML_INTERNAL_GENERAL_ENTITY = 1
Packit 423ecb
    XML_EXTERNAL_GENERAL_PARSED_ENTITY = 2
Packit 423ecb
    XML_EXTERNAL_GENERAL_UNPARSED_ENTITY = 3
Packit 423ecb
    XML_INTERNAL_PARAMETER_ENTITY = 4
Packit 423ecb
    XML_EXTERNAL_PARAMETER_ENTITY = 5
Packit 423ecb
    XML_INTERNAL_PREDEFINED_ENTITY = 6
Packit 423ecb
};
Packit 423ecb

Packit 423ecb
Packit 423ecb
        
Packit 423ecb
        

xmlAddDocEntity ()

xmlEntityPtr	xmlAddDocEntity		(xmlDocPtr doc, 
const xmlChar * name,
int type,
const xmlChar * ExternalID,
const xmlChar * SystemID,
const xmlChar * content)
Packit 423ecb

Register a new entity for this document.

Packit 423ecb
<tt>doc</tt>:the document
<tt>name</tt>:the entity name
<tt>type</tt>:the entity type XML_xxx_yyy_ENTITY
<tt>ExternalID</tt>:the entity external ID if available
<tt>SystemID</tt>:the entity system ID if available
<tt>content</tt>:the entity content
<tt>Returns</tt>:a pointer to the entity or NULL in case of error
Packit 423ecb
        
Packit 423ecb
        

xmlAddDtdEntity ()

xmlEntityPtr	xmlAddDtdEntity		(xmlDocPtr doc, 
const xmlChar * name,
int type,
const xmlChar * ExternalID,
const xmlChar * SystemID,
const xmlChar * content)
Packit 423ecb

Register a new entity for this document DTD external subset.

Packit 423ecb
<tt>doc</tt>:the document
<tt>name</tt>:the entity name
<tt>type</tt>:the entity type XML_xxx_yyy_ENTITY
<tt>ExternalID</tt>:the entity external ID if available
<tt>SystemID</tt>:the entity system ID if available
<tt>content</tt>:the entity content
<tt>Returns</tt>:a pointer to the entity or NULL in case of error
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb

Cleanup up the predefined entities table. Deprecated call

Packit 423ecb
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb

Build a copy of an entity table.

Packit 423ecb
<tt>table</tt>:An entity table
<tt>Returns</tt>:the new xmlEntitiesTablePtr or NULL in case of error.
Packit 423ecb
        
Packit 423ecb
        

xmlCreateEntitiesTable ()

xmlEntitiesTablePtr	xmlCreateEntitiesTable	(void)
Packit 423ecb

create and initialize an empty entities hash table. This really doesn't make sense and should be deprecated

Packit 423ecb
<tt>Returns</tt>:the xmlEntitiesTablePtr just created or NULL in case of error.
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb

This will dump the content of the entity table as an XML DTD definition

Packit 423ecb
<tt>buf</tt>:An XML buffer.
<tt>table</tt>:An entity table
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb

This will dump the content of the entity table as an XML DTD definition

Packit 423ecb
<tt>buf</tt>:An XML buffer.
<tt>ent</tt>:An entity table
Packit 423ecb
        
Packit 423ecb
        

xmlEncodeEntities ()

const xmlChar *	xmlEncodeEntities	(xmlDocPtr doc, 
const xmlChar * input)
Packit 423ecb

TODO: remove xmlEncodeEntities, once we are not afraid of breaking binary compatibility People must migrate their code to xmlEncodeEntitiesReentrant ! This routine will issue a warning when encountered.

Packit 423ecb
<tt>doc</tt>:the document containing the string
<tt>input</tt>:A string to convert to XML.
<tt>Returns</tt>:NULL
Packit 423ecb
        
Packit 423ecb
        

xmlEncodeEntitiesReentrant ()

xmlChar *	xmlEncodeEntitiesReentrant	(xmlDocPtr doc, 
const xmlChar * input)
Packit 423ecb

Do a global encoding of a string, replacing the predefined entities and non ASCII values with their entities and CharRef counterparts. Contrary to xmlEncodeEntities, this routine is reentrant, and result must be deallocated.

Packit 423ecb
<tt>doc</tt>:the document containing the string
<tt>input</tt>:A string to convert to XML.
<tt>Returns</tt>:A newly allocated string with the substitution done.
Packit 423ecb
        
Packit 423ecb
        

xmlEncodeSpecialChars ()

xmlChar *	xmlEncodeSpecialChars	(const xmlDoc * doc, 
const xmlChar * input)
Packit 423ecb

Do a global encoding of a string, replacing the predefined entities this routine is reentrant, and result must be deallocated.

Packit 423ecb
<tt>doc</tt>:the document containing the string
<tt>input</tt>:A string to convert to XML.
<tt>Returns</tt>:A newly allocated string with the substitution done.
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb

Deallocate the memory used by an entities hash table.

Packit 423ecb
<tt>table</tt>:An entity table
Packit 423ecb
        
Packit 423ecb
        

xmlGetDocEntity ()

xmlEntityPtr	xmlGetDocEntity		(const xmlDoc * doc, 
const xmlChar * name)
Packit 423ecb

Do an entity lookup in the document entity hash table and

Packit 423ecb
<tt>doc</tt>:the document referencing the entity
<tt>name</tt>:the entity name
<tt>Returns</tt>:the corresponding entity, otherwise a lookup is done in the predefined entities too. Returns A pointer to the entity structure or NULL if not found.
Packit 423ecb
        
Packit 423ecb
        

xmlGetDtdEntity ()

xmlEntityPtr	xmlGetDtdEntity		(xmlDocPtr doc, 
const xmlChar * name)
Packit 423ecb

Do an entity lookup in the DTD entity hash table and

Packit 423ecb
<tt>doc</tt>:the document referencing the entity
<tt>name</tt>:the entity name
<tt>Returns</tt>:the corresponding entity, if found. Note: the first argument is the document node, not the DTD node. Returns A pointer to the entity structure or NULL if not found.
Packit 423ecb
        
Packit 423ecb
        

xmlGetParameterEntity ()

xmlEntityPtr	xmlGetParameterEntity	(xmlDocPtr doc, 
const xmlChar * name)
Packit 423ecb

Do an entity lookup in the internal and external subsets and

Packit 423ecb
<tt>doc</tt>:the document referencing the entity
<tt>name</tt>:the entity name
<tt>Returns</tt>:the corresponding parameter entity, if found. Returns A pointer to the entity structure or NULL if not found.
Packit 423ecb
        
Packit 423ecb
        

xmlGetPredefinedEntity ()

xmlEntityPtr	xmlGetPredefinedEntity	(const xmlChar * name)
Packit 423ecb

Check whether this name is an predefined entity.

Packit 423ecb
<tt>name</tt>:the entity name
<tt>Returns</tt>:NULL if not, otherwise the entity
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb

Set up the predefined entities. Deprecated call

Packit 423ecb
Packit 423ecb
        
Packit 423ecb
        

xmlNewEntity ()

xmlEntityPtr	xmlNewEntity		(xmlDocPtr doc, 
const xmlChar * name,
int type,
const xmlChar * ExternalID,
const xmlChar * SystemID,
const xmlChar * content)
Packit 423ecb

Create a new entity, this differs from xmlAddDocEntity() that if the document is NULL or has no internal subset defined, then an unlinked entity structure will be returned, it is then the responsability of the caller to link it to the document later or free it when not needed anymore.

Packit 423ecb
<tt>doc</tt>:the document
<tt>name</tt>:the entity name
<tt>type</tt>:the entity type XML_xxx_yyy_ENTITY
<tt>ExternalID</tt>:the entity external ID if available
<tt>SystemID</tt>:the entity system ID if available
<tt>content</tt>:the entity content
<tt>Returns</tt>:a pointer to the entity or NULL in case of error
Packit 423ecb
        
Packit 423ecb
      
Packit 423ecb
    
Packit 423ecb
  </body>
Packit 423ecb
</html>