Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +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 | c5d6434 | 2001-06-24 12:13:24 +0000 | [diff] [blame] | 7 | * daniel@veillard.com |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 8 | * |
| 9 | * 14 Nov 2000 ht - added redefinition of xmlBufferWriteChar for VMS |
| 10 | * |
| 11 | */ |
| 12 | |
| 13 | #ifndef __XML_TREE_H__ |
| 14 | #define __XML_TREE_H__ |
| 15 | |
| 16 | #include <stdio.h> |
Daniel Veillard | c5d6434 | 2001-06-24 12:13:24 +0000 | [diff] [blame] | 17 | #if defined(WIN32) && defined(_MSC_VER) |
| 18 | #include <libxml/xmlwin32version.h> |
| 19 | #else |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 20 | #include <libxml/xmlversion.h> |
Daniel Veillard | c5d6434 | 2001-06-24 12:13:24 +0000 | [diff] [blame] | 21 | #endif |
Daniel Veillard | 67a2130 | 2001-04-11 14:39:16 +0000 | [diff] [blame] | 22 | #include <libxml/xmlmemory.h> |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 23 | |
| 24 | #ifdef __cplusplus |
| 25 | extern "C" { |
| 26 | #endif |
| 27 | |
Daniel Veillard | 8bdb91d | 2001-10-31 17:52:43 +0000 | [diff] [blame] | 28 | /* |
| 29 | * Some of the basic types pointer to structures: |
| 30 | */ |
| 31 | /* xmlIO.h */ |
| 32 | typedef struct _xmlParserInputBuffer xmlParserInputBuffer; |
| 33 | typedef xmlParserInputBuffer *xmlParserInputBufferPtr; |
| 34 | |
CET 2001 Daniel Veillard | 5a37bde | 2001-11-01 14:31:22 +0000 | [diff] [blame] | 35 | typedef struct _xmlOutputBuffer xmlOutputBuffer; |
| 36 | typedef xmlOutputBuffer *xmlOutputBufferPtr; |
| 37 | |
Daniel Veillard | 8bdb91d | 2001-10-31 17:52:43 +0000 | [diff] [blame] | 38 | /* parser.h */ |
| 39 | typedef struct _xmlParserInput xmlParserInput; |
| 40 | typedef xmlParserInput *xmlParserInputPtr; |
| 41 | |
| 42 | typedef struct _xmlParserCtxt xmlParserCtxt; |
| 43 | typedef xmlParserCtxt *xmlParserCtxtPtr; |
| 44 | |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 45 | #define BASE_BUFFER_SIZE 4000 |
| 46 | |
Daniel Veillard | 5e2dace | 2001-07-18 19:30:27 +0000 | [diff] [blame] | 47 | /** |
| 48 | * XML_XML_NAMESPACE: |
| 49 | * |
| 50 | * This is the namespace for the special xml: prefix predefined in the |
| 51 | * XML Namespace specification |
| 52 | */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 53 | #define XML_XML_NAMESPACE \ |
| 54 | (const xmlChar *) "http://www.w3.org/XML/1998/namespace" |
| 55 | |
| 56 | /* |
| 57 | * The different element types carried by an XML tree |
| 58 | * |
| 59 | * NOTE: This is synchronized with DOM Level1 values |
| 60 | * See http://www.w3.org/TR/REC-DOM-Level-1/ |
| 61 | * |
| 62 | * Actually this had diverged a bit, and now XML_DOCUMENT_TYPE_NODE should |
| 63 | * be deprecated to use an XML_DTD_NODE. |
| 64 | */ |
| 65 | typedef enum { |
| 66 | XML_ELEMENT_NODE= 1, |
| 67 | XML_ATTRIBUTE_NODE= 2, |
| 68 | XML_TEXT_NODE= 3, |
| 69 | XML_CDATA_SECTION_NODE= 4, |
| 70 | XML_ENTITY_REF_NODE= 5, |
| 71 | XML_ENTITY_NODE= 6, |
| 72 | XML_PI_NODE= 7, |
| 73 | XML_COMMENT_NODE= 8, |
| 74 | XML_DOCUMENT_NODE= 9, |
| 75 | XML_DOCUMENT_TYPE_NODE= 10, |
| 76 | XML_DOCUMENT_FRAG_NODE= 11, |
| 77 | XML_NOTATION_NODE= 12, |
| 78 | XML_HTML_DOCUMENT_NODE= 13, |
| 79 | XML_DTD_NODE= 14, |
| 80 | XML_ELEMENT_DECL= 15, |
| 81 | XML_ATTRIBUTE_DECL= 16, |
| 82 | XML_ENTITY_DECL= 17, |
| 83 | XML_NAMESPACE_DECL= 18, |
| 84 | XML_XINCLUDE_START= 19, |
| 85 | XML_XINCLUDE_END= 20 |
Daniel Veillard | eae522a | 2001-04-23 13:41:34 +0000 | [diff] [blame] | 86 | #ifdef LIBXML_DOCB_ENABLED |
| 87 | ,XML_DOCB_DOCUMENT_NODE= 21 |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 88 | #endif |
| 89 | } xmlElementType; |
| 90 | |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 91 | /** |
| 92 | * xmlChar: |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 93 | * |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 94 | * This is a basic byte in an UTF-8 encoded string. |
| 95 | * It's unsigned allowing to pinpoint case where char * are assigned |
| 96 | * to xmlChar * (possibly making serialization back impossible). |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 97 | */ |
| 98 | |
| 99 | typedef unsigned char xmlChar; |
| 100 | |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 101 | /** |
| 102 | * BAD_CAST: |
| 103 | * |
| 104 | * Macro to cast a string to an xmlChar * when one know its safe. |
| 105 | */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 106 | #define BAD_CAST (xmlChar *) |
| 107 | |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 108 | /** |
| 109 | * xmlNotation: |
| 110 | * |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 111 | * a DTD Notation definition |
| 112 | */ |
| 113 | |
| 114 | typedef struct _xmlNotation xmlNotation; |
| 115 | typedef xmlNotation *xmlNotationPtr; |
| 116 | struct _xmlNotation { |
Daniel Veillard | 9e7160d | 2001-03-18 23:17:47 +0000 | [diff] [blame] | 117 | const xmlChar *name; /* Notation name */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 118 | const xmlChar *PublicID; /* Public identifier, if any */ |
| 119 | const xmlChar *SystemID; /* System identifier, if any */ |
| 120 | }; |
| 121 | |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 122 | /** |
| 123 | * xmlAttributeType: |
| 124 | * |
| 125 | * a DTD Attribute type definition |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 126 | */ |
| 127 | |
| 128 | typedef enum { |
| 129 | XML_ATTRIBUTE_CDATA = 1, |
| 130 | XML_ATTRIBUTE_ID, |
| 131 | XML_ATTRIBUTE_IDREF , |
| 132 | XML_ATTRIBUTE_IDREFS, |
| 133 | XML_ATTRIBUTE_ENTITY, |
| 134 | XML_ATTRIBUTE_ENTITIES, |
| 135 | XML_ATTRIBUTE_NMTOKEN, |
| 136 | XML_ATTRIBUTE_NMTOKENS, |
| 137 | XML_ATTRIBUTE_ENUMERATION, |
| 138 | XML_ATTRIBUTE_NOTATION |
| 139 | } xmlAttributeType; |
| 140 | |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 141 | /** |
| 142 | * xmlAttributeDefault: |
| 143 | * |
| 144 | * a DTD Attribute default definition |
| 145 | */ |
| 146 | |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 147 | typedef enum { |
| 148 | XML_ATTRIBUTE_NONE = 1, |
| 149 | XML_ATTRIBUTE_REQUIRED, |
| 150 | XML_ATTRIBUTE_IMPLIED, |
| 151 | XML_ATTRIBUTE_FIXED |
| 152 | } xmlAttributeDefault; |
| 153 | |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 154 | /** |
| 155 | * xmlEnumeration: |
| 156 | * |
| 157 | * list structure used when there is an enumeration in DTDs |
| 158 | */ |
| 159 | |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 160 | typedef struct _xmlEnumeration xmlEnumeration; |
| 161 | typedef xmlEnumeration *xmlEnumerationPtr; |
| 162 | struct _xmlEnumeration { |
| 163 | struct _xmlEnumeration *next; /* next one */ |
| 164 | const xmlChar *name; /* Enumeration name */ |
| 165 | }; |
| 166 | |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 167 | /** |
| 168 | * xmlAttribute: |
| 169 | * |
| 170 | * an Attribute declaration in a DTD |
| 171 | */ |
| 172 | |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 173 | typedef struct _xmlAttribute xmlAttribute; |
| 174 | typedef xmlAttribute *xmlAttributePtr; |
| 175 | struct _xmlAttribute { |
Daniel Veillard | 0ec9863 | 2001-11-14 15:04:32 +0000 | [diff] [blame] | 176 | void *_private; /* application data */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 177 | xmlElementType type; /* XML_ATTRIBUTE_DECL, must be second ! */ |
| 178 | const xmlChar *name; /* Attribute name */ |
| 179 | struct _xmlNode *children; /* NULL */ |
| 180 | struct _xmlNode *last; /* NULL */ |
| 181 | struct _xmlDtd *parent; /* -> DTD */ |
| 182 | struct _xmlNode *next; /* next sibling link */ |
| 183 | struct _xmlNode *prev; /* previous sibling link */ |
| 184 | struct _xmlDoc *doc; /* the containing document */ |
| 185 | |
| 186 | struct _xmlAttribute *nexth; /* next in hash table */ |
| 187 | xmlAttributeType atype; /* The attribute type */ |
| 188 | xmlAttributeDefault def; /* the default */ |
| 189 | const xmlChar *defaultValue; /* or the default value */ |
| 190 | xmlEnumerationPtr tree; /* or the enumeration tree if any */ |
| 191 | const xmlChar *prefix; /* the namespace prefix if any */ |
| 192 | const xmlChar *elem; /* Element holding the attribute */ |
| 193 | }; |
| 194 | |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 195 | /** |
| 196 | * xmlElementContentType: |
| 197 | * |
| 198 | * Possible definitions of element content types |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 199 | */ |
| 200 | typedef enum { |
| 201 | XML_ELEMENT_CONTENT_PCDATA = 1, |
| 202 | XML_ELEMENT_CONTENT_ELEMENT, |
| 203 | XML_ELEMENT_CONTENT_SEQ, |
| 204 | XML_ELEMENT_CONTENT_OR |
| 205 | } xmlElementContentType; |
| 206 | |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 207 | /** |
| 208 | * xmlElementContentOccur: |
| 209 | * |
Daniel Veillard | d164092 | 2001-12-17 15:30:10 +0000 | [diff] [blame^] | 210 | * Possible definitions of element content occurrences |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 211 | */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 212 | typedef enum { |
| 213 | XML_ELEMENT_CONTENT_ONCE = 1, |
| 214 | XML_ELEMENT_CONTENT_OPT, |
| 215 | XML_ELEMENT_CONTENT_MULT, |
| 216 | XML_ELEMENT_CONTENT_PLUS |
| 217 | } xmlElementContentOccur; |
| 218 | |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 219 | /** |
| 220 | * xmlElementContent: |
| 221 | * |
| 222 | * an XML Element content as stored after parsing an element definition |
| 223 | * in a DTD. |
| 224 | */ |
| 225 | |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 226 | typedef struct _xmlElementContent xmlElementContent; |
| 227 | typedef xmlElementContent *xmlElementContentPtr; |
| 228 | struct _xmlElementContent { |
| 229 | xmlElementContentType type; /* PCDATA, ELEMENT, SEQ or OR */ |
| 230 | xmlElementContentOccur ocur; /* ONCE, OPT, MULT or PLUS */ |
Daniel Veillard | be480fb | 2001-11-08 23:36:42 +0000 | [diff] [blame] | 231 | const xmlChar *name; /* Element name */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 232 | struct _xmlElementContent *c1; /* first child */ |
| 233 | struct _xmlElementContent *c2; /* second child */ |
Daniel Veillard | dab4cb3 | 2001-04-20 13:03:48 +0000 | [diff] [blame] | 234 | struct _xmlElementContent *parent; /* parent */ |
Daniel Veillard | be480fb | 2001-11-08 23:36:42 +0000 | [diff] [blame] | 235 | const xmlChar *prefix; /* Element name */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 236 | }; |
| 237 | |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 238 | /** |
| 239 | * xmlElementTypeVal: |
| 240 | * |
Daniel Veillard | d164092 | 2001-12-17 15:30:10 +0000 | [diff] [blame^] | 241 | * the different possibilities for an element content type |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 242 | */ |
| 243 | |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 244 | typedef enum { |
Daniel Veillard | a10efa8 | 2001-04-18 13:09:01 +0000 | [diff] [blame] | 245 | XML_ELEMENT_TYPE_UNDEFINED = 0, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 246 | XML_ELEMENT_TYPE_EMPTY = 1, |
| 247 | XML_ELEMENT_TYPE_ANY, |
| 248 | XML_ELEMENT_TYPE_MIXED, |
| 249 | XML_ELEMENT_TYPE_ELEMENT |
| 250 | } xmlElementTypeVal; |
| 251 | |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 252 | /** |
| 253 | * xmlElement: |
| 254 | * |
| 255 | * an XML Element declaration from a DTD |
| 256 | */ |
| 257 | |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 258 | typedef struct _xmlElement xmlElement; |
| 259 | typedef xmlElement *xmlElementPtr; |
| 260 | struct _xmlElement { |
Daniel Veillard | 0ec9863 | 2001-11-14 15:04:32 +0000 | [diff] [blame] | 261 | void *_private; /* application data */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 262 | xmlElementType type; /* XML_ELEMENT_DECL, must be second ! */ |
| 263 | const xmlChar *name; /* Element name */ |
| 264 | struct _xmlNode *children; /* NULL */ |
| 265 | struct _xmlNode *last; /* NULL */ |
| 266 | struct _xmlDtd *parent; /* -> DTD */ |
| 267 | struct _xmlNode *next; /* next sibling link */ |
| 268 | struct _xmlNode *prev; /* previous sibling link */ |
| 269 | struct _xmlDoc *doc; /* the containing document */ |
| 270 | |
| 271 | xmlElementTypeVal etype; /* The type */ |
| 272 | xmlElementContentPtr content; /* the allowed element content */ |
| 273 | xmlAttributePtr attributes; /* List of the declared attributes */ |
| 274 | const xmlChar *prefix; /* the namespace prefix if any */ |
| 275 | }; |
| 276 | |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 277 | |
Daniel Veillard | 5e2dace | 2001-07-18 19:30:27 +0000 | [diff] [blame] | 278 | /** |
| 279 | * XML_LOCAL_NAMESPACE: |
| 280 | * |
| 281 | * A namespace declaration node |
| 282 | */ |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 283 | #define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL |
| 284 | typedef xmlElementType xmlNsType; |
| 285 | |
| 286 | /** |
| 287 | * xmlNs: |
| 288 | * |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 289 | * An XML namespace. |
| 290 | * Note that prefix == NULL is valid, it defines the default namespace |
Daniel Veillard | d164092 | 2001-12-17 15:30:10 +0000 | [diff] [blame^] | 291 | * within the subtree (until overridden). |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 292 | * |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 293 | * xmlNsType is unified with xmlElementType |
| 294 | */ |
| 295 | |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 296 | typedef struct _xmlNs xmlNs; |
| 297 | typedef xmlNs *xmlNsPtr; |
| 298 | struct _xmlNs { |
| 299 | struct _xmlNs *next; /* next Ns link for this node */ |
| 300 | xmlNsType type; /* global or local */ |
| 301 | const xmlChar *href; /* URL for the namespace */ |
| 302 | const xmlChar *prefix; /* prefix for the namespace */ |
| 303 | }; |
| 304 | |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 305 | /** |
| 306 | * xmlDtd: |
| 307 | * |
Daniel Veillard | d164092 | 2001-12-17 15:30:10 +0000 | [diff] [blame^] | 308 | * An XML DTD, as defined by <!DOCTYPE ... There is actually one for |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 309 | * the internal subset and for the external subset |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 310 | */ |
| 311 | typedef struct _xmlDtd xmlDtd; |
| 312 | typedef xmlDtd *xmlDtdPtr; |
| 313 | struct _xmlDtd { |
Daniel Veillard | 0ec9863 | 2001-11-14 15:04:32 +0000 | [diff] [blame] | 314 | void *_private; /* application data */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 315 | xmlElementType type; /* XML_DTD_NODE, must be second ! */ |
| 316 | const xmlChar *name; /* Name of the DTD */ |
| 317 | struct _xmlNode *children; /* the value of the property link */ |
| 318 | struct _xmlNode *last; /* last child link */ |
| 319 | struct _xmlDoc *parent; /* child->parent link */ |
| 320 | struct _xmlNode *next; /* next sibling link */ |
| 321 | struct _xmlNode *prev; /* previous sibling link */ |
| 322 | struct _xmlDoc *doc; /* the containing document */ |
| 323 | |
| 324 | /* End of common part */ |
| 325 | void *notations; /* Hash table for notations if any */ |
| 326 | void *elements; /* Hash table for elements if any */ |
| 327 | void *attributes; /* Hash table for attributes if any */ |
| 328 | void *entities; /* Hash table for entities if any */ |
| 329 | const xmlChar *ExternalID; /* External identifier for PUBLIC DTD */ |
| 330 | const xmlChar *SystemID; /* URI for a SYSTEM or PUBLIC DTD */ |
| 331 | void *pentities; /* Hash table for param entities if any */ |
| 332 | }; |
| 333 | |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 334 | /** |
| 335 | * xmlAttr: |
| 336 | * |
| 337 | * A attribute on an XML node. |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 338 | */ |
| 339 | typedef struct _xmlAttr xmlAttr; |
| 340 | typedef xmlAttr *xmlAttrPtr; |
| 341 | struct _xmlAttr { |
Daniel Veillard | 0ec9863 | 2001-11-14 15:04:32 +0000 | [diff] [blame] | 342 | void *_private; /* application data */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 343 | xmlElementType type; /* XML_ATTRIBUTE_NODE, must be second ! */ |
| 344 | const xmlChar *name; /* the name of the property */ |
| 345 | struct _xmlNode *children; /* the value of the property */ |
| 346 | struct _xmlNode *last; /* NULL */ |
| 347 | struct _xmlNode *parent; /* child->parent link */ |
| 348 | struct _xmlAttr *next; /* next sibling link */ |
| 349 | struct _xmlAttr *prev; /* previous sibling link */ |
| 350 | struct _xmlDoc *doc; /* the containing document */ |
| 351 | xmlNs *ns; /* pointer to the associated namespace */ |
| 352 | xmlAttributeType atype; /* the attribute type if validating */ |
| 353 | }; |
| 354 | |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 355 | /** |
| 356 | * xmlID: |
| 357 | * |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 358 | * An XML ID instance. |
| 359 | */ |
| 360 | |
| 361 | typedef struct _xmlID xmlID; |
| 362 | typedef xmlID *xmlIDPtr; |
| 363 | struct _xmlID { |
| 364 | struct _xmlID *next; /* next ID */ |
| 365 | const xmlChar *value; /* The ID name */ |
Daniel Veillard | d164092 | 2001-12-17 15:30:10 +0000 | [diff] [blame^] | 366 | xmlAttrPtr attr; /* The attribute holding it */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 367 | }; |
| 368 | |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 369 | /** |
| 370 | * xmlRef: |
| 371 | * |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 372 | * An XML IDREF instance. |
| 373 | */ |
| 374 | |
| 375 | typedef struct _xmlRef xmlRef; |
| 376 | typedef xmlRef *xmlRefPtr; |
| 377 | struct _xmlRef { |
| 378 | struct _xmlRef *next; /* next Ref */ |
| 379 | const xmlChar *value; /* The Ref name */ |
Daniel Veillard | d164092 | 2001-12-17 15:30:10 +0000 | [diff] [blame^] | 380 | xmlAttrPtr attr; /* The attribute holding it */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 381 | }; |
| 382 | |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 383 | /** |
| 384 | * xmlBufferAllocationScheme: |
| 385 | * |
| 386 | * A buffer allocation scheme can be defined to either match exactly the |
| 387 | * need or double it's allocated size each time it is found too small |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 388 | */ |
| 389 | |
| 390 | typedef enum { |
| 391 | XML_BUFFER_ALLOC_DOUBLEIT, |
| 392 | XML_BUFFER_ALLOC_EXACT |
| 393 | } xmlBufferAllocationScheme; |
| 394 | |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 395 | /** |
| 396 | * xmlBuffer: |
| 397 | * |
| 398 | * A buffer structure |
| 399 | */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 400 | typedef struct _xmlBuffer xmlBuffer; |
| 401 | typedef xmlBuffer *xmlBufferPtr; |
| 402 | struct _xmlBuffer { |
| 403 | xmlChar *content; /* The buffer content UTF8 */ |
| 404 | unsigned int use; /* The buffer size used */ |
| 405 | unsigned int size; /* The buffer size */ |
| 406 | xmlBufferAllocationScheme alloc; /* The realloc method */ |
| 407 | }; |
| 408 | |
Daniel Veillard | f69bb4b | 2001-05-19 13:24:56 +0000 | [diff] [blame] | 409 | /** |
| 410 | * xmlNode: |
| 411 | * |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 412 | * A node in an XML tree. |
| 413 | */ |
| 414 | typedef struct _xmlNode xmlNode; |
| 415 | typedef xmlNode *xmlNodePtr; |
| 416 | struct _xmlNode { |
Daniel Veillard | 0ec9863 | 2001-11-14 15:04:32 +0000 | [diff] [blame] | 417 | void *_private; /* application data */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 418 | xmlElementType type; /* type number, must be second ! */ |
| 419 | const xmlChar *name; /* the name of the node, or the entity */ |
| 420 | struct _xmlNode *children; /* parent->childs link */ |
| 421 | struct _xmlNode *last; /* last child link */ |
| 422 | struct _xmlNode *parent; /* child->parent link */ |
| 423 | struct _xmlNode *next; /* next sibling link */ |
| 424 | struct _xmlNode *prev; /* previous sibling link */ |
| 425 | struct _xmlDoc *doc; /* the containing document */ |
| 426 | xmlNs *ns; /* pointer to the associated namespace */ |
| 427 | #ifndef XML_USE_BUFFER_CONTENT |
| 428 | xmlChar *content; /* the content */ |
| 429 | #else |
| 430 | xmlBufferPtr content; /* the content in a buffer */ |
| 431 | #endif |
| 432 | |
| 433 | /* End of common part */ |
| 434 | struct _xmlAttr *properties;/* properties list */ |
| 435 | xmlNs *nsDef; /* namespace definitions on this node */ |
| 436 | }; |
| 437 | |
Daniel Veillard | 5e2dace | 2001-07-18 19:30:27 +0000 | [diff] [blame] | 438 | /** |
| 439 | * XML_GET_CONTENT: |
| 440 | * |
| 441 | * macro to extract the content pointer of a node |
| 442 | */ |
| 443 | #define XML_GET_CONTENT(n) \ |
Daniel Veillard | 566d4df | 2001-11-22 13:00:53 +0000 | [diff] [blame] | 444 | ((n)->type == XML_ELEMENT_NODE ? NULL : (n)->content) |
Daniel Veillard | 5e2dace | 2001-07-18 19:30:27 +0000 | [diff] [blame] | 445 | |
| 446 | /** |
| 447 | * XML_GET_LINE: |
| 448 | * |
Daniel Veillard | 566d4df | 2001-11-22 13:00:53 +0000 | [diff] [blame] | 449 | * macro to extract the line number of an element node. |
| 450 | * This will work only if line numbering is activated by |
| 451 | * calling xmlLineNumbersDefault(1) before parsing |
Daniel Veillard | 5e2dace | 2001-07-18 19:30:27 +0000 | [diff] [blame] | 452 | */ |
| 453 | #define XML_GET_LINE(n) \ |
Daniel Veillard | 566d4df | 2001-11-22 13:00:53 +0000 | [diff] [blame] | 454 | ((n)->type == XML_ELEMENT_NODE ? (int) (n)->content : 0) |
Daniel Veillard | 7db3773 | 2001-07-12 01:20:08 +0000 | [diff] [blame] | 455 | |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 456 | /** |
| 457 | * xmlDoc: |
| 458 | * |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 459 | * An XML document. |
| 460 | */ |
| 461 | typedef struct _xmlDoc xmlDoc; |
| 462 | typedef xmlDoc *xmlDocPtr; |
| 463 | struct _xmlDoc { |
Daniel Veillard | 0ec9863 | 2001-11-14 15:04:32 +0000 | [diff] [blame] | 464 | void *_private; /* application data */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 465 | xmlElementType type; /* XML_DOCUMENT_NODE, must be second ! */ |
| 466 | char *name; /* name/filename/URI of the document */ |
| 467 | struct _xmlNode *children; /* the document tree */ |
| 468 | struct _xmlNode *last; /* last child link */ |
| 469 | struct _xmlNode *parent; /* child->parent link */ |
| 470 | struct _xmlNode *next; /* next sibling link */ |
| 471 | struct _xmlNode *prev; /* previous sibling link */ |
| 472 | struct _xmlDoc *doc; /* autoreference to itself */ |
| 473 | |
| 474 | /* End of common part */ |
| 475 | int compression;/* level of zlib compression */ |
| 476 | int standalone; /* standalone document (no external refs) */ |
| 477 | struct _xmlDtd *intSubset; /* the document internal subset */ |
| 478 | struct _xmlDtd *extSubset; /* the document external subset */ |
| 479 | struct _xmlNs *oldNs; /* Global namespace, the old way */ |
| 480 | const xmlChar *version; /* the XML version string */ |
| 481 | const xmlChar *encoding; /* external initial encoding, if any */ |
| 482 | void *ids; /* Hash table for ID attributes if any */ |
| 483 | void *refs; /* Hash table for IDREFs attributes if any */ |
| 484 | const xmlChar *URL; /* The URI for that document */ |
| 485 | int charset; /* encoding of the in-memory content |
| 486 | actually an xmlCharEncoding */ |
| 487 | }; |
| 488 | |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 489 | /** |
| 490 | * xmlChildrenNode: |
| 491 | * |
| 492 | * Macro for compatibility naming layer with libxml1 |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 493 | */ |
| 494 | #ifndef xmlChildrenNode |
| 495 | #define xmlChildrenNode children |
Daniel Veillard | bed7b05 | 2001-05-19 14:59:49 +0000 | [diff] [blame] | 496 | #endif |
| 497 | |
| 498 | /** |
| 499 | * xmlRootNode: |
| 500 | * |
| 501 | * Macro for compatibility naming layer with libxml1 |
| 502 | */ |
| 503 | #ifndef xmlRootNode |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 504 | #define xmlRootNode children |
| 505 | #endif |
| 506 | |
| 507 | /* |
| 508 | * Variables. |
| 509 | */ |
| 510 | LIBXML_DLL_IMPORT extern xmlNsPtr baseDTD; |
| 511 | LIBXML_DLL_IMPORT extern int oldXMLWDcompatibility;/* maintain compatibility with old WD */ |
| 512 | LIBXML_DLL_IMPORT extern int xmlIndentTreeOutput; /* try to indent the tree dumps */ |
| 513 | LIBXML_DLL_IMPORT extern xmlBufferAllocationScheme xmlBufferAllocScheme; /* alloc scheme to use */ |
Daniel Veillard | e356c28 | 2001-03-10 12:32:04 +0000 | [diff] [blame] | 514 | LIBXML_DLL_IMPORT extern int xmlSaveNoEmptyTags; /* save empty tags as <empty></empty> */ |
| 515 | LIBXML_DLL_IMPORT extern int xmlDefaultBufferSize; /* default buffer size */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 516 | |
| 517 | /* |
| 518 | * Handling Buffers. |
| 519 | */ |
| 520 | |
Daniel Veillard | 56a4cb8 | 2001-03-24 17:00:36 +0000 | [diff] [blame] | 521 | void xmlSetBufferAllocationScheme(xmlBufferAllocationScheme scheme); |
| 522 | xmlBufferAllocationScheme xmlGetBufferAllocationScheme(void); |
| 523 | |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 524 | xmlBufferPtr xmlBufferCreate (void); |
| 525 | xmlBufferPtr xmlBufferCreateSize (size_t size); |
Daniel Veillard | 56a4cb8 | 2001-03-24 17:00:36 +0000 | [diff] [blame] | 526 | int xmlBufferResize (xmlBufferPtr buf, |
| 527 | unsigned int size); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 528 | void xmlBufferFree (xmlBufferPtr buf); |
| 529 | int xmlBufferDump (FILE *file, |
| 530 | xmlBufferPtr buf); |
| 531 | void xmlBufferAdd (xmlBufferPtr buf, |
| 532 | const xmlChar *str, |
| 533 | int len); |
| 534 | void xmlBufferAddHead (xmlBufferPtr buf, |
| 535 | const xmlChar *str, |
| 536 | int len); |
| 537 | void xmlBufferCat (xmlBufferPtr buf, |
| 538 | const xmlChar *str); |
| 539 | void xmlBufferCCat (xmlBufferPtr buf, |
| 540 | const char *str); |
| 541 | int xmlBufferShrink (xmlBufferPtr buf, |
| 542 | unsigned int len); |
| 543 | int xmlBufferGrow (xmlBufferPtr buf, |
| 544 | unsigned int len); |
| 545 | void xmlBufferEmpty (xmlBufferPtr buf); |
| 546 | const xmlChar* xmlBufferContent (const xmlBufferPtr buf); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 547 | void xmlBufferSetAllocationScheme(xmlBufferPtr buf, |
| 548 | xmlBufferAllocationScheme scheme); |
| 549 | int xmlBufferLength (const xmlBufferPtr buf); |
| 550 | |
| 551 | /* |
| 552 | * Creating/freeing new structures |
| 553 | */ |
| 554 | xmlDtdPtr xmlCreateIntSubset (xmlDocPtr doc, |
| 555 | const xmlChar *name, |
| 556 | const xmlChar *ExternalID, |
| 557 | const xmlChar *SystemID); |
| 558 | xmlDtdPtr xmlNewDtd (xmlDocPtr doc, |
| 559 | const xmlChar *name, |
| 560 | const xmlChar *ExternalID, |
| 561 | const xmlChar *SystemID); |
| 562 | xmlDtdPtr xmlGetIntSubset (xmlDocPtr doc); |
| 563 | void xmlFreeDtd (xmlDtdPtr cur); |
| 564 | xmlNsPtr xmlNewGlobalNs (xmlDocPtr doc, |
| 565 | const xmlChar *href, |
| 566 | const xmlChar *prefix); |
| 567 | xmlNsPtr xmlNewNs (xmlNodePtr node, |
| 568 | const xmlChar *href, |
| 569 | const xmlChar *prefix); |
| 570 | void xmlFreeNs (xmlNsPtr cur); |
Daniel Veillard | 56a4cb8 | 2001-03-24 17:00:36 +0000 | [diff] [blame] | 571 | void xmlFreeNsList (xmlNsPtr cur); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 572 | xmlDocPtr xmlNewDoc (const xmlChar *version); |
| 573 | void xmlFreeDoc (xmlDocPtr cur); |
| 574 | xmlAttrPtr xmlNewDocProp (xmlDocPtr doc, |
| 575 | const xmlChar *name, |
| 576 | const xmlChar *value); |
| 577 | xmlAttrPtr xmlNewProp (xmlNodePtr node, |
| 578 | const xmlChar *name, |
| 579 | const xmlChar *value); |
| 580 | xmlAttrPtr xmlNewNsProp (xmlNodePtr node, |
| 581 | xmlNsPtr ns, |
| 582 | const xmlChar *name, |
| 583 | const xmlChar *value); |
| 584 | void xmlFreePropList (xmlAttrPtr cur); |
| 585 | void xmlFreeProp (xmlAttrPtr cur); |
| 586 | xmlAttrPtr xmlCopyProp (xmlNodePtr target, |
| 587 | xmlAttrPtr cur); |
| 588 | xmlAttrPtr xmlCopyPropList (xmlNodePtr target, |
| 589 | xmlAttrPtr cur); |
| 590 | xmlDtdPtr xmlCopyDtd (xmlDtdPtr dtd); |
| 591 | xmlDocPtr xmlCopyDoc (xmlDocPtr doc, |
| 592 | int recursive); |
| 593 | |
| 594 | /* |
| 595 | * Creating new nodes |
| 596 | */ |
| 597 | xmlNodePtr xmlNewDocNode (xmlDocPtr doc, |
| 598 | xmlNsPtr ns, |
| 599 | const xmlChar *name, |
| 600 | const xmlChar *content); |
| 601 | xmlNodePtr xmlNewDocRawNode (xmlDocPtr doc, |
| 602 | xmlNsPtr ns, |
| 603 | const xmlChar *name, |
| 604 | const xmlChar *content); |
| 605 | xmlNodePtr xmlNewNode (xmlNsPtr ns, |
| 606 | const xmlChar *name); |
| 607 | xmlNodePtr xmlNewChild (xmlNodePtr parent, |
| 608 | xmlNsPtr ns, |
| 609 | const xmlChar *name, |
| 610 | const xmlChar *content); |
| 611 | xmlNodePtr xmlNewTextChild (xmlNodePtr parent, |
| 612 | xmlNsPtr ns, |
| 613 | const xmlChar *name, |
| 614 | const xmlChar *content); |
| 615 | xmlNodePtr xmlNewDocText (xmlDocPtr doc, |
| 616 | const xmlChar *content); |
| 617 | xmlNodePtr xmlNewText (const xmlChar *content); |
| 618 | xmlNodePtr xmlNewPI (const xmlChar *name, |
| 619 | const xmlChar *content); |
| 620 | xmlNodePtr xmlNewDocTextLen (xmlDocPtr doc, |
| 621 | const xmlChar *content, |
| 622 | int len); |
| 623 | xmlNodePtr xmlNewTextLen (const xmlChar *content, |
| 624 | int len); |
| 625 | xmlNodePtr xmlNewDocComment (xmlDocPtr doc, |
| 626 | const xmlChar *content); |
| 627 | xmlNodePtr xmlNewComment (const xmlChar *content); |
| 628 | xmlNodePtr xmlNewCDataBlock (xmlDocPtr doc, |
| 629 | const xmlChar *content, |
| 630 | int len); |
| 631 | xmlNodePtr xmlNewCharRef (xmlDocPtr doc, |
| 632 | const xmlChar *name); |
| 633 | xmlNodePtr xmlNewReference (xmlDocPtr doc, |
| 634 | const xmlChar *name); |
Daniel Veillard | 2ebd7a7 | 2001-08-28 21:07:03 +0000 | [diff] [blame] | 635 | xmlNodePtr xmlCopyNode (const xmlNodePtr node, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 636 | int recursive); |
Daniel Veillard | 82daa81 | 2001-04-12 08:55:36 +0000 | [diff] [blame] | 637 | xmlNodePtr xmlDocCopyNode (xmlNodePtr node, |
| 638 | xmlDocPtr doc, |
| 639 | int recursive); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 640 | xmlNodePtr xmlCopyNodeList (xmlNodePtr node); |
| 641 | xmlNodePtr xmlNewDocFragment (xmlDocPtr doc); |
| 642 | |
| 643 | /* |
| 644 | * Navigating |
| 645 | */ |
Daniel Veillard | 8faa783 | 2001-11-26 15:58:08 +0000 | [diff] [blame] | 646 | long xmlGetLineNo (xmlNodePtr node); |
| 647 | xmlChar * xmlGetNodePath (xmlNodePtr node); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 648 | xmlNodePtr xmlDocGetRootElement (xmlDocPtr doc); |
| 649 | xmlNodePtr xmlGetLastChild (xmlNodePtr parent); |
| 650 | int xmlNodeIsText (xmlNodePtr node); |
| 651 | int xmlIsBlankNode (xmlNodePtr node); |
| 652 | |
| 653 | /* |
| 654 | * Changing the structure |
| 655 | */ |
| 656 | xmlNodePtr xmlDocSetRootElement (xmlDocPtr doc, |
| 657 | xmlNodePtr root); |
| 658 | void xmlNodeSetName (xmlNodePtr cur, |
| 659 | const xmlChar *name); |
| 660 | xmlNodePtr xmlAddChild (xmlNodePtr parent, |
| 661 | xmlNodePtr cur); |
| 662 | xmlNodePtr xmlAddChildList (xmlNodePtr parent, |
| 663 | xmlNodePtr cur); |
| 664 | xmlNodePtr xmlReplaceNode (xmlNodePtr old, |
| 665 | xmlNodePtr cur); |
| 666 | xmlNodePtr xmlAddSibling (xmlNodePtr cur, |
| 667 | xmlNodePtr elem); |
| 668 | xmlNodePtr xmlAddPrevSibling (xmlNodePtr cur, |
| 669 | xmlNodePtr elem); |
| 670 | xmlNodePtr xmlAddNextSibling (xmlNodePtr cur, |
| 671 | xmlNodePtr elem); |
| 672 | void xmlUnlinkNode (xmlNodePtr cur); |
| 673 | xmlNodePtr xmlTextMerge (xmlNodePtr first, |
| 674 | xmlNodePtr second); |
| 675 | void xmlTextConcat (xmlNodePtr node, |
| 676 | const xmlChar *content, |
| 677 | int len); |
| 678 | void xmlFreeNodeList (xmlNodePtr cur); |
| 679 | void xmlFreeNode (xmlNodePtr cur); |
| 680 | void xmlSetTreeDoc (xmlNodePtr tree, |
| 681 | xmlDocPtr doc); |
| 682 | void xmlSetListDoc (xmlNodePtr list, |
| 683 | xmlDocPtr doc); |
| 684 | |
| 685 | /* |
| 686 | * Namespaces |
| 687 | */ |
| 688 | xmlNsPtr xmlSearchNs (xmlDocPtr doc, |
| 689 | xmlNodePtr node, |
| 690 | const xmlChar *nameSpace); |
| 691 | xmlNsPtr xmlSearchNsByHref (xmlDocPtr doc, |
| 692 | xmlNodePtr node, |
| 693 | const xmlChar *href); |
| 694 | xmlNsPtr * xmlGetNsList (xmlDocPtr doc, |
| 695 | xmlNodePtr node); |
| 696 | void xmlSetNs (xmlNodePtr node, |
| 697 | xmlNsPtr ns); |
| 698 | xmlNsPtr xmlCopyNamespace (xmlNsPtr cur); |
| 699 | xmlNsPtr xmlCopyNamespaceList (xmlNsPtr cur); |
| 700 | |
| 701 | /* |
| 702 | * Changing the content. |
| 703 | */ |
| 704 | xmlAttrPtr xmlSetProp (xmlNodePtr node, |
| 705 | const xmlChar *name, |
| 706 | const xmlChar *value); |
| 707 | xmlChar * xmlGetProp (xmlNodePtr node, |
| 708 | const xmlChar *name); |
| 709 | xmlAttrPtr xmlHasProp (xmlNodePtr node, |
| 710 | const xmlChar *name); |
Daniel Veillard | e95e239 | 2001-06-06 10:46:28 +0000 | [diff] [blame] | 711 | xmlAttrPtr xmlHasNsProp (xmlNodePtr node, |
| 712 | const xmlChar *name, |
Daniel Veillard | ca2366a | 2001-06-11 12:09:01 +0000 | [diff] [blame] | 713 | const xmlChar *nameSpace); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 714 | xmlAttrPtr xmlSetNsProp (xmlNodePtr node, |
| 715 | xmlNsPtr ns, |
| 716 | const xmlChar *name, |
| 717 | const xmlChar *value); |
| 718 | xmlChar * xmlGetNsProp (xmlNodePtr node, |
| 719 | const xmlChar *name, |
| 720 | const xmlChar *nameSpace); |
| 721 | xmlNodePtr xmlStringGetNodeList (xmlDocPtr doc, |
| 722 | const xmlChar *value); |
| 723 | xmlNodePtr xmlStringLenGetNodeList (xmlDocPtr doc, |
| 724 | const xmlChar *value, |
| 725 | int len); |
| 726 | xmlChar * xmlNodeListGetString (xmlDocPtr doc, |
| 727 | xmlNodePtr list, |
| 728 | int inLine); |
| 729 | xmlChar * xmlNodeListGetRawString (xmlDocPtr doc, |
| 730 | xmlNodePtr list, |
| 731 | int inLine); |
| 732 | void xmlNodeSetContent (xmlNodePtr cur, |
| 733 | const xmlChar *content); |
| 734 | void xmlNodeSetContentLen (xmlNodePtr cur, |
| 735 | const xmlChar *content, |
| 736 | int len); |
| 737 | void xmlNodeAddContent (xmlNodePtr cur, |
| 738 | const xmlChar *content); |
| 739 | void xmlNodeAddContentLen (xmlNodePtr cur, |
| 740 | const xmlChar *content, |
| 741 | int len); |
| 742 | xmlChar * xmlNodeGetContent (xmlNodePtr cur); |
| 743 | xmlChar * xmlNodeGetLang (xmlNodePtr cur); |
| 744 | void xmlNodeSetLang (xmlNodePtr cur, |
| 745 | const xmlChar *lang); |
| 746 | int xmlNodeGetSpacePreserve (xmlNodePtr cur); |
Daniel Veillard | d164092 | 2001-12-17 15:30:10 +0000 | [diff] [blame^] | 747 | void xmlNodeSetSpacePreserve (xmlNodePtr cur, |
| 748 | int val); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 749 | xmlChar * xmlNodeGetBase (xmlDocPtr doc, |
| 750 | xmlNodePtr cur); |
| 751 | void xmlNodeSetBase (xmlNodePtr cur, |
| 752 | xmlChar *uri); |
| 753 | |
| 754 | /* |
| 755 | * Removing content. |
| 756 | */ |
Daniel Veillard | d164092 | 2001-12-17 15:30:10 +0000 | [diff] [blame^] | 757 | int xmlRemoveProp (xmlAttrPtr cur); |
Daniel Veillard | 9403a04 | 2001-05-28 11:00:53 +0000 | [diff] [blame] | 758 | int xmlUnsetProp (xmlNodePtr node, |
| 759 | const xmlChar *name); |
| 760 | int xmlUnsetNsProp (xmlNodePtr node, |
| 761 | xmlNsPtr ns, |
| 762 | const xmlChar *name); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 763 | |
| 764 | /* |
| 765 | * Internal, don't use |
| 766 | */ |
| 767 | #ifdef VMS |
| 768 | void xmlBufferWriteXmlCHAR (xmlBufferPtr buf, |
| 769 | const xmlChar *string); |
| 770 | #define xmlBufferWriteCHAR xmlBufferWriteXmlCHAR |
| 771 | #else |
| 772 | void xmlBufferWriteCHAR (xmlBufferPtr buf, |
| 773 | const xmlChar *string); |
| 774 | #endif |
| 775 | void xmlBufferWriteChar (xmlBufferPtr buf, |
| 776 | const char *string); |
| 777 | void xmlBufferWriteQuotedString(xmlBufferPtr buf, |
| 778 | const xmlChar *string); |
| 779 | |
| 780 | /* |
| 781 | * Namespace handling |
| 782 | */ |
| 783 | int xmlReconciliateNs (xmlDocPtr doc, |
| 784 | xmlNodePtr tree); |
| 785 | |
| 786 | /* |
| 787 | * Saving |
| 788 | */ |
| 789 | void xmlDocDumpFormatMemory (xmlDocPtr cur, |
| 790 | xmlChar**mem, |
| 791 | int *size, |
| 792 | int format); |
| 793 | void xmlDocDumpMemory (xmlDocPtr cur, |
| 794 | xmlChar**mem, |
| 795 | int *size); |
| 796 | void xmlDocDumpMemoryEnc (xmlDocPtr out_doc, |
| 797 | xmlChar **doc_txt_ptr, |
| 798 | int * doc_txt_len, |
| 799 | const char *txt_encoding); |
| 800 | void xmlDocDumpFormatMemoryEnc(xmlDocPtr out_doc, |
| 801 | xmlChar **doc_txt_ptr, |
| 802 | int * doc_txt_len, |
| 803 | const char *txt_encoding, |
| 804 | int format); |
| 805 | int xmlDocDump (FILE *f, |
| 806 | xmlDocPtr cur); |
| 807 | void xmlElemDump (FILE *f, |
| 808 | xmlDocPtr doc, |
| 809 | xmlNodePtr cur); |
| 810 | int xmlSaveFile (const char *filename, |
| 811 | xmlDocPtr cur); |
Daniel Veillard | 67fee94 | 2001-04-26 18:59:03 +0000 | [diff] [blame] | 812 | int xmlSaveFormatFile (const char *filename, |
| 813 | xmlDocPtr cur, |
| 814 | int format); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 815 | void xmlNodeDump (xmlBufferPtr buf, |
| 816 | xmlDocPtr doc, |
| 817 | xmlNodePtr cur, |
| 818 | int level, |
| 819 | int format); |
| 820 | |
CET 2001 Daniel Veillard | 5a37bde | 2001-11-01 14:31:22 +0000 | [diff] [blame] | 821 | int xmlSaveFileTo (xmlOutputBufferPtr buf, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 822 | xmlDocPtr cur, |
| 823 | const char *encoding); |
CET 2001 Daniel Veillard | 5a37bde | 2001-11-01 14:31:22 +0000 | [diff] [blame] | 824 | int xmlSaveFormatFileTo (xmlOutputBufferPtr buf, |
| 825 | xmlDocPtr cur, |
| 826 | const char *encoding, |
| 827 | int format); |
| 828 | void xmlNodeDumpOutput (xmlOutputBufferPtr buf, |
| 829 | xmlDocPtr doc, |
| 830 | xmlNodePtr cur, |
| 831 | int level, |
| 832 | int format, |
| 833 | const char *encoding); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 834 | |
Daniel Veillard | d164092 | 2001-12-17 15:30:10 +0000 | [diff] [blame^] | 835 | int xmlSaveFormatFileEnc (const char *filename, |
| 836 | xmlDocPtr cur, |
| 837 | const char *encoding, |
| 838 | int format); |
Daniel Veillard | f012a64 | 2001-07-23 19:10:52 +0000 | [diff] [blame] | 839 | |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 840 | int xmlSaveFileEnc (const char *filename, |
| 841 | xmlDocPtr cur, |
| 842 | const char *encoding); |
| 843 | |
| 844 | /* |
| 845 | * Compression |
| 846 | */ |
| 847 | int xmlGetDocCompressMode (xmlDocPtr doc); |
| 848 | void xmlSetDocCompressMode (xmlDocPtr doc, |
| 849 | int mode); |
| 850 | int xmlGetCompressMode (void); |
| 851 | void xmlSetCompressMode (int mode); |
| 852 | |
| 853 | #ifdef __cplusplus |
| 854 | } |
| 855 | #endif |
| 856 | |
| 857 | #endif /* __XML_TREE_H__ */ |
| 858 | |