entities

Name

entities — one line description goes here.

Synopsis



#define     XML_INTERNAL_GENERAL_ENTITY
#define     XML_EXTERNAL_GENERAL_PARSED_ENTITY
#define     XML_EXTERNAL_GENERAL_UNPARSED_ENTITY
#define     XML_INTERNAL_PARAMETER_ENTITY
#define     XML_EXTERNAL_PARAMETER_ENTITY
#define     XML_INTERNAL_PREDEFINED_ENTITY
typedef     xmlEntityPtr
#define     XML_MIN_ENTITIES_TABLE
typedef     xmlEntitiesTablePtr
void        xmlAddDocEntity                 (xmlDocPtr doc,
                                             const CHAR *name,
                                             int type,
                                             const CHAR *ExternalID,
                                             const CHAR *SystemID,
                                             CHAR *content);
void        xmlAddDtdEntity                 (xmlDocPtr doc,
                                             const CHAR *name,
                                             int type,
                                             const CHAR *ExternalID,
                                             const CHAR *SystemID,
                                             CHAR *content);
xmlEntityPtr xmlGetPredefinedEntity         (const CHAR *name);
xmlEntityPtr xmlGetDocEntity                (xmlDocPtr doc,
                                             const CHAR *name);
xmlEntityPtr xmlGetDtdEntity                (xmlDocPtr doc,
                                             const CHAR *name);
CHAR*       xmlEncodeEntities               (xmlDocPtr doc,
                                             const CHAR *input);
xmlEntitiesTablePtr xmlCreateEntitiesTable  (void);
xmlEntitiesTablePtr xmlCopyEntitiesTable    (xmlEntitiesTablePtr table);
void        xmlFreeEntitiesTable            (xmlEntitiesTablePtr table);
void        xmlDumpEntitiesTable            (xmlBufferPtr buf,
                                             xmlEntitiesTablePtr table);
xmlParserInputPtr xmlNewEntityInputStream   (xmlParserCtxtPtr ctxt,
                                             xmlEntityPtr entity);

Description

Details


XML_INTERNAL_GENERAL_ENTITY

#define XML_INTERNAL_GENERAL_ENTITY		1


XML_EXTERNAL_GENERAL_PARSED_ENTITY

#define XML_EXTERNAL_GENERAL_PARSED_ENTITY	2


XML_EXTERNAL_GENERAL_UNPARSED_ENTITY

#define XML_EXTERNAL_GENERAL_UNPARSED_ENTITY	3


XML_INTERNAL_PARAMETER_ENTITY

#define XML_INTERNAL_PARAMETER_ENTITY		4


XML_EXTERNAL_PARAMETER_ENTITY

#define XML_EXTERNAL_PARAMETER_ENTITY		5


XML_INTERNAL_PREDEFINED_ENTITY

#define XML_INTERNAL_PREDEFINED_ENTITY		6


xmlEntityPtr

typedef xmlEntity *xmlEntityPtr;


XML_MIN_ENTITIES_TABLE

#define XML_MIN_ENTITIES_TABLE	32


xmlEntitiesTablePtr

typedef xmlEntitiesTable *xmlEntitiesTablePtr;


xmlAddDocEntity()

void        xmlAddDocEntity                 (xmlDocPtr doc,
                                             const CHAR *name,
                                             int type,
                                             const CHAR *ExternalID,
                                             const CHAR *SystemID,
                                             CHAR *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


xmlAddDtdEntity()

void        xmlAddDtdEntity                 (xmlDocPtr doc,
                                             const CHAR *name,
                                             int type,
                                             const CHAR *ExternalID,
                                             const CHAR *SystemID,
                                             CHAR *content);

Register a new entity for this document DTD.

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


xmlGetPredefinedEntity()

xmlEntityPtr xmlGetPredefinedEntity         (const CHAR *name);

Check whether this name is an predefined entity.

name : the entity name
Returns :NULL if not, othervise the entity


xmlGetDocEntity()

xmlEntityPtr xmlGetDocEntity                (xmlDocPtr doc,
                                             const CHAR *name);

Do an entity lookup in the document entity hash table and returns the corrsponding entity, otherwise a lookup is done in the predefined entities too.

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


xmlGetDtdEntity()

xmlEntityPtr xmlGetDtdEntity                (xmlDocPtr doc,
                                             const CHAR *name);

Do an entity lookup in the Dtd entity hash table and returns the corresponding entity, if found.

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


xmlEncodeEntities()

CHAR*       xmlEncodeEntities               (xmlDocPtr doc,
                                             const CHAR *input);

Do a global encoding of a string, replacing the predefined entities and non ASCII values with their entities and CharRef counterparts.

TODO !!!! Once moved to UTF-8 internal encoding, the encoding of non-ascii get erroneous.

TODO This routine is not reentrant and this will be changed, the interface should not be modified though.

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


xmlCreateEntitiesTable()

xmlEntitiesTablePtr xmlCreateEntitiesTable  (void);

create and initialize an empty entities hash table.

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


xmlCopyEntitiesTable()

xmlEntitiesTablePtr xmlCopyEntitiesTable    (xmlEntitiesTablePtr table);

Build a copy of an entity table.

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


xmlFreeEntitiesTable()

void        xmlFreeEntitiesTable            (xmlEntitiesTablePtr table);

Deallocate the memory used by an entities hash table.

table : An entity table


xmlDumpEntitiesTable()

void        xmlDumpEntitiesTable            (xmlBufferPtr buf,
                                             xmlEntitiesTablePtr table);

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

buf : An XML buffer.
table : An entity table


xmlNewEntityInputStream()

xmlParserInputPtr xmlNewEntityInputStream   (xmlParserCtxtPtr ctxt,
                                             xmlEntityPtr entity);

Create a new input stream based on a memory buffer.

ctxt : an XML parser context
entity : an Entity pointer
Returns :the new input stream