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