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