Back to Turicreate

entities: interface for the XML entities handling

deps/src/libxml2-2.9.1/doc/devhelp/libxml2-entities.html

6.4.112.0 KB
Original Source

| | | | | libxml2 Reference Manual |

entities

entities - interface for the XML entities handling

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

Author(s): Daniel Veillard

Synopsis

typedef enum[xmlEntityType](#xmlEntityType);
typedef struct _xmlHashTable[xmlEntitiesTable](#xmlEntitiesTable);
typedef[xmlEntitiesTable](libxml2-entities.html#xmlEntitiesTable)*[xmlEntitiesTablePtr](#xmlEntitiesTablePtr);[xmlEntityPtr](libxml2-tree.html#xmlEntityPtr)[xmlAddDocEntity](#xmlAddDocEntity)([xmlDocPtr](libxml2-tree.html#xmlDocPtr)doc,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* name,
int type,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* ExternalID,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* SystemID,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* content);[xmlEntityPtr](libxml2-tree.html#xmlEntityPtr)[xmlNewEntity](#xmlNewEntity)([xmlDocPtr](libxml2-tree.html#xmlDocPtr)doc,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* name,
int type,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* ExternalID,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* SystemID,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* content);[xmlChar](libxml2-xmlstring.html#xmlChar)*[xmlEncodeEntitiesReentrant](#xmlEncodeEntitiesReentrant)([xmlDocPtr](libxml2-tree.html#xmlDocPtr)doc,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* input);[xmlEntityPtr](libxml2-tree.html#xmlEntityPtr)[xmlGetDocEntity](#xmlGetDocEntity)([xmlDocPtr](libxml2-tree.html#xmlDocPtr)doc,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* name);[xmlEntityPtr](libxml2-tree.html#xmlEntityPtr)[xmlGetDtdEntity](#xmlGetDtdEntity)([xmlDocPtr](libxml2-tree.html#xmlDocPtr)doc,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* name);[xmlEntityPtr](libxml2-tree.html#xmlEntityPtr)[xmlAddDtdEntity](#xmlAddDtdEntity)([xmlDocPtr](libxml2-tree.html#xmlDocPtr)doc,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* name,
int type,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* ExternalID,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* SystemID,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* content);[xmlEntitiesTablePtr](libxml2-entities.html#xmlEntitiesTablePtr)[xmlCopyEntitiesTable](#xmlCopyEntitiesTable)([xmlEntitiesTablePtr](libxml2-entities.html#xmlEntitiesTablePtr)table);
void[xmlFreeEntitiesTable](#xmlFreeEntitiesTable)([xmlEntitiesTablePtr](libxml2-entities.html#xmlEntitiesTablePtr)table);[xmlEntityPtr](libxml2-tree.html#xmlEntityPtr)[xmlGetParameterEntity](#xmlGetParameterEntity)([xmlDocPtr](libxml2-tree.html#xmlDocPtr)doc,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* name);
void[xmlDumpEntitiesTable](#xmlDumpEntitiesTable)([xmlBufferPtr](libxml2-tree.html#xmlBufferPtr)buf,
[xmlEntitiesTablePtr](libxml2-entities.html#xmlEntitiesTablePtr)table);
void[xmlDumpEntityDecl](#xmlDumpEntityDecl)([xmlBufferPtr](libxml2-tree.html#xmlBufferPtr)buf,
[xmlEntityPtr](libxml2-tree.html#xmlEntityPtr)ent);
void[xmlCleanupPredefinedEntities](#xmlCleanupPredefinedEntities)(void);[xmlEntitiesTablePtr](libxml2-entities.html#xmlEntitiesTablePtr)[xmlCreateEntitiesTable](#xmlCreateEntitiesTable)(void);
const[xmlChar](libxml2-xmlstring.html#xmlChar)*[xmlEncodeEntities](#xmlEncodeEntities)([xmlDocPtr](libxml2-tree.html#xmlDocPtr)doc,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* input);[xmlChar](libxml2-xmlstring.html#xmlChar)*[xmlEncodeSpecialChars](#xmlEncodeSpecialChars)([xmlDocPtr](libxml2-tree.html#xmlDocPtr)doc,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* input);[xmlEntityPtr](libxml2-tree.html#xmlEntityPtr)[xmlGetPredefinedEntity](#xmlGetPredefinedEntity)(const[xmlChar](libxml2-xmlstring.html#xmlChar)* name);
void[xmlInitializePredefinedEntities](#xmlInitializePredefinedEntities)(void);

Description

Details

Structure xmlEntitiesTable

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

Typedef xmlEntitiesTablePtr

[xmlEntitiesTable](libxml2-entities.html#xmlEntitiesTable)* xmlEntitiesTablePtr;

Enum xmlEntityType

enum[xmlEntityType](#xmlEntityType){XML\_INTERNAL\_GENERAL\_ENTITY= 1XML\_EXTERNAL\_GENERAL\_PARSED\_ENTITY= 2XML\_EXTERNAL\_GENERAL\_UNPARSED\_ENTITY= 3XML\_INTERNAL\_PARAMETER\_ENTITY= 4XML\_EXTERNAL\_PARAMETER\_ENTITY= 5XML\_INTERNAL\_PREDEFINED\_ENTITY= 6
};

xmlAddDocEntity ()

[xmlEntityPtr](libxml2-tree.html#xmlEntityPtr)xmlAddDocEntity ([xmlDocPtr](libxml2-tree.html#xmlDocPtr)doc,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* name,
int type,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* ExternalID,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* SystemID,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* content)

Register a new entity for this document.

| doc: | the document | | name: | the entity name | | type: | the entity type XML_xxx_yyy_ENTITY | | ExternalID: | the entity external ID if available | | SystemID: | the entity system ID if available | | content: | the entity content | | Returns: | a pointer to the entity or NULL in case of error |


xmlAddDtdEntity ()

[xmlEntityPtr](libxml2-tree.html#xmlEntityPtr)xmlAddDtdEntity ([xmlDocPtr](libxml2-tree.html#xmlDocPtr)doc,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* name,
int type,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* ExternalID,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* SystemID,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* content)

Register a new entity for this document DTD external subset.

| doc: | the document | | name: | the entity name | | type: | the entity type XML_xxx_yyy_ENTITY | | ExternalID: | the entity external ID if available | | SystemID: | the entity system ID if available | | content: | the entity content | | Returns: | a pointer to the entity or NULL in case of error |


xmlCleanupPredefinedEntities ()

void	xmlCleanupPredefinedEntities	(void)

Cleanup up the predefined entities table. Deprecated call


xmlCopyEntitiesTable ()

[xmlEntitiesTablePtr](libxml2-entities.html#xmlEntitiesTablePtr)xmlCopyEntitiesTable	([xmlEntitiesTablePtr](libxml2-entities.html#xmlEntitiesTablePtr)table)

Build a copy of an entity table.

| table: | An entity table | | Returns: | the new xmlEntitiesTablePtr or NULL in case of error. |


xmlCreateEntitiesTable ()

[xmlEntitiesTablePtr](libxml2-entities.html#xmlEntitiesTablePtr)xmlCreateEntitiesTable	(void)

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

| Returns: | the xmlEntitiesTablePtr just created or NULL in case of error. |


xmlDumpEntitiesTable ()

void	xmlDumpEntitiesTable ([xmlBufferPtr](libxml2-tree.html#xmlBufferPtr)buf,
[xmlEntitiesTablePtr](libxml2-entities.html#xmlEntitiesTablePtr)table)

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

| buf: | An XML buffer. | | table: | An entity table |


xmlDumpEntityDecl ()

void	xmlDumpEntityDecl ([xmlBufferPtr](libxml2-tree.html#xmlBufferPtr)buf,
[xmlEntityPtr](libxml2-tree.html#xmlEntityPtr)ent)

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

| buf: | An XML buffer. | | ent: | An entity table |


xmlEncodeEntities ()

const[xmlChar](libxml2-xmlstring.html#xmlChar)*	xmlEncodeEntities	([xmlDocPtr](libxml2-tree.html#xmlDocPtr)doc,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* input)

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.

| doc: | the document containing the string | | input: | A string to convert to XML. | | Returns: | NULL |


xmlEncodeEntitiesReentrant ()

[xmlChar](libxml2-xmlstring.html#xmlChar)*	xmlEncodeEntitiesReentrant	([xmlDocPtr](libxml2-tree.html#xmlDocPtr)doc,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* input)

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.

| doc: | the document containing the string | | input: | A string to convert to XML. | | Returns: | A newly allocated string with the substitution done. |


xmlEncodeSpecialChars ()

[xmlChar](libxml2-xmlstring.html#xmlChar)*	xmlEncodeSpecialChars	([xmlDocPtr](libxml2-tree.html#xmlDocPtr)doc,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* input)

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

| doc: | the document containing the string | | input: | A string to convert to XML. | | Returns: | A newly allocated string with the substitution done. |


xmlFreeEntitiesTable ()

void	xmlFreeEntitiesTable ([xmlEntitiesTablePtr](libxml2-entities.html#xmlEntitiesTablePtr)table)

Deallocate the memory used by an entities hash table.

| table: | An entity table |


xmlGetDocEntity ()

[xmlEntityPtr](libxml2-tree.html#xmlEntityPtr)xmlGetDocEntity ([xmlDocPtr](libxml2-tree.html#xmlDocPtr)doc,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* name)

Do an entity lookup in the document entity hash table and

| doc: | the document referencing the entity | | name: | the entity name | | Returns: | 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. |


xmlGetDtdEntity ()

[xmlEntityPtr](libxml2-tree.html#xmlEntityPtr)xmlGetDtdEntity ([xmlDocPtr](libxml2-tree.html#xmlDocPtr)doc,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* name)

Do an entity lookup in the DTD entity hash table and

| doc: | the document referencing the entity | | name: | the entity name | | Returns: | 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. |


xmlGetParameterEntity ()

[xmlEntityPtr](libxml2-tree.html#xmlEntityPtr)xmlGetParameterEntity	([xmlDocPtr](libxml2-tree.html#xmlDocPtr)doc,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* name)

Do an entity lookup in the internal and external subsets and

| doc: | the document referencing the entity | | name: | the entity name | | Returns: | the corresponding parameter entity, if found. Returns A pointer to the entity structure or NULL if not found. |


xmlGetPredefinedEntity ()

[xmlEntityPtr](libxml2-tree.html#xmlEntityPtr)xmlGetPredefinedEntity	(const[xmlChar](libxml2-xmlstring.html#xmlChar)* name)

Check whether this name is an predefined entity.

| name: | the entity name | | Returns: | NULL if not, otherwise the entity |


xmlInitializePredefinedEntities ()

void	xmlInitializePredefinedEntities	(void)

Set up the predefined entities. Deprecated call


xmlNewEntity ()

[xmlEntityPtr](libxml2-tree.html#xmlEntityPtr)xmlNewEntity ([xmlDocPtr](libxml2-tree.html#xmlDocPtr)doc,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* name,
int type,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* ExternalID,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* SystemID,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* content)

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.

| doc: | the document | | name: | the entity name | | type: | the entity type XML_xxx_yyy_ENTITY | | ExternalID: | the entity external ID if available | | SystemID: | the entity system ID if available | | content: | the entity content | | Returns: | a pointer to the entity or NULL in case of error |