Daniel Veillard | 260a68f | 1998-08-13 03:39:55 +0000 | [diff] [blame] | 1 | /* |
| 2 | * tree.h : describes the structures found in an tree resulting |
| 3 | * from an XML parsing. |
| 4 | * |
| 5 | * See Copyright for the status of this software. |
| 6 | * |
Daniel Veillard | 39a1f9a | 1999-01-17 19:11:59 +0000 | [diff] [blame] | 7 | * Daniel.Veillard@w3.org |
Daniel Veillard | 260a68f | 1998-08-13 03:39:55 +0000 | [diff] [blame] | 8 | */ |
| 9 | |
| 10 | #ifndef __XML_TREE_H__ |
| 11 | #define __XML_TREE_H__ |
| 12 | |
Daniel Veillard | 82c305b | 1999-12-15 19:08:23 +0000 | [diff] [blame] | 13 | #include <stdio.h> |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 14 | #include <libxml/xmlversion.h> |
Daniel Veillard | 82c305b | 1999-12-15 19:08:23 +0000 | [diff] [blame] | 15 | |
Daniel Veillard | 260a68f | 1998-08-13 03:39:55 +0000 | [diff] [blame] | 16 | |
| 17 | #ifdef __cplusplus |
| 18 | extern "C" { |
| 19 | #endif |
| 20 | |
| 21 | /* |
Daniel Veillard | ccb0963 | 1998-10-27 06:21:04 +0000 | [diff] [blame] | 22 | * The different element types carried by an XML tree |
| 23 | * |
| 24 | * NOTE: This is synchronized with DOM Level1 values |
| 25 | * See http://www.w3.org/TR/REC-DOM-Level-1/ |
| 26 | */ |
| 27 | typedef enum { |
| 28 | XML_ELEMENT_NODE= 1, |
| 29 | XML_ATTRIBUTE_NODE= 2, |
| 30 | XML_TEXT_NODE= 3, |
| 31 | XML_CDATA_SECTION_NODE= 4, |
| 32 | XML_ENTITY_REF_NODE= 5, |
| 33 | XML_ENTITY_NODE= 6, |
| 34 | XML_PI_NODE= 7, |
| 35 | XML_COMMENT_NODE= 8, |
| 36 | XML_DOCUMENT_NODE= 9, |
| 37 | XML_DOCUMENT_TYPE_NODE= 10, |
| 38 | XML_DOCUMENT_FRAG_NODE= 11, |
Daniel Veillard | 7c1206f | 1999-10-14 09:10:25 +0000 | [diff] [blame] | 39 | XML_NOTATION_NODE= 12, |
Daniel Veillard | cf46199 | 2000-03-14 18:30:20 +0000 | [diff] [blame] | 40 | XML_HTML_DOCUMENT_NODE= 13, |
| 41 | XML_DTD_NODE= 14, |
| 42 | XML_ELEMENT_DECL= 15, |
| 43 | XML_ATTRIBUTE_DECL= 16, |
| 44 | XML_ENTITY_DECL= 17 |
Daniel Veillard | ccb0963 | 1998-10-27 06:21:04 +0000 | [diff] [blame] | 45 | } xmlElementType; |
| 46 | |
| 47 | /* |
Daniel Veillard | 0ba4d53 | 1998-11-01 19:34:31 +0000 | [diff] [blame] | 48 | * Size of an internal character representation. |
| 49 | * |
Daniel Veillard | cf46199 | 2000-03-14 18:30:20 +0000 | [diff] [blame] | 50 | * We use 8bit chars internal representation for memory efficiency, |
| 51 | * Note that with 8 bits wide xmlChars one can still use UTF-8 to handle |
| 52 | * correctly non ISO-Latin input. |
Daniel Veillard | 260a68f | 1998-08-13 03:39:55 +0000 | [diff] [blame] | 53 | */ |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 54 | |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 55 | typedef unsigned char xmlChar; |
Daniel Veillard | 260a68f | 1998-08-13 03:39:55 +0000 | [diff] [blame] | 56 | |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 57 | #ifndef WIN32 |
| 58 | #ifndef CHAR |
| 59 | #define CHAR xmlChar |
| 60 | #endif |
| 61 | #endif |
| 62 | |
| 63 | #define BAD_CAST (xmlChar *) |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 64 | |
Daniel Veillard | 260a68f | 1998-08-13 03:39:55 +0000 | [diff] [blame] | 65 | /* |
| 66 | * a DTD Notation definition |
Daniel Veillard | 260a68f | 1998-08-13 03:39:55 +0000 | [diff] [blame] | 67 | */ |
| 68 | |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 69 | typedef struct _xmlNotation xmlNotation; |
| 70 | typedef xmlNotation *xmlNotationPtr; |
| 71 | struct _xmlNotation { |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 72 | const xmlChar *name; /* Notation name */ |
| 73 | const xmlChar *PublicID; /* Public identifier, if any */ |
| 74 | const xmlChar *SystemID; /* System identifier, if any */ |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 75 | }; |
Daniel Veillard | 1e346af | 1999-02-22 10:33:01 +0000 | [diff] [blame] | 76 | |
Daniel Veillard | 260a68f | 1998-08-13 03:39:55 +0000 | [diff] [blame] | 77 | /* |
| 78 | * a DTD Attribute definition |
Daniel Veillard | 260a68f | 1998-08-13 03:39:55 +0000 | [diff] [blame] | 79 | */ |
| 80 | |
Daniel Veillard | 1e346af | 1999-02-22 10:33:01 +0000 | [diff] [blame] | 81 | typedef enum { |
| 82 | XML_ATTRIBUTE_CDATA = 1, |
| 83 | XML_ATTRIBUTE_ID, |
| 84 | XML_ATTRIBUTE_IDREF , |
| 85 | XML_ATTRIBUTE_IDREFS, |
| 86 | XML_ATTRIBUTE_ENTITY, |
| 87 | XML_ATTRIBUTE_ENTITIES, |
| 88 | XML_ATTRIBUTE_NMTOKEN, |
| 89 | XML_ATTRIBUTE_NMTOKENS, |
| 90 | XML_ATTRIBUTE_ENUMERATION, |
| 91 | XML_ATTRIBUTE_NOTATION |
| 92 | } xmlAttributeType; |
Daniel Veillard | 39a1f9a | 1999-01-17 19:11:59 +0000 | [diff] [blame] | 93 | |
Daniel Veillard | 1e346af | 1999-02-22 10:33:01 +0000 | [diff] [blame] | 94 | typedef enum { |
| 95 | XML_ATTRIBUTE_NONE = 1, |
| 96 | XML_ATTRIBUTE_REQUIRED, |
| 97 | XML_ATTRIBUTE_IMPLIED, |
| 98 | XML_ATTRIBUTE_FIXED |
| 99 | } xmlAttributeDefault; |
| 100 | |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 101 | typedef struct _xmlEnumeration xmlEnumeration; |
Daniel Veillard | 1e346af | 1999-02-22 10:33:01 +0000 | [diff] [blame] | 102 | typedef xmlEnumeration *xmlEnumerationPtr; |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 103 | struct _xmlEnumeration { |
| 104 | struct _xmlEnumeration *next; /* next one */ |
| 105 | const xmlChar *name; /* Enumeration name */ |
| 106 | }; |
Daniel Veillard | 1e346af | 1999-02-22 10:33:01 +0000 | [diff] [blame] | 107 | |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 108 | typedef struct _xmlAttribute xmlAttribute; |
| 109 | typedef xmlAttribute *xmlAttributePtr; |
| 110 | struct _xmlAttribute { |
Daniel Veillard | cf46199 | 2000-03-14 18:30:20 +0000 | [diff] [blame] | 111 | #ifndef XML_WITHOUT_CORBA |
| 112 | void *_private; /* for Corba, must be first ! */ |
| 113 | #endif |
| 114 | xmlElementType type; /* XML_ATTRIBUTE_DECL, must be second ! */ |
| 115 | const xmlChar *name; /* Attribute name */ |
| 116 | struct _xmlNode *children; /* NULL */ |
| 117 | struct _xmlNode *last; /* NULL */ |
| 118 | struct _xmlDtd *parent; /* -> DTD */ |
| 119 | struct _xmlNode *next; /* next sibling link */ |
| 120 | struct _xmlNode *prev; /* previous sibling link */ |
| 121 | struct _xmlDoc *doc; /* the containing document */ |
| 122 | |
| 123 | struct _xmlAttribute *nexth; /* next in hash table */ |
| 124 | xmlAttributeType atype; /* The attribute type */ |
| 125 | xmlAttributeDefault def; /* the default */ |
| 126 | const xmlChar *defaultValue; /* or the default value */ |
| 127 | xmlEnumerationPtr tree; /* or the enumeration tree if any */ |
| 128 | const xmlChar *prefix; /* the namespace prefix if any */ |
| 129 | const xmlChar *elem; /* Element holding the attribute */ |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 130 | }; |
Daniel Veillard | 39a1f9a | 1999-01-17 19:11:59 +0000 | [diff] [blame] | 131 | |
Daniel Veillard | 260a68f | 1998-08-13 03:39:55 +0000 | [diff] [blame] | 132 | /* |
| 133 | * a DTD Element definition. |
| 134 | */ |
Daniel Veillard | 1899e85 | 1999-02-01 12:18:54 +0000 | [diff] [blame] | 135 | typedef enum { |
Daniel Veillard | 1e346af | 1999-02-22 10:33:01 +0000 | [diff] [blame] | 136 | XML_ELEMENT_CONTENT_PCDATA = 1, |
Daniel Veillard | 1899e85 | 1999-02-01 12:18:54 +0000 | [diff] [blame] | 137 | XML_ELEMENT_CONTENT_ELEMENT, |
| 138 | XML_ELEMENT_CONTENT_SEQ, |
| 139 | XML_ELEMENT_CONTENT_OR |
| 140 | } xmlElementContentType; |
Daniel Veillard | 39a1f9a | 1999-01-17 19:11:59 +0000 | [diff] [blame] | 141 | |
Daniel Veillard | 1899e85 | 1999-02-01 12:18:54 +0000 | [diff] [blame] | 142 | typedef enum { |
Daniel Veillard | 1e346af | 1999-02-22 10:33:01 +0000 | [diff] [blame] | 143 | XML_ELEMENT_CONTENT_ONCE = 1, |
Daniel Veillard | 1899e85 | 1999-02-01 12:18:54 +0000 | [diff] [blame] | 144 | XML_ELEMENT_CONTENT_OPT, |
| 145 | XML_ELEMENT_CONTENT_MULT, |
| 146 | XML_ELEMENT_CONTENT_PLUS |
| 147 | } xmlElementContentOccur; |
Daniel Veillard | 39a1f9a | 1999-01-17 19:11:59 +0000 | [diff] [blame] | 148 | |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 149 | typedef struct _xmlElementContent xmlElementContent; |
| 150 | typedef xmlElementContent *xmlElementContentPtr; |
| 151 | struct _xmlElementContent { |
Daniel Veillard | 1899e85 | 1999-02-01 12:18:54 +0000 | [diff] [blame] | 152 | xmlElementContentType type; /* PCDATA, ELEMENT, SEQ or OR */ |
| 153 | xmlElementContentOccur ocur; /* ONCE, OPT, MULT or PLUS */ |
Daniel Veillard | 6077d03 | 1999-10-09 09:11:45 +0000 | [diff] [blame] | 154 | const xmlChar *name; /* Element name */ |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 155 | struct _xmlElementContent *c1; /* first child */ |
| 156 | struct _xmlElementContent *c2; /* second child */ |
| 157 | }; |
Daniel Veillard | 39a1f9a | 1999-01-17 19:11:59 +0000 | [diff] [blame] | 158 | |
Daniel Veillard | 1899e85 | 1999-02-01 12:18:54 +0000 | [diff] [blame] | 159 | typedef enum { |
Daniel Veillard | 1e346af | 1999-02-22 10:33:01 +0000 | [diff] [blame] | 160 | XML_ELEMENT_TYPE_EMPTY = 1, |
Daniel Veillard | 1899e85 | 1999-02-01 12:18:54 +0000 | [diff] [blame] | 161 | XML_ELEMENT_TYPE_ANY, |
| 162 | XML_ELEMENT_TYPE_MIXED, |
| 163 | XML_ELEMENT_TYPE_ELEMENT |
| 164 | } xmlElementTypeVal; |
Daniel Veillard | 260a68f | 1998-08-13 03:39:55 +0000 | [diff] [blame] | 165 | |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 166 | typedef struct _xmlElement xmlElement; |
| 167 | typedef xmlElement *xmlElementPtr; |
| 168 | struct _xmlElement { |
Daniel Veillard | cf46199 | 2000-03-14 18:30:20 +0000 | [diff] [blame] | 169 | #ifndef XML_WITHOUT_CORBA |
| 170 | void *_private; /* for Corba, must be first ! */ |
| 171 | #endif |
| 172 | xmlElementType type; /* XML_ELEMENT_DECL, must be second ! */ |
Daniel Veillard | 6077d03 | 1999-10-09 09:11:45 +0000 | [diff] [blame] | 173 | const xmlChar *name; /* Element name */ |
Daniel Veillard | cf46199 | 2000-03-14 18:30:20 +0000 | [diff] [blame] | 174 | struct _xmlNode *children; /* NULL */ |
| 175 | struct _xmlNode *last; /* NULL */ |
| 176 | struct _xmlDtd *parent; /* -> DTD */ |
| 177 | struct _xmlNode *next; /* next sibling link */ |
| 178 | struct _xmlNode *prev; /* previous sibling link */ |
| 179 | struct _xmlDoc *doc; /* the containing document */ |
| 180 | |
| 181 | xmlElementTypeVal etype; /* The type */ |
Daniel Veillard | 39a1f9a | 1999-01-17 19:11:59 +0000 | [diff] [blame] | 182 | xmlElementContentPtr content; /* the allowed element content */ |
Daniel Veillard | b05deb7 | 1999-08-10 19:04:08 +0000 | [diff] [blame] | 183 | xmlAttributePtr attributes; /* List of the declared attributes */ |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 184 | }; |
Daniel Veillard | 260a68f | 1998-08-13 03:39:55 +0000 | [diff] [blame] | 185 | |
| 186 | /* |
| 187 | * An XML namespace. |
| 188 | * Note that prefix == NULL is valid, it defines the default namespace |
| 189 | * within the subtree (until overriden). |
| 190 | */ |
| 191 | |
Daniel Veillard | 1899e85 | 1999-02-01 12:18:54 +0000 | [diff] [blame] | 192 | typedef enum { |
Daniel Veillard | 1e346af | 1999-02-22 10:33:01 +0000 | [diff] [blame] | 193 | XML_GLOBAL_NAMESPACE = 1, /* old style global namespace */ |
Daniel Veillard | 1899e85 | 1999-02-01 12:18:54 +0000 | [diff] [blame] | 194 | XML_LOCAL_NAMESPACE /* new style local scoping */ |
| 195 | } xmlNsType; |
Daniel Veillard | 260a68f | 1998-08-13 03:39:55 +0000 | [diff] [blame] | 196 | |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 197 | typedef struct _xmlNs xmlNs; |
| 198 | typedef xmlNs *xmlNsPtr; |
| 199 | struct _xmlNs { |
| 200 | struct _xmlNs *next; /* next Ns link for this node */ |
Daniel Veillard | 1899e85 | 1999-02-01 12:18:54 +0000 | [diff] [blame] | 201 | xmlNsType type; /* global or local */ |
Daniel Veillard | 6077d03 | 1999-10-09 09:11:45 +0000 | [diff] [blame] | 202 | const xmlChar *href; /* URL for the namespace */ |
| 203 | const xmlChar *prefix; /* prefix for the namespace */ |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 204 | }; |
Daniel Veillard | 260a68f | 1998-08-13 03:39:55 +0000 | [diff] [blame] | 205 | |
| 206 | /* |
| 207 | * An XML DtD, as defined by <!DOCTYPE. |
| 208 | */ |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 209 | typedef struct _xmlDtd xmlDtd; |
| 210 | typedef xmlDtd *xmlDtdPtr; |
| 211 | struct _xmlDtd { |
Daniel Veillard | cf46199 | 2000-03-14 18:30:20 +0000 | [diff] [blame] | 212 | #ifndef XML_WITHOUT_CORBA |
| 213 | void *_private; /* for Corba, must be first ! */ |
| 214 | #endif |
| 215 | xmlElementType type; /* XML_DTD_NODE, must be second ! */ |
Daniel Veillard | 6077d03 | 1999-10-09 09:11:45 +0000 | [diff] [blame] | 216 | const xmlChar *name; /* Name of the DTD */ |
Daniel Veillard | cf46199 | 2000-03-14 18:30:20 +0000 | [diff] [blame] | 217 | struct _xmlNode *children; /* the value of the property link */ |
| 218 | struct _xmlNode *last; /* last child link */ |
| 219 | struct _xmlDoc *parent; /* child->parent link */ |
| 220 | struct _xmlNode *next; /* next sibling link */ |
| 221 | struct _xmlNode *prev; /* previous sibling link */ |
| 222 | struct _xmlDoc *doc; /* the containing document */ |
| 223 | |
| 224 | /* End of common part */ |
Daniel Veillard | 1e346af | 1999-02-22 10:33:01 +0000 | [diff] [blame] | 225 | void *notations; /* Hash table for notations if any */ |
Daniel Veillard | 260a68f | 1998-08-13 03:39:55 +0000 | [diff] [blame] | 226 | void *elements; /* Hash table for elements if any */ |
Daniel Veillard | 1e346af | 1999-02-22 10:33:01 +0000 | [diff] [blame] | 227 | void *attributes; /* Hash table for attributes if any */ |
Daniel Veillard | 260a68f | 1998-08-13 03:39:55 +0000 | [diff] [blame] | 228 | void *entities; /* Hash table for entities if any */ |
Daniel Veillard | cf46199 | 2000-03-14 18:30:20 +0000 | [diff] [blame] | 229 | const xmlChar *ExternalID; /* External identifier for PUBLIC DTD */ |
| 230 | const xmlChar *SystemID; /* URI for a SYSTEM or PUBLIC DTD */ |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 231 | }; |
Daniel Veillard | 260a68f | 1998-08-13 03:39:55 +0000 | [diff] [blame] | 232 | |
| 233 | /* |
| 234 | * A attribute of an XML node. |
| 235 | */ |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 236 | typedef struct _xmlAttr xmlAttr; |
| 237 | typedef xmlAttr *xmlAttrPtr; |
| 238 | struct _xmlAttr { |
Daniel Veillard | 27fb075 | 1998-10-17 06:47:46 +0000 | [diff] [blame] | 239 | #ifndef XML_WITHOUT_CORBA |
| 240 | void *_private; /* for Corba, must be first ! */ |
Daniel Veillard | 27fb075 | 1998-10-17 06:47:46 +0000 | [diff] [blame] | 241 | #endif |
Daniel Veillard | cf46199 | 2000-03-14 18:30:20 +0000 | [diff] [blame] | 242 | xmlElementType type; /* XML_ATTRIBUTE_NODE, must be second ! */ |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 243 | const xmlChar *name; /* the name of the property */ |
Daniel Veillard | cf46199 | 2000-03-14 18:30:20 +0000 | [diff] [blame] | 244 | struct _xmlNode *children; /* the value of the property */ |
| 245 | struct _xmlNode *last; /* NULL */ |
| 246 | struct _xmlNode *parent; /* child->parent link */ |
| 247 | struct _xmlAttr *next; /* next sibling link */ |
| 248 | struct _xmlAttr *prev; /* previous sibling link */ |
| 249 | struct _xmlDoc *doc; /* the containing document */ |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 250 | xmlNs *ns; /* pointer to the associated namespace */ |
Daniel Veillard | cf46199 | 2000-03-14 18:30:20 +0000 | [diff] [blame] | 251 | xmlAttributeType atype; /* the attribute type if validating */ |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 252 | }; |
Daniel Veillard | 260a68f | 1998-08-13 03:39:55 +0000 | [diff] [blame] | 253 | |
| 254 | /* |
Daniel Veillard | 991e63d | 1999-08-15 23:32:28 +0000 | [diff] [blame] | 255 | * An XML ID instance. |
| 256 | */ |
| 257 | |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 258 | typedef struct _xmlID xmlID; |
| 259 | typedef xmlID *xmlIDPtr; |
| 260 | struct _xmlID { |
| 261 | struct _xmlID *next; /* next ID */ |
Daniel Veillard | 6077d03 | 1999-10-09 09:11:45 +0000 | [diff] [blame] | 262 | const xmlChar *value; /* The ID name */ |
Daniel Veillard | 991e63d | 1999-08-15 23:32:28 +0000 | [diff] [blame] | 263 | xmlAttrPtr attr; /* The attribut holding it */ |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 264 | }; |
Daniel Veillard | 991e63d | 1999-08-15 23:32:28 +0000 | [diff] [blame] | 265 | |
| 266 | /* |
Daniel Veillard | c08a2c6 | 1999-09-08 21:35:25 +0000 | [diff] [blame] | 267 | * An XML IDREF instance. |
| 268 | */ |
| 269 | |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 270 | typedef struct _xmlRef xmlRef; |
| 271 | typedef xmlRef *xmlRefPtr; |
| 272 | struct _xmlRef { |
| 273 | struct _xmlRef *next; /* next Ref */ |
Daniel Veillard | 6077d03 | 1999-10-09 09:11:45 +0000 | [diff] [blame] | 274 | const xmlChar *value; /* The Ref name */ |
Daniel Veillard | c08a2c6 | 1999-09-08 21:35:25 +0000 | [diff] [blame] | 275 | xmlAttrPtr attr; /* The attribut holding it */ |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 276 | }; |
Daniel Veillard | c08a2c6 | 1999-09-08 21:35:25 +0000 | [diff] [blame] | 277 | |
| 278 | /* |
Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 279 | * A buffer structure |
| 280 | */ |
| 281 | |
| 282 | typedef enum { |
| 283 | XML_BUFFER_ALLOC_DOUBLEIT, |
| 284 | XML_BUFFER_ALLOC_EXACT |
| 285 | } xmlBufferAllocationScheme; |
| 286 | |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 287 | typedef struct _xmlBuffer xmlBuffer; |
| 288 | typedef xmlBuffer *xmlBufferPtr; |
| 289 | struct _xmlBuffer { |
Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 290 | xmlChar *content; /* The buffer content UTF8 */ |
| 291 | unsigned int use; /* The buffer size used */ |
| 292 | unsigned int size; /* The buffer size */ |
| 293 | xmlBufferAllocationScheme alloc; /* The realloc method */ |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 294 | }; |
Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 295 | |
| 296 | /* |
Daniel Veillard | 260a68f | 1998-08-13 03:39:55 +0000 | [diff] [blame] | 297 | * A node in an XML tree. |
| 298 | */ |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 299 | typedef struct _xmlNode xmlNode; |
| 300 | typedef xmlNode *xmlNodePtr; |
| 301 | struct _xmlNode { |
Daniel Veillard | 27fb075 | 1998-10-17 06:47:46 +0000 | [diff] [blame] | 302 | #ifndef XML_WITHOUT_CORBA |
| 303 | void *_private; /* for Corba, must be first ! */ |
Daniel Veillard | 27fb075 | 1998-10-17 06:47:46 +0000 | [diff] [blame] | 304 | #endif |
Daniel Veillard | cf46199 | 2000-03-14 18:30:20 +0000 | [diff] [blame] | 305 | xmlElementType type; /* type number, must be second ! */ |
| 306 | const xmlChar *name; /* the name of the node, or the entity */ |
| 307 | struct _xmlNode *children; /* parent->childs link */ |
| 308 | struct _xmlNode *last; /* last child link */ |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 309 | struct _xmlNode *parent; /* child->parent link */ |
| 310 | struct _xmlNode *next; /* next sibling link */ |
| 311 | struct _xmlNode *prev; /* previous sibling link */ |
Daniel Veillard | cf46199 | 2000-03-14 18:30:20 +0000 | [diff] [blame] | 312 | struct _xmlDoc *doc; /* the containing document */ |
| 313 | xmlNs *ns; /* pointer to the associated namespace */ |
Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 314 | #ifndef XML_USE_BUFFER_CONTENT |
Daniel Veillard | cf46199 | 2000-03-14 18:30:20 +0000 | [diff] [blame] | 315 | xmlChar *content; /* the content */ |
Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 316 | #else |
Daniel Veillard | cf46199 | 2000-03-14 18:30:20 +0000 | [diff] [blame] | 317 | xmlBufferPtr content; /* the content in a buffer */ |
Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 318 | #endif |
Daniel Veillard | cf46199 | 2000-03-14 18:30:20 +0000 | [diff] [blame] | 319 | |
| 320 | /* End of common part */ |
| 321 | struct _xmlAttr *properties;/* properties list */ |
| 322 | xmlNs *nsDef; /* namespace definitions on this node */ |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 323 | }; |
Daniel Veillard | 260a68f | 1998-08-13 03:39:55 +0000 | [diff] [blame] | 324 | |
| 325 | /* |
| 326 | * An XML document. |
| 327 | */ |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 328 | typedef struct _xmlDoc xmlDoc; |
| 329 | typedef xmlDoc *xmlDocPtr; |
| 330 | struct _xmlDoc { |
Daniel Veillard | 27fb075 | 1998-10-17 06:47:46 +0000 | [diff] [blame] | 331 | #ifndef XML_WITHOUT_CORBA |
| 332 | void *_private; /* for Corba, must be first ! */ |
Daniel Veillard | 27fb075 | 1998-10-17 06:47:46 +0000 | [diff] [blame] | 333 | #endif |
Daniel Veillard | ccb0963 | 1998-10-27 06:21:04 +0000 | [diff] [blame] | 334 | xmlElementType type; /* XML_DOCUMENT_NODE, must be second ! */ |
Daniel Veillard | 260a68f | 1998-08-13 03:39:55 +0000 | [diff] [blame] | 335 | char *name; /* name/filename/URI of the document */ |
Daniel Veillard | cf46199 | 2000-03-14 18:30:20 +0000 | [diff] [blame] | 336 | struct _xmlNode *children; /* the document tree */ |
| 337 | struct _xmlNode *last; /* last child link */ |
| 338 | struct _xmlNode *parent; /* child->parent link */ |
| 339 | struct _xmlNode *next; /* next sibling link */ |
| 340 | struct _xmlNode *prev; /* previous sibling link */ |
| 341 | struct _xmlDoc *doc; /* autoreference to itself */ |
| 342 | |
| 343 | /* End of common part */ |
Daniel Veillard | 15a8df4 | 1998-09-24 19:15:06 +0000 | [diff] [blame] | 344 | int compression;/* level of zlib compression */ |
Daniel Veillard | 260a68f | 1998-08-13 03:39:55 +0000 | [diff] [blame] | 345 | int standalone; /* standalone document (no external refs) */ |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 346 | struct _xmlDtd *intSubset; /* the document internal subset */ |
| 347 | struct _xmlDtd *extSubset; /* the document external subset */ |
| 348 | struct _xmlNs *oldNs; /* Global namespace, the old way */ |
Daniel Veillard | cf46199 | 2000-03-14 18:30:20 +0000 | [diff] [blame] | 349 | const xmlChar *version; /* the XML version string */ |
| 350 | const xmlChar *encoding; /* encoding, if any */ |
Daniel Veillard | 991e63d | 1999-08-15 23:32:28 +0000 | [diff] [blame] | 351 | void *ids; /* Hash table for ID attributes if any */ |
Daniel Veillard | c08a2c6 | 1999-09-08 21:35:25 +0000 | [diff] [blame] | 352 | void *refs; /* Hash table for IDREFs attributes if any */ |
Daniel Veillard | cf46199 | 2000-03-14 18:30:20 +0000 | [diff] [blame] | 353 | const xmlChar *URL; /* The URI for that document */ |
Daniel Veillard | 71b656e | 2000-01-05 14:46:17 +0000 | [diff] [blame] | 354 | }; |
Daniel Veillard | 260a68f | 1998-08-13 03:39:55 +0000 | [diff] [blame] | 355 | |
| 356 | /* |
| 357 | * Variables. |
| 358 | */ |
| 359 | extern xmlNsPtr baseDTD; |
| 360 | extern int oldXMLWDcompatibility;/* maintain compatibility with old WD */ |
| 361 | extern int xmlIndentTreeOutput; /* try to indent the tree dumps */ |
Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 362 | extern xmlBufferAllocationScheme xmlBufferAllocScheme; /* alloc scheme to use */ |
Daniel Veillard | e41f2b7 | 2000-01-30 20:00:07 +0000 | [diff] [blame] | 363 | extern int xmlSaveNoEmptyTags; /* save empty tags as <empty></empty> */ |
Daniel Veillard | 260a68f | 1998-08-13 03:39:55 +0000 | [diff] [blame] | 364 | |
| 365 | /* |
Daniel Veillard | 5099ae8 | 1999-04-21 20:12:07 +0000 | [diff] [blame] | 366 | * Handling Buffers. |
| 367 | */ |
| 368 | |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 369 | xmlBufferPtr xmlBufferCreate (void); |
Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 370 | xmlBufferPtr xmlBufferCreateSize (size_t size); |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 371 | void xmlBufferFree (xmlBufferPtr buf); |
| 372 | int xmlBufferDump (FILE *file, |
| 373 | xmlBufferPtr buf); |
| 374 | void xmlBufferAdd (xmlBufferPtr buf, |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 375 | const xmlChar *str, |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 376 | int len); |
| 377 | void xmlBufferCat (xmlBufferPtr buf, |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 378 | const xmlChar *str); |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 379 | void xmlBufferCCat (xmlBufferPtr buf, |
| 380 | const char *str); |
| 381 | int xmlBufferShrink (xmlBufferPtr buf, |
| 382 | int len); |
Daniel Veillard | 496a1cf | 2000-05-03 14:20:55 +0000 | [diff] [blame^] | 383 | int xmlBufferGrow (xmlBufferPtr buf, |
| 384 | int len); |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 385 | void xmlBufferEmpty (xmlBufferPtr buf); |
Daniel Veillard | f5c2c87 | 1999-12-01 09:51:45 +0000 | [diff] [blame] | 386 | const xmlChar* xmlBufferContent (const xmlBufferPtr buf); |
| 387 | int xmlBufferUse (const xmlBufferPtr buf); |
| 388 | void xmlBufferSetAllocationScheme(xmlBufferPtr buf, |
| 389 | xmlBufferAllocationScheme scheme); |
| 390 | int xmlBufferLength (const xmlBufferPtr buf); |
Daniel Veillard | 5099ae8 | 1999-04-21 20:12:07 +0000 | [diff] [blame] | 391 | |
| 392 | /* |
Daniel Veillard | 1625364 | 1998-10-28 22:58:05 +0000 | [diff] [blame] | 393 | * Creating/freeing new structures |
Daniel Veillard | 260a68f | 1998-08-13 03:39:55 +0000 | [diff] [blame] | 394 | */ |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 395 | xmlDtdPtr xmlCreateIntSubset (xmlDocPtr doc, |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 396 | const xmlChar *name, |
| 397 | const xmlChar *ExternalID, |
| 398 | const xmlChar *SystemID); |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 399 | xmlDtdPtr xmlNewDtd (xmlDocPtr doc, |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 400 | const xmlChar *name, |
| 401 | const xmlChar *ExternalID, |
| 402 | const xmlChar *SystemID); |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 403 | void xmlFreeDtd (xmlDtdPtr cur); |
| 404 | xmlNsPtr xmlNewGlobalNs (xmlDocPtr doc, |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 405 | const xmlChar *href, |
| 406 | const xmlChar *prefix); |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 407 | xmlNsPtr xmlNewNs (xmlNodePtr node, |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 408 | const xmlChar *href, |
| 409 | const xmlChar *prefix); |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 410 | void xmlFreeNs (xmlNsPtr cur); |
Daniel Veillard | 6077d03 | 1999-10-09 09:11:45 +0000 | [diff] [blame] | 411 | xmlDocPtr xmlNewDoc (const xmlChar *version); |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 412 | void xmlFreeDoc (xmlDocPtr cur); |
| 413 | xmlAttrPtr xmlNewDocProp (xmlDocPtr doc, |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 414 | const xmlChar *name, |
| 415 | const xmlChar *value); |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 416 | xmlAttrPtr xmlNewProp (xmlNodePtr node, |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 417 | const xmlChar *name, |
| 418 | const xmlChar *value); |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 419 | xmlAttrPtr xmlNewNsProp (xmlNodePtr node, |
| 420 | xmlNsPtr ns, |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 421 | const xmlChar *name, |
| 422 | const xmlChar *value); |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 423 | void xmlFreePropList (xmlAttrPtr cur); |
| 424 | void xmlFreeProp (xmlAttrPtr cur); |
| 425 | xmlAttrPtr xmlCopyProp (xmlNodePtr target, |
| 426 | xmlAttrPtr cur); |
| 427 | xmlAttrPtr xmlCopyPropList (xmlNodePtr target, |
| 428 | xmlAttrPtr cur); |
| 429 | xmlDtdPtr xmlCopyDtd (xmlDtdPtr dtd); |
| 430 | xmlDocPtr xmlCopyDoc (xmlDocPtr doc, |
| 431 | int recursive); |
Daniel Veillard | 1625364 | 1998-10-28 22:58:05 +0000 | [diff] [blame] | 432 | |
| 433 | /* |
| 434 | * Creating new nodes |
| 435 | */ |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 436 | xmlNodePtr xmlNewDocNode (xmlDocPtr doc, |
| 437 | xmlNsPtr ns, |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 438 | const xmlChar *name, |
| 439 | const xmlChar *content); |
Daniel Veillard | 11a48ec | 1999-11-23 10:40:46 +0000 | [diff] [blame] | 440 | xmlNodePtr xmlNewDocRawNode (xmlDocPtr doc, |
| 441 | xmlNsPtr ns, |
| 442 | const xmlChar *name, |
| 443 | const xmlChar *content); |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 444 | xmlNodePtr xmlNewNode (xmlNsPtr ns, |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 445 | const xmlChar *name); |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 446 | xmlNodePtr xmlNewChild (xmlNodePtr parent, |
| 447 | xmlNsPtr ns, |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 448 | const xmlChar *name, |
| 449 | const xmlChar *content); |
Daniel Veillard | 11a48ec | 1999-11-23 10:40:46 +0000 | [diff] [blame] | 450 | xmlNodePtr xmlNewTextChild (xmlNodePtr parent, |
| 451 | xmlNsPtr ns, |
| 452 | const xmlChar *name, |
| 453 | const xmlChar *content); |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 454 | xmlNodePtr xmlNewDocText (xmlDocPtr doc, |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 455 | const xmlChar *content); |
| 456 | xmlNodePtr xmlNewText (const xmlChar *content); |
| 457 | xmlNodePtr xmlNewPI (const xmlChar *name, |
| 458 | const xmlChar *content); |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 459 | xmlNodePtr xmlNewDocTextLen (xmlDocPtr doc, |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 460 | const xmlChar *content, |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 461 | int len); |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 462 | xmlNodePtr xmlNewTextLen (const xmlChar *content, |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 463 | int len); |
| 464 | xmlNodePtr xmlNewDocComment (xmlDocPtr doc, |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 465 | const xmlChar *content); |
| 466 | xmlNodePtr xmlNewComment (const xmlChar *content); |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 467 | xmlNodePtr xmlNewCDataBlock (xmlDocPtr doc, |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 468 | const xmlChar *content, |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 469 | int len); |
Daniel Veillard | cf46199 | 2000-03-14 18:30:20 +0000 | [diff] [blame] | 470 | xmlNodePtr xmlNewCharRef (xmlDocPtr doc, |
| 471 | const xmlChar *name); |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 472 | xmlNodePtr xmlNewReference (xmlDocPtr doc, |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 473 | const xmlChar *name); |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 474 | xmlNodePtr xmlCopyNode (xmlNodePtr node, |
| 475 | int recursive); |
| 476 | xmlNodePtr xmlCopyNodeList (xmlNodePtr node); |
Daniel Veillard | 2eac503 | 2000-01-09 21:08:56 +0000 | [diff] [blame] | 477 | xmlNodePtr xmlNewDocFragment (xmlDocPtr doc); |
Daniel Veillard | 1625364 | 1998-10-28 22:58:05 +0000 | [diff] [blame] | 478 | |
| 479 | /* |
| 480 | * Navigating |
| 481 | */ |
Daniel Veillard | 3dbfdca | 1999-12-15 19:08:23 +0000 | [diff] [blame] | 482 | xmlNodePtr xmlDocGetRootElement (xmlDocPtr doc); |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 483 | xmlNodePtr xmlGetLastChild (xmlNodePtr parent); |
| 484 | int xmlNodeIsText (xmlNodePtr node); |
Daniel Veillard | 3e6d237 | 2000-03-04 11:39:43 +0000 | [diff] [blame] | 485 | int xmlIsBlankNode (xmlNodePtr node); |
Daniel Veillard | 1625364 | 1998-10-28 22:58:05 +0000 | [diff] [blame] | 486 | |
| 487 | /* |
| 488 | * Changing the structure |
| 489 | */ |
Daniel Veillard | 5cb5ab8 | 1999-12-21 15:35:29 +0000 | [diff] [blame] | 490 | xmlNodePtr xmlDocSetRootElement (xmlDocPtr doc, |
| 491 | xmlNodePtr root); |
| 492 | void xmlNodeSetName (xmlNodePtr cur, |
| 493 | const xmlChar *name); |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 494 | xmlNodePtr xmlAddChild (xmlNodePtr parent, |
| 495 | xmlNodePtr cur); |
Daniel Veillard | 5cb5ab8 | 1999-12-21 15:35:29 +0000 | [diff] [blame] | 496 | xmlNodePtr xmlReplaceNode (xmlNodePtr old, |
| 497 | xmlNodePtr cur); |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 498 | xmlNodePtr xmlAddSibling (xmlNodePtr cur, |
| 499 | xmlNodePtr elem); |
Daniel Veillard | 5cb5ab8 | 1999-12-21 15:35:29 +0000 | [diff] [blame] | 500 | xmlNodePtr xmlAddPrevSibling (xmlNodePtr cur, |
| 501 | xmlNodePtr elem); |
| 502 | xmlNodePtr xmlAddNextSibling (xmlNodePtr cur, |
| 503 | xmlNodePtr elem); |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 504 | void xmlUnlinkNode (xmlNodePtr cur); |
| 505 | xmlNodePtr xmlTextMerge (xmlNodePtr first, |
| 506 | xmlNodePtr second); |
| 507 | void xmlTextConcat (xmlNodePtr node, |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 508 | const xmlChar *content, |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 509 | int len); |
| 510 | void xmlFreeNodeList (xmlNodePtr cur); |
| 511 | void xmlFreeNode (xmlNodePtr cur); |
Daniel Veillard | 1625364 | 1998-10-28 22:58:05 +0000 | [diff] [blame] | 512 | |
| 513 | /* |
| 514 | * Namespaces |
| 515 | */ |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 516 | xmlNsPtr xmlSearchNs (xmlDocPtr doc, |
| 517 | xmlNodePtr node, |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 518 | const xmlChar *nameSpace); |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 519 | xmlNsPtr xmlSearchNsByHref (xmlDocPtr doc, |
| 520 | xmlNodePtr node, |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 521 | const xmlChar *href); |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 522 | xmlNsPtr * xmlGetNsList (xmlDocPtr doc, |
| 523 | xmlNodePtr node); |
| 524 | void xmlSetNs (xmlNodePtr node, |
| 525 | xmlNsPtr ns); |
| 526 | xmlNsPtr xmlCopyNamespace (xmlNsPtr cur); |
| 527 | xmlNsPtr xmlCopyNamespaceList (xmlNsPtr cur); |
Daniel Veillard | 260a68f | 1998-08-13 03:39:55 +0000 | [diff] [blame] | 528 | |
Daniel Veillard | 1625364 | 1998-10-28 22:58:05 +0000 | [diff] [blame] | 529 | /* |
| 530 | * Changing the content. |
| 531 | */ |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 532 | xmlAttrPtr xmlSetProp (xmlNodePtr node, |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 533 | const xmlChar *name, |
| 534 | const xmlChar *value); |
Daniel Veillard | 6077d03 | 1999-10-09 09:11:45 +0000 | [diff] [blame] | 535 | xmlChar * xmlGetProp (xmlNodePtr node, |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 536 | const xmlChar *name); |
Daniel Veillard | 10a2c65 | 1999-12-12 13:03:50 +0000 | [diff] [blame] | 537 | xmlChar * xmlGetNsProp (xmlNodePtr node, |
| 538 | const xmlChar *name, |
Ramiro Estrugo | bfce377 | 1999-12-15 04:32:07 +0000 | [diff] [blame] | 539 | const xmlChar *nameSpace); |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 540 | xmlNodePtr xmlStringGetNodeList (xmlDocPtr doc, |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 541 | const xmlChar *value); |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 542 | xmlNodePtr xmlStringLenGetNodeList (xmlDocPtr doc, |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 543 | const xmlChar *value, |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 544 | int len); |
Daniel Veillard | 6077d03 | 1999-10-09 09:11:45 +0000 | [diff] [blame] | 545 | xmlChar * xmlNodeListGetString (xmlDocPtr doc, |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 546 | xmlNodePtr list, |
| 547 | int inLine); |
| 548 | void xmlNodeSetContent (xmlNodePtr cur, |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 549 | const xmlChar *content); |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 550 | void xmlNodeSetContentLen (xmlNodePtr cur, |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 551 | const xmlChar *content, |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 552 | int len); |
| 553 | void xmlNodeAddContent (xmlNodePtr cur, |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 554 | const xmlChar *content); |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 555 | void xmlNodeAddContentLen (xmlNodePtr cur, |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 556 | const xmlChar *content, |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 557 | int len); |
Daniel Veillard | 6077d03 | 1999-10-09 09:11:45 +0000 | [diff] [blame] | 558 | xmlChar * xmlNodeGetContent (xmlNodePtr cur); |
Daniel Veillard | a819dac | 1999-11-24 18:04:22 +0000 | [diff] [blame] | 559 | xmlChar * xmlNodeGetLang (xmlNodePtr cur); |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 560 | void xmlNodeSetLang (xmlNodePtr cur, |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 561 | const xmlChar *lang); |
Daniel Veillard | cf46199 | 2000-03-14 18:30:20 +0000 | [diff] [blame] | 562 | int xmlNodeGetSpacePreserve (xmlNodePtr cur); |
Daniel Veillard | 10a2c65 | 1999-12-12 13:03:50 +0000 | [diff] [blame] | 563 | xmlChar * xmlNodeGetBase (xmlDocPtr doc, |
| 564 | xmlNodePtr cur); |
Daniel Veillard | 1625364 | 1998-10-28 22:58:05 +0000 | [diff] [blame] | 565 | |
| 566 | /* |
Daniel Veillard | c08a2c6 | 1999-09-08 21:35:25 +0000 | [diff] [blame] | 567 | * Removing content. |
| 568 | */ |
Daniel Veillard | cf46199 | 2000-03-14 18:30:20 +0000 | [diff] [blame] | 569 | int xmlRemoveProp (xmlAttrPtr attr); |
Daniel Veillard | c08a2c6 | 1999-09-08 21:35:25 +0000 | [diff] [blame] | 570 | int xmlRemoveNode (xmlNodePtr node); /* TODO */ |
| 571 | |
| 572 | /* |
Daniel Veillard | 1625364 | 1998-10-28 22:58:05 +0000 | [diff] [blame] | 573 | * Internal, don't use |
| 574 | */ |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 575 | void xmlBufferWriteCHAR (xmlBufferPtr buf, |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 576 | const xmlChar *string); |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 577 | void xmlBufferWriteChar (xmlBufferPtr buf, |
| 578 | const char *string); |
| 579 | void xmlBufferWriteQuotedString(xmlBufferPtr buf, |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 580 | const xmlChar *string); |
Daniel Veillard | 260a68f | 1998-08-13 03:39:55 +0000 | [diff] [blame] | 581 | |
Daniel Veillard | 1625364 | 1998-10-28 22:58:05 +0000 | [diff] [blame] | 582 | /* |
Daniel Veillard | cf46199 | 2000-03-14 18:30:20 +0000 | [diff] [blame] | 583 | * Namespace handling |
| 584 | */ |
| 585 | int xmlReconciliateNs (xmlDocPtr doc, |
| 586 | xmlNodePtr tree); |
| 587 | |
| 588 | /* |
Daniel Veillard | 1625364 | 1998-10-28 22:58:05 +0000 | [diff] [blame] | 589 | * Saving |
| 590 | */ |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 591 | void xmlDocDumpMemory (xmlDocPtr cur, |
Daniel Veillard | dd6b367 | 1999-09-23 22:19:22 +0000 | [diff] [blame] | 592 | xmlChar**mem, |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 593 | int *size); |
| 594 | void xmlDocDump (FILE *f, |
| 595 | xmlDocPtr cur); |
Daniel Veillard | dbfd641 | 1999-12-28 16:35:14 +0000 | [diff] [blame] | 596 | void xmlElemDump (FILE *f, |
Daniel Veillard | 0604743 | 2000-04-24 11:33:38 +0000 | [diff] [blame] | 597 | xmlDocPtr doc, |
| 598 | xmlNodePtr cur); |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 599 | int xmlSaveFile (const char *filename, |
| 600 | xmlDocPtr cur); |
Daniel Veillard | 151b1b0 | 1998-09-23 00:49:46 +0000 | [diff] [blame] | 601 | |
Daniel Veillard | 1625364 | 1998-10-28 22:58:05 +0000 | [diff] [blame] | 602 | /* |
| 603 | * Compression |
| 604 | */ |
Daniel Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 605 | int xmlGetDocCompressMode (xmlDocPtr doc); |
| 606 | void xmlSetDocCompressMode (xmlDocPtr doc, |
| 607 | int mode); |
| 608 | int xmlGetCompressMode (void); |
| 609 | void xmlSetCompressMode (int mode); |
Daniel Veillard | 260a68f | 1998-08-13 03:39:55 +0000 | [diff] [blame] | 610 | |
| 611 | #ifdef __cplusplus |
| 612 | } |
| 613 | #endif |
| 614 | |
| 615 | #endif /* __XML_TREE_H__ */ |
| 616 | |