2 * entities.h : interface for the XML entities handling
4 * See Copyright for the status of this software.
9 #ifndef __XML_ENTITIES_H__
10 #define __XML_ENTITIES_H__
12 #include <libxml/tree.h>
19 * The different valid entity types.
22 XML_INTERNAL_GENERAL_ENTITY = 1,
23 XML_EXTERNAL_GENERAL_PARSED_ENTITY = 2,
24 XML_EXTERNAL_GENERAL_UNPARSED_ENTITY = 3,
25 XML_INTERNAL_PARAMETER_ENTITY = 4,
26 XML_EXTERNAL_PARAMETER_ENTITY = 5,
27 XML_INTERNAL_PREDEFINED_ENTITY = 6
31 * An unit of storage for an entity, contains the string, the value
32 * and the linkind data needed for the linking in the hash table.
36 void *_private; /* application data */
37 xmlElementType type; /* XML_ENTITY_DECL, must be second ! */
38 const xmlChar *name; /* Entity name */
39 struct _xmlNode *children; /* First child link */
40 struct _xmlNode *last; /* Last child link */
41 struct _xmlDtd *parent; /* -> DTD */
42 struct _xmlNode *next; /* next sibling link */
43 struct _xmlNode *prev; /* previous sibling link */
44 struct _xmlDoc *doc; /* the containing document */
46 xmlChar *orig; /* content without ref substitution */
47 xmlChar *content; /* content or ndata if unparsed */
48 int length; /* the content length */
49 xmlEntityType etype; /* The entity type */
50 const xmlChar *ExternalID; /* External identifier for PUBLIC */
51 const xmlChar *SystemID; /* URI for a SYSTEM or PUBLIC Entity */
53 struct _xmlEntity *nexte; /* unused */
54 const xmlChar *URI; /* the full URI as computed */
55 int owner; /* does the entity own the childrens */
59 * All entities are stored in an hash table.
60 * There is 2 separate hash tables for global and parameter entities.
63 typedef struct _xmlHashTable xmlEntitiesTable;
64 typedef xmlEntitiesTable *xmlEntitiesTablePtr;
70 void xmlInitializePredefinedEntities (void);
71 xmlEntityPtr xmlAddDocEntity (xmlDocPtr doc,
74 const xmlChar *ExternalID,
75 const xmlChar *SystemID,
76 const xmlChar *content);
77 xmlEntityPtr xmlAddDtdEntity (xmlDocPtr doc,
80 const xmlChar *ExternalID,
81 const xmlChar *SystemID,
82 const xmlChar *content);
83 xmlEntityPtr xmlGetPredefinedEntity (const xmlChar *name);
84 xmlEntityPtr xmlGetDocEntity (xmlDocPtr doc,
86 xmlEntityPtr xmlGetDtdEntity (xmlDocPtr doc,
88 xmlEntityPtr xmlGetParameterEntity (xmlDocPtr doc,
90 const xmlChar * xmlEncodeEntities (xmlDocPtr doc,
91 const xmlChar *input);
92 xmlChar * xmlEncodeEntitiesReentrant(xmlDocPtr doc,
93 const xmlChar *input);
94 xmlChar * xmlEncodeSpecialChars (xmlDocPtr doc,
95 const xmlChar *input);
96 xmlEntitiesTablePtr xmlCreateEntitiesTable (void);
97 xmlEntitiesTablePtr xmlCopyEntitiesTable (xmlEntitiesTablePtr table);
98 void xmlFreeEntitiesTable (xmlEntitiesTablePtr table);
99 void xmlDumpEntitiesTable (xmlBufferPtr buf,
100 xmlEntitiesTablePtr table);
101 void xmlDumpEntityDecl (xmlBufferPtr buf,
103 void xmlCleanupPredefinedEntities(void);
110 # endif /* __XML_ENTITIES_H__ */