|
libxml2
|
XML entities. More...
Data Structures | |
| struct | _xmlEntity |
| An entity declaration. More... | |
Enumerations | |
| enum | xmlEntityType |
| The different entity types. More... | |
Functions | |
| xmlEntity * | xmlNewEntity (xmlDoc *doc, const xmlChar *name, int type, const xmlChar *publicId, const xmlChar *systemId, const xmlChar *content) |
| Create a new entity. | |
| void | xmlFreeEntity (xmlEntity *entity) |
| Frees the entity. | |
| int | xmlAddEntity (xmlDoc *doc, int extSubset, const xmlChar *name, int type, const xmlChar *publicId, const xmlChar *systemId, const xmlChar *content, xmlEntity **out) |
| Register a new entity for this document. | |
| xmlEntity * | xmlAddDocEntity (xmlDoc *doc, const xmlChar *name, int type, const xmlChar *publicId, const xmlChar *systemId, const xmlChar *content) |
| Add a new entity to the document's internal subset. | |
| xmlEntity * | xmlAddDtdEntity (xmlDoc *doc, const xmlChar *name, int type, const xmlChar *publicId, const xmlChar *systemId, const xmlChar *content) |
| Add a new entity to the document's external subset. | |
| xmlEntity * | xmlGetPredefinedEntity (const xmlChar *name) |
| Look up a predefined entity. | |
| xmlEntity * | xmlGetDocEntity (const xmlDoc *doc, const xmlChar *name) |
| Look up a general entity in the internal and external subset of doc. | |
| xmlEntity * | xmlGetDtdEntity (xmlDoc *doc, const xmlChar *name) |
| Look up a general entity in the external subset of doc. | |
| xmlEntity * | xmlGetParameterEntity (xmlDoc *doc, const xmlChar *name) |
| Look up a paramater entity in the internal and external subset of doc. | |
| xmlChar * | xmlEncodeEntitiesReentrant (xmlDoc *doc, const xmlChar *input) |
| Replace special characters with predefined entities or numeric character references. | |
| xmlChar * | xmlEncodeSpecialChars (const xmlDoc *doc, const xmlChar *input) |
| Replace special characters with predefined entities or numeric character references. | |
| xmlEntitiesTable * | xmlCreateEntitiesTable (void) |
| Create and initialize an empty entities hash table. | |
| xmlEntitiesTable * | xmlCopyEntitiesTable (xmlEntitiesTable *table) |
| Build a copy of an entity table. | |
| void | xmlFreeEntitiesTable (xmlEntitiesTable *table) |
| Deallocate the memory used by an entities hash table. | |
| void | xmlDumpEntitiesTable (xmlBuffer *buf, xmlEntitiesTable *table) |
| This will dump the content of the entity table as an XML DTD definition. | |
| void | xmlDumpEntityDecl (xmlBuffer *buf, xmlEntity *ent) |
| This will dump the content of the entity table as an XML DTD definition. | |
XML entities.
This module provides an API to work with XML entities.
| enum xmlEntityType |
The different entity types.
| xmlEntity * xmlAddDocEntity | ( | xmlDoc * | doc, |
| const xmlChar * | name, | ||
| int | type, | ||
| const xmlChar * | publicId, | ||
| const xmlChar * | systemId, | ||
| const xmlChar * | content ) |
Add a new entity to the document's internal subset.
xmlAddEntity offers better error handling.
| doc | the document |
| name | the entity name |
| type | an xmlEntityType value |
| publicId | the publid identifier (optional) |
| systemId | the system identifier (URL) (optional) |
| content | the entity content |
| xmlEntity * xmlAddDtdEntity | ( | xmlDoc * | doc, |
| const xmlChar * | name, | ||
| int | type, | ||
| const xmlChar * | publicId, | ||
| const xmlChar * | systemId, | ||
| const xmlChar * | content ) |
Add a new entity to the document's external subset.
xmlAddEntity offers better error handling.
| doc | the document |
| name | the entity name |
| type | an xmlEntityType value |
| publicId | the publid identifier (optional) |
| systemId | the system identifier (URL) (optional) |
| content | the entity content |
| int xmlAddEntity | ( | xmlDoc * | doc, |
| int | extSubset, | ||
| const xmlChar * | name, | ||
| int | type, | ||
| const xmlChar * | publicId, | ||
| const xmlChar * | systemId, | ||
| const xmlChar * | content, | ||
| xmlEntity ** | out ) |
Register a new entity for this document.
| doc | the document |
| extSubset | add to the external or internal subset |
| name | the entity name |
| type | an xmlEntityType value |
| publicId | the publid identifier (optional) |
| systemId | the system identifier (URL) (optional) |
| content | the entity content |
| out | pointer to resulting entity (optional) |
| xmlEntitiesTable * xmlCopyEntitiesTable | ( | xmlEntitiesTable * | table | ) |
Build a copy of an entity table.
| table | An entity table |
| xmlEntitiesTable * xmlCreateEntitiesTable | ( | void | ) |
Create and initialize an empty entities hash table.
| void xmlDumpEntitiesTable | ( | xmlBuffer * | buf, |
| xmlEntitiesTable * | table ) |
This will dump the content of the entity table as an XML DTD definition.
| buf | An XML buffer. |
| table | An entity table |
This will dump the content of the entity table as an XML DTD definition.
| buf | An XML buffer. |
| ent | An entity table |
Replace special characters with predefined entities or numeric character references.
If doc is NULL or an XML document, replaces <, > and & with predefined entities. Carriage return is replaced with . If doc or its encoding are NULL, non-ASCII characters are replaced with a hexadecimal character reference.
If doc is an HTML document, follows the HTML serialization rules.
Silently removes some invalid characters like ASCII control codes.
See xmlEncodeSpecialChars for an alternative.
| doc | the document containing the string (optional) |
| input | A string to convert to XML. |
Replace special characters with predefined entities or numeric character references.
Replaces <, >, & and " with predefined entities. Carriage return is replaced with .
| doc | unused |
| input | A string to convert to XML. |
| void xmlFreeEntitiesTable | ( | xmlEntitiesTable * | table | ) |
Deallocate the memory used by an entities hash table.
| table | An entity table |
| void xmlFreeEntity | ( | xmlEntity * | entity | ) |
Frees the entity.
| entity | an entity |
Look up a general entity in the internal and external subset of doc.
Also checks for predefined entities.
| doc | the document referencing the entity |
| name | the entity name |
Look up a general entity in the external subset of doc.
| doc | the document |
| name | the entity name |
Look up a paramater entity in the internal and external subset of doc.
| doc | the document |
| name | the entity name |
Look up a predefined entity.
| name | the entity name |
| xmlEntity * xmlNewEntity | ( | xmlDoc * | doc, |
| const xmlChar * | name, | ||
| int | type, | ||
| const xmlChar * | publicId, | ||
| const xmlChar * | systemId, | ||
| const xmlChar * | content ) |
Create a new entity.
Like xmlAddDocEntity, but if doc is NULL or has no internal subset defined, an unlinked entity will be returned. It is then the responsibility of the caller to link it to the document later or free it when not needed anymore.
| doc | the document (optional) |
| name | the entity name |
| type | an xmlEntityType value |
| publicId | the publid identifier (optional) |
| systemId | the system identifier (URL) (optional) |
| content | the entity content |