codekingpro/portable-devtools
116k
1/*2 * Summary: interfaces for tree manipulation3 * Description: this module describes the structures found in an tree resulting4 * from an XML or HTML parsing, as well as the API provided for5 * various processing on that tree6 *7 * Copy: See Copyright for the status of this software.8 *9 * Author: Daniel Veillard10 */11 12#ifndef __XML_TREE_H__13#define __XML_TREE_H__14 15#include <stdio.h>16#include <limits.h>17#include <libxml/xmlversion.h>18#include <libxml/xmlstring.h>19 20#ifdef __cplusplus21extern "C" {22#endif23 24/*25 * Some of the basic types pointer to structures:26 */27/* xmlIO.h */28typedef struct _xmlParserInputBuffer xmlParserInputBuffer;29typedef xmlParserInputBuffer *xmlParserInputBufferPtr;30 31typedef struct _xmlOutputBuffer xmlOutputBuffer;32typedef xmlOutputBuffer *xmlOutputBufferPtr;33 34/* parser.h */35typedef struct _xmlParserInput xmlParserInput;36typedef xmlParserInput *xmlParserInputPtr;37 38typedef struct _xmlParserCtxt xmlParserCtxt;39typedef xmlParserCtxt *xmlParserCtxtPtr;40 41typedef struct _xmlSAXLocator xmlSAXLocator;42typedef xmlSAXLocator *xmlSAXLocatorPtr;43 44typedef struct _xmlSAXHandler xmlSAXHandler;45typedef xmlSAXHandler *xmlSAXHandlerPtr;46 47/* entities.h */48typedef struct _xmlEntity xmlEntity;49typedef xmlEntity *xmlEntityPtr;50 51/**52 * BASE_BUFFER_SIZE:53 *54 * default buffer size 4000.55 */56#define BASE_BUFFER_SIZE 409657 58/**59 * LIBXML_NAMESPACE_DICT:60 *61 * Defines experimental behaviour:62 * 1) xmlNs gets an additional field @context (a xmlDoc)63 * 2) when creating a tree, xmlNs->href is stored in the dict of xmlDoc.64 */65/* #define LIBXML_NAMESPACE_DICT */66 67/**68 * xmlBufferAllocationScheme:69 *70 * A buffer allocation scheme can be defined to either match exactly the71 * need or double it's allocated size each time it is found too small.72 */73 74typedef enum {75 XML_BUFFER_ALLOC_DOUBLEIT, /* double each time one need to grow */76 XML_BUFFER_ALLOC_EXACT, /* grow only to the minimal size */77 XML_BUFFER_ALLOC_IMMUTABLE, /* immutable buffer, deprecated */78 XML_BUFFER_ALLOC_IO, /* special allocation scheme used for I/O */79 XML_BUFFER_ALLOC_HYBRID, /* exact up to a threshold, and doubleit thereafter */80 XML_BUFFER_ALLOC_BOUNDED /* limit the upper size of the buffer */81} xmlBufferAllocationScheme;82 83/**84 * xmlBuffer:85 *86 * A buffer structure, this old construct is limited to 2GB and87 * is being deprecated, use API with xmlBuf instead88 */89typedef struct _xmlBuffer xmlBuffer;90typedef xmlBuffer *xmlBufferPtr;91struct _xmlBuffer {92 xmlChar *content; /* The buffer content UTF8 */93 unsigned int use; /* The buffer size used */94 unsigned int size; /* The buffer size */95 xmlBufferAllocationScheme alloc; /* The realloc method */96 xmlChar *contentIO; /* in IO mode we may have a different base */97};98 99/**100 * xmlBuf:101 *102 * A buffer structure, new one, the actual structure internals are not public103 */104 105typedef struct _xmlBuf xmlBuf;106 107/**108 * xmlBufPtr:109 *110 * A pointer to a buffer structure, the actual structure internals are not111 * public112 */113 114typedef xmlBuf *xmlBufPtr;115 116/*117 * A few public routines for xmlBuf. As those are expected to be used118 * mostly internally the bulk of the routines are internal in buf.h119 */120XMLPUBFUN xmlChar* xmlBufContent (const xmlBuf* buf);121XMLPUBFUN xmlChar* xmlBufEnd (xmlBufPtr buf);122XMLPUBFUN size_t xmlBufUse (const xmlBufPtr buf);123XMLPUBFUN size_t xmlBufShrink (xmlBufPtr buf, size_t len);124 125/*126 * LIBXML2_NEW_BUFFER:127 *128 * Macro used to express that the API use the new buffers for129 * xmlParserInputBuffer and xmlOutputBuffer. The change was130 * introduced in 2.9.0.131 */132#define LIBXML2_NEW_BUFFER133 134/**135 * XML_XML_NAMESPACE:136 *137 * This is the namespace for the special xml: prefix predefined in the138 * XML Namespace specification.139 */140#define XML_XML_NAMESPACE \141 (const xmlChar *) "http://www.w3.org/XML/1998/namespace"142 143/**144 * XML_XML_ID:145 *146 * This is the name for the special xml:id attribute147 */148#define XML_XML_ID (const xmlChar *) "xml:id"149 150/*151 * The different element types carried by an XML tree.152 *153 * NOTE: This is synchronized with DOM Level1 values154 * See http://www.w3.org/TR/REC-DOM-Level-1/155 *156 * Actually this had diverged a bit, and now XML_DOCUMENT_TYPE_NODE should157 * be deprecated to use an XML_DTD_NODE.158 */159typedef enum {160 XML_ELEMENT_NODE= 1,161 XML_ATTRIBUTE_NODE= 2,162 XML_TEXT_NODE= 3,163 XML_CDATA_SECTION_NODE= 4,164 XML_ENTITY_REF_NODE= 5,165 XML_ENTITY_NODE= 6,166 XML_PI_NODE= 7,167 XML_COMMENT_NODE= 8,168 XML_DOCUMENT_NODE= 9,169 XML_DOCUMENT_TYPE_NODE= 10,170 XML_DOCUMENT_FRAG_NODE= 11,171 XML_NOTATION_NODE= 12,172 XML_HTML_DOCUMENT_NODE= 13,173 XML_DTD_NODE= 14,174 XML_ELEMENT_DECL= 15,175 XML_ATTRIBUTE_DECL= 16,176 XML_ENTITY_DECL= 17,177 XML_NAMESPACE_DECL= 18,178 XML_XINCLUDE_START= 19,179 XML_XINCLUDE_END= 20180 /* XML_DOCB_DOCUMENT_NODE= 21 */ /* removed */181} xmlElementType;182 183/** DOC_DISABLE */184/* For backward compatibility */185#define XML_DOCB_DOCUMENT_NODE 21186/** DOC_ENABLE */187 188/**189 * xmlNotation:190 *191 * A DTD Notation definition.192 */193 194typedef struct _xmlNotation xmlNotation;195typedef xmlNotation *xmlNotationPtr;196struct _xmlNotation {197 const xmlChar *name; /* Notation name */198 const xmlChar *PublicID; /* Public identifier, if any */199 const xmlChar *SystemID; /* System identifier, if any */200};201 202/**203 * xmlAttributeType:204 *205 * A DTD Attribute type definition.206 */207 208typedef enum {209 XML_ATTRIBUTE_CDATA = 1,210 XML_ATTRIBUTE_ID,211 XML_ATTRIBUTE_IDREF ,212 XML_ATTRIBUTE_IDREFS,213 XML_ATTRIBUTE_ENTITY,214 XML_ATTRIBUTE_ENTITIES,215 XML_ATTRIBUTE_NMTOKEN,216 XML_ATTRIBUTE_NMTOKENS,217 XML_ATTRIBUTE_ENUMERATION,218 XML_ATTRIBUTE_NOTATION219} xmlAttributeType;220 221/**222 * xmlAttributeDefault:223 *224 * A DTD Attribute default definition.225 */226 227typedef enum {228 XML_ATTRIBUTE_NONE = 1,229 XML_ATTRIBUTE_REQUIRED,230 XML_ATTRIBUTE_IMPLIED,231 XML_ATTRIBUTE_FIXED232} xmlAttributeDefault;233 234/**235 * xmlEnumeration:236 *237 * List structure used when there is an enumeration in DTDs.238 */239 240typedef struct _xmlEnumeration xmlEnumeration;241typedef xmlEnumeration *xmlEnumerationPtr;242struct _xmlEnumeration {243 struct _xmlEnumeration *next; /* next one */244 const xmlChar *name; /* Enumeration name */245};246 247/**248 * xmlAttribute:249 *250 * An Attribute declaration in a DTD.251 */252 253typedef struct _xmlAttribute xmlAttribute;254typedef xmlAttribute *xmlAttributePtr;255struct _xmlAttribute {256 void *_private; /* application data */257 xmlElementType type; /* XML_ATTRIBUTE_DECL, must be second ! */258 const xmlChar *name; /* Attribute name */259 struct _xmlNode *children; /* NULL */260 struct _xmlNode *last; /* NULL */261 struct _xmlDtd *parent; /* -> DTD */262 struct _xmlNode *next; /* next sibling link */263 struct _xmlNode *prev; /* previous sibling link */264 struct _xmlDoc *doc; /* the containing document */265 266 struct _xmlAttribute *nexth; /* next in hash table */267 xmlAttributeType atype; /* The attribute type */268 xmlAttributeDefault def; /* the default */269 const xmlChar *defaultValue; /* or the default value */270 xmlEnumerationPtr tree; /* or the enumeration tree if any */271 const xmlChar *prefix; /* the namespace prefix if any */272 const xmlChar *elem; /* Element holding the attribute */273};274 275/**276 * xmlElementContentType:277 *278 * Possible definitions of element content types.279 */280typedef enum {281 XML_ELEMENT_CONTENT_PCDATA = 1,282 XML_ELEMENT_CONTENT_ELEMENT,283 XML_ELEMENT_CONTENT_SEQ,284 XML_ELEMENT_CONTENT_OR285} xmlElementContentType;286 287/**288 * xmlElementContentOccur:289 *290 * Possible definitions of element content occurrences.291 */292typedef enum {293 XML_ELEMENT_CONTENT_ONCE = 1,294 XML_ELEMENT_CONTENT_OPT,295 XML_ELEMENT_CONTENT_MULT,296 XML_ELEMENT_CONTENT_PLUS297} xmlElementContentOccur;298 299/**300 * xmlElementContent:301 *302 * An XML Element content as stored after parsing an element definition303 * in a DTD.304 */305 306typedef struct _xmlElementContent xmlElementContent;307typedef xmlElementContent *xmlElementContentPtr;308struct _xmlElementContent {309 xmlElementContentType type; /* PCDATA, ELEMENT, SEQ or OR */310 xmlElementContentOccur ocur; /* ONCE, OPT, MULT or PLUS */311 const xmlChar *name; /* Element name */312 struct _xmlElementContent *c1; /* first child */313 struct _xmlElementContent *c2; /* second child */314 struct _xmlElementContent *parent; /* parent */315 const xmlChar *prefix; /* Namespace prefix */316};317 318/**319 * xmlElementTypeVal:320 *321 * The different possibilities for an element content type.322 */323 324typedef enum {325 XML_ELEMENT_TYPE_UNDEFINED = 0,326 XML_ELEMENT_TYPE_EMPTY = 1,327 XML_ELEMENT_TYPE_ANY,328 XML_ELEMENT_TYPE_MIXED,329 XML_ELEMENT_TYPE_ELEMENT330} xmlElementTypeVal;331 332#ifdef __cplusplus333}334#endif335#include <libxml/xmlregexp.h>336#ifdef __cplusplus337extern "C" {338#endif339 340/**341 * xmlElement:342 *343 * An XML Element declaration from a DTD.344 */345 346typedef struct _xmlElement xmlElement;347typedef xmlElement *xmlElementPtr;348struct _xmlElement {349 void *_private; /* application data */350 xmlElementType type; /* XML_ELEMENT_DECL, must be second ! */351 const xmlChar *name; /* Element name */352 struct _xmlNode *children; /* NULL */353 struct _xmlNode *last; /* NULL */354 struct _xmlDtd *parent; /* -> DTD */355 struct _xmlNode *next; /* next sibling link */356 struct _xmlNode *prev; /* previous sibling link */357 struct _xmlDoc *doc; /* the containing document */358 359 xmlElementTypeVal etype; /* The type */360 xmlElementContentPtr content; /* the allowed element content */361 xmlAttributePtr attributes; /* List of the declared attributes */362 const xmlChar *prefix; /* the namespace prefix if any */363#ifdef LIBXML_REGEXP_ENABLED364 xmlRegexpPtr contModel; /* the validating regexp */365#else366 void *contModel;367#endif368};369 370 371/**372 * XML_LOCAL_NAMESPACE:373 *374 * A namespace declaration node.375 */376#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL377typedef xmlElementType xmlNsType;378 379/**380 * xmlNs:381 *382 * An XML namespace.383 * Note that prefix == NULL is valid, it defines the default namespace384 * within the subtree (until overridden).385 *386 * xmlNsType is unified with xmlElementType.387 */388 389typedef struct _xmlNs xmlNs;390typedef xmlNs *xmlNsPtr;391struct _xmlNs {392 struct _xmlNs *next; /* next Ns link for this node */393 xmlNsType type; /* global or local */394 const xmlChar *href; /* URL for the namespace */395 const xmlChar *prefix; /* prefix for the namespace */396 void *_private; /* application data */397 struct _xmlDoc *context; /* normally an xmlDoc */398};399 400/**401 * xmlDtd:402 *403 * An XML DTD, as defined by <!DOCTYPE ... There is actually one for404 * the internal subset and for the external subset.405 */406typedef struct _xmlDtd xmlDtd;407typedef xmlDtd *xmlDtdPtr;408struct _xmlDtd {409 void *_private; /* application data */410 xmlElementType type; /* XML_DTD_NODE, must be second ! */411 const xmlChar *name; /* Name of the DTD */412 struct _xmlNode *children; /* the value of the property link */413 struct _xmlNode *last; /* last child link */414 struct _xmlDoc *parent; /* child->parent link */415 struct _xmlNode *next; /* next sibling link */416 struct _xmlNode *prev; /* previous sibling link */417 struct _xmlDoc *doc; /* the containing document */418 419 /* End of common part */420 void *notations; /* Hash table for notations if any */421 void *elements; /* Hash table for elements if any */422 void *attributes; /* Hash table for attributes if any */423 void *entities; /* Hash table for entities if any */424 const xmlChar *ExternalID; /* External identifier for PUBLIC DTD */425 const xmlChar *SystemID; /* URI for a SYSTEM or PUBLIC DTD */426 void *pentities; /* Hash table for param entities if any */427};428 429/**430 * xmlAttr:431 *432 * An attribute on an XML node.433 */434typedef struct _xmlAttr xmlAttr;435typedef xmlAttr *xmlAttrPtr;436struct _xmlAttr {437 void *_private; /* application data */438 xmlElementType type; /* XML_ATTRIBUTE_NODE, must be second ! */439 const xmlChar *name; /* the name of the property */440 struct _xmlNode *children; /* the value of the property */441 struct _xmlNode *last; /* NULL */442 struct _xmlNode *parent; /* child->parent link */443 struct _xmlAttr *next; /* next sibling link */444 struct _xmlAttr *prev; /* previous sibling link */445 struct _xmlDoc *doc; /* the containing document */446 xmlNs *ns; /* pointer to the associated namespace */447 xmlAttributeType atype; /* the attribute type if validating */448 void *psvi; /* for type/PSVI information */449};450 451/**452 * xmlID:453 *454 * An XML ID instance.455 */456 457typedef struct _xmlID xmlID;458typedef xmlID *xmlIDPtr;459struct _xmlID {460 struct _xmlID *next; /* next ID */461 const xmlChar *value; /* The ID name */462 xmlAttrPtr attr; /* The attribute holding it */463 const xmlChar *name; /* The attribute if attr is not available */464 int lineno; /* The line number if attr is not available */465 struct _xmlDoc *doc; /* The document holding the ID */466};467 468/**469 * xmlRef:470 *471 * An XML IDREF instance.472 */473 474typedef struct _xmlRef xmlRef;475typedef xmlRef *xmlRefPtr;476struct _xmlRef {477 struct _xmlRef *next; /* next Ref */478 const xmlChar *value; /* The Ref name */479 xmlAttrPtr attr; /* The attribute holding it */480 const xmlChar *name; /* The attribute if attr is not available */481 int lineno; /* The line number if attr is not available */482};483 484/**485 * xmlNode:486 *487 * A node in an XML tree.488 */489typedef struct _xmlNode xmlNode;490typedef xmlNode *xmlNodePtr;491struct _xmlNode {492 void *_private; /* application data */493 xmlElementType type; /* type number, must be second ! */494 const xmlChar *name; /* the name of the node, or the entity */495 struct _xmlNode *children; /* parent->childs link */496 struct _xmlNode *last; /* last child link */497 struct _xmlNode *parent; /* child->parent link */498 struct _xmlNode *next; /* next sibling link */499 struct _xmlNode *prev; /* previous sibling link */500 struct _xmlDoc *doc; /* the containing document */501 502 /* End of common part */503 xmlNs *ns; /* pointer to the associated namespace */504 xmlChar *content; /* the content */505 struct _xmlAttr *properties;/* properties list */506 xmlNs *nsDef; /* namespace definitions on this node */507 void *psvi; /* for type/PSVI information */508 unsigned short line; /* line number */509 unsigned short extra; /* extra data for XPath/XSLT */510};511 512/**513 * XML_GET_CONTENT:514 *515 * Macro to extract the content pointer of a node.516 */517#define XML_GET_CONTENT(n) \518 ((n)->type == XML_ELEMENT_NODE ? NULL : (n)->content)519 520/**521 * XML_GET_LINE:522 *523 * Macro to extract the line number of an element node.524 */525#define XML_GET_LINE(n) \526 (xmlGetLineNo(n))527 528/**529 * xmlDocProperty530 *531 * Set of properties of the document as found by the parser532 * Some of them are linked to similarly named xmlParserOption533 */534typedef enum {535 XML_DOC_WELLFORMED = 1<<0, /* document is XML well formed */536 XML_DOC_NSVALID = 1<<1, /* document is Namespace valid */537 XML_DOC_OLD10 = 1<<2, /* parsed with old XML-1.0 parser */538 XML_DOC_DTDVALID = 1<<3, /* DTD validation was successful */539 XML_DOC_XINCLUDE = 1<<4, /* XInclude substitution was done */540 XML_DOC_USERBUILT = 1<<5, /* Document was built using the API541 and not by parsing an instance */542 XML_DOC_INTERNAL = 1<<6, /* built for internal processing */543 XML_DOC_HTML = 1<<7 /* parsed or built HTML document */544} xmlDocProperties;545 546/**547 * xmlDoc:548 *549 * An XML document.550 */551typedef struct _xmlDoc xmlDoc;552typedef xmlDoc *xmlDocPtr;553struct _xmlDoc {554 void *_private; /* application data */555 xmlElementType type; /* XML_DOCUMENT_NODE, must be second ! */556 char *name; /* name/filename/URI of the document */557 struct _xmlNode *children; /* the document tree */558 struct _xmlNode *last; /* last child link */559 struct _xmlNode *parent; /* child->parent link */560 struct _xmlNode *next; /* next sibling link */561 struct _xmlNode *prev; /* previous sibling link */562 struct _xmlDoc *doc; /* autoreference to itself */563 564 /* End of common part */565 int compression;/* level of zlib compression */566 int standalone; /* standalone document (no external refs)567 1 if standalone="yes"568 0 if standalone="no"569 -1 if there is no XML declaration570 -2 if there is an XML declaration, but no571 standalone attribute was specified */572 struct _xmlDtd *intSubset; /* the document internal subset */573 struct _xmlDtd *extSubset; /* the document external subset */574 struct _xmlNs *oldNs; /* Global namespace, the old way */575 const xmlChar *version; /* the XML version string */576 const xmlChar *encoding; /* external initial encoding, if any */577 void *ids; /* Hash table for ID attributes if any */578 void *refs; /* Hash table for IDREFs attributes if any */579 const xmlChar *URL; /* The URI for that document */580 int charset; /* Internal flag for charset handling,581 actually an xmlCharEncoding */582 struct _xmlDict *dict; /* dict used to allocate names or NULL */583 void *psvi; /* for type/PSVI information */584 int parseFlags; /* set of xmlParserOption used to parse the585 document */586 int properties; /* set of xmlDocProperties for this document587 set at the end of parsing */588};589 590 591typedef struct _xmlDOMWrapCtxt xmlDOMWrapCtxt;592typedef xmlDOMWrapCtxt *xmlDOMWrapCtxtPtr;593 594/**595 * xmlDOMWrapAcquireNsFunction:596 * @ctxt: a DOM wrapper context597 * @node: the context node (element or attribute)598 * @nsName: the requested namespace name599 * @nsPrefix: the requested namespace prefix600 *601 * A function called to acquire namespaces (xmlNs) from the wrapper.602 *603 * Returns an xmlNsPtr or NULL in case of an error.604 */605typedef xmlNsPtr (*xmlDOMWrapAcquireNsFunction) (xmlDOMWrapCtxtPtr ctxt,606 xmlNodePtr node,607 const xmlChar *nsName,608 const xmlChar *nsPrefix);609 610/**611 * xmlDOMWrapCtxt:612 *613 * Context for DOM wrapper-operations.614 */615struct _xmlDOMWrapCtxt {616 void * _private;617 /*618 * The type of this context, just in case we need specialized619 * contexts in the future.620 */621 int type;622 /*623 * Internal namespace map used for various operations.624 */625 void * namespaceMap;626 /*627 * Use this one to acquire an xmlNsPtr intended for node->ns.628 * (Note that this is not intended for elem->nsDef).629 */630 xmlDOMWrapAcquireNsFunction getNsForNodeFunc;631};632 633/**634 * xmlChildrenNode:635 *636 * Macro for compatibility naming layer with libxml1. Maps637 * to "children."638 */639#ifndef xmlChildrenNode640#define xmlChildrenNode children641#endif642 643/**644 * xmlRootNode:645 *646 * Macro for compatibility naming layer with libxml1. Maps647 * to "children".648 */649#ifndef xmlRootNode650#define xmlRootNode children651#endif652 653/*654 * Variables.655 */656 657/*658 * Some helper functions659 */660#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || \661 defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || \662 defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || \663 defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || \664 defined(LIBXML_LEGACY_ENABLED)665XMLPUBFUN int666 xmlValidateNCName (const xmlChar *value,667 int space);668#endif669 670#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)671XMLPUBFUN int672 xmlValidateQName (const xmlChar *value,673 int space);674XMLPUBFUN int675 xmlValidateName (const xmlChar *value,676 int space);677XMLPUBFUN int678 xmlValidateNMToken (const xmlChar *value,679 int space);680#endif681 682XMLPUBFUN xmlChar *683 xmlBuildQName (const xmlChar *ncname,684 const xmlChar *prefix,685 xmlChar *memory,686 int len);687XMLPUBFUN xmlChar *688 xmlSplitQName2 (const xmlChar *name,689 xmlChar **prefix);690XMLPUBFUN const xmlChar *691 xmlSplitQName3 (const xmlChar *name,692 int *len);693 694/*695 * Handling Buffers, the old ones see @xmlBuf for the new ones.696 */697 698XMLPUBFUN void699 xmlSetBufferAllocationScheme(xmlBufferAllocationScheme scheme);700XMLPUBFUN xmlBufferAllocationScheme701 xmlGetBufferAllocationScheme(void);702 703XMLPUBFUN xmlBufferPtr704 xmlBufferCreate (void);705XMLPUBFUN xmlBufferPtr706 xmlBufferCreateSize (size_t size);707XMLPUBFUN xmlBufferPtr708 xmlBufferCreateStatic (void *mem,709 size_t size);710XMLPUBFUN int711 xmlBufferResize (xmlBufferPtr buf,712 unsigned int size);713XMLPUBFUN void714 xmlBufferFree (xmlBufferPtr buf);715XMLPUBFUN int716 xmlBufferDump (FILE *file,717 xmlBufferPtr buf);718XMLPUBFUN int719 xmlBufferAdd (xmlBufferPtr buf,720 const xmlChar *str,721 int len);722XMLPUBFUN int723 xmlBufferAddHead (xmlBufferPtr buf,724 const xmlChar *str,725 int len);726XMLPUBFUN int727 xmlBufferCat (xmlBufferPtr buf,728 const xmlChar *str);729XMLPUBFUN int730 xmlBufferCCat (xmlBufferPtr buf,731 const char *str);732XMLPUBFUN int733 xmlBufferShrink (xmlBufferPtr buf,734 unsigned int len);735XMLPUBFUN int736 xmlBufferGrow (xmlBufferPtr buf,737 unsigned int len);738XMLPUBFUN void739 xmlBufferEmpty (xmlBufferPtr buf);740XMLPUBFUN const xmlChar*741 xmlBufferContent (const xmlBuffer *buf);742XMLPUBFUN xmlChar*743 xmlBufferDetach (xmlBufferPtr buf);744XMLPUBFUN void745 xmlBufferSetAllocationScheme(xmlBufferPtr buf,746 xmlBufferAllocationScheme scheme);747XMLPUBFUN int748 xmlBufferLength (const xmlBuffer *buf);749 750/*751 * Creating/freeing new structures.752 */753XMLPUBFUN xmlDtdPtr754 xmlCreateIntSubset (xmlDocPtr doc,755 const xmlChar *name,756 const xmlChar *ExternalID,757 const xmlChar *SystemID);758XMLPUBFUN xmlDtdPtr759 xmlNewDtd (xmlDocPtr doc,760 const xmlChar *name,761 const xmlChar *ExternalID,762 const xmlChar *SystemID);763XMLPUBFUN xmlDtdPtr764 xmlGetIntSubset (const xmlDoc *doc);765XMLPUBFUN void766 xmlFreeDtd (xmlDtdPtr cur);767#ifdef LIBXML_LEGACY_ENABLED768XML_DEPRECATED769XMLPUBFUN xmlNsPtr770 xmlNewGlobalNs (xmlDocPtr doc,771 const xmlChar *href,772 const xmlChar *prefix);773#endif /* LIBXML_LEGACY_ENABLED */774XMLPUBFUN xmlNsPtr775 xmlNewNs (xmlNodePtr node,776 const xmlChar *href,777 const xmlChar *prefix);778XMLPUBFUN void779 xmlFreeNs (xmlNsPtr cur);780XMLPUBFUN void781 xmlFreeNsList (xmlNsPtr cur);782XMLPUBFUN xmlDocPtr783 xmlNewDoc (const xmlChar *version);784XMLPUBFUN void785 xmlFreeDoc (xmlDocPtr cur);786XMLPUBFUN xmlAttrPtr787 xmlNewDocProp (xmlDocPtr doc,788 const xmlChar *name,789 const xmlChar *value);790#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || \791 defined(LIBXML_SCHEMAS_ENABLED)792XMLPUBFUN xmlAttrPtr793 xmlNewProp (xmlNodePtr node,794 const xmlChar *name,795 const xmlChar *value);796#endif797XMLPUBFUN xmlAttrPtr798 xmlNewNsProp (xmlNodePtr node,799 xmlNsPtr ns,800 const xmlChar *name,801 const xmlChar *value);802XMLPUBFUN xmlAttrPtr803 xmlNewNsPropEatName (xmlNodePtr node,804 xmlNsPtr ns,805 xmlChar *name,806 const xmlChar *value);807XMLPUBFUN void808 xmlFreePropList (xmlAttrPtr cur);809XMLPUBFUN void810 xmlFreeProp (xmlAttrPtr cur);811XMLPUBFUN xmlAttrPtr812 xmlCopyProp (xmlNodePtr target,813 xmlAttrPtr cur);814XMLPUBFUN xmlAttrPtr815 xmlCopyPropList (xmlNodePtr target,816 xmlAttrPtr cur);817#ifdef LIBXML_TREE_ENABLED818XMLPUBFUN xmlDtdPtr819 xmlCopyDtd (xmlDtdPtr dtd);820#endif /* LIBXML_TREE_ENABLED */821#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)822XMLPUBFUN xmlDocPtr823 xmlCopyDoc (xmlDocPtr doc,824 int recursive);825#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) */826/*827 * Creating new nodes.828 */829XMLPUBFUN xmlNodePtr830 xmlNewDocNode (xmlDocPtr doc,831 xmlNsPtr ns,832 const xmlChar *name,833 const xmlChar *content);834XMLPUBFUN xmlNodePtr835 xmlNewDocNodeEatName (xmlDocPtr doc,836 xmlNsPtr ns,837 xmlChar *name,838 const xmlChar *content);839XMLPUBFUN xmlNodePtr840 xmlNewNode (xmlNsPtr ns,841 const xmlChar *name);842XMLPUBFUN xmlNodePtr843 xmlNewNodeEatName (xmlNsPtr ns,844 xmlChar *name);845#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)846XMLPUBFUN xmlNodePtr847 xmlNewChild (xmlNodePtr parent,848 xmlNsPtr ns,849 const xmlChar *name,850 const xmlChar *content);851#endif852XMLPUBFUN xmlNodePtr853 xmlNewDocText (const xmlDoc *doc,854 const xmlChar *content);855XMLPUBFUN xmlNodePtr856 xmlNewText (const xmlChar *content);857XMLPUBFUN xmlNodePtr858 xmlNewDocPI (xmlDocPtr doc,859 const xmlChar *name,860 const xmlChar *content);861XMLPUBFUN xmlNodePtr862 xmlNewPI (const xmlChar *name,863 const xmlChar *content);864XMLPUBFUN xmlNodePtr865 xmlNewDocTextLen (xmlDocPtr doc,866 const xmlChar *content,867 int len);868XMLPUBFUN xmlNodePtr869 xmlNewTextLen (const xmlChar *content,870 int len);871XMLPUBFUN xmlNodePtr872 xmlNewDocComment (xmlDocPtr doc,873 const xmlChar *content);874XMLPUBFUN xmlNodePtr875 xmlNewComment (const xmlChar *content);876XMLPUBFUN xmlNodePtr877 xmlNewCDataBlock (xmlDocPtr doc,878 const xmlChar *content,879 int len);880XMLPUBFUN xmlNodePtr881 xmlNewCharRef (xmlDocPtr doc,882 const xmlChar *name);883XMLPUBFUN xmlNodePtr884 xmlNewReference (const xmlDoc *doc,885 const xmlChar *name);886XMLPUBFUN xmlNodePtr887 xmlCopyNode (xmlNodePtr node,888 int recursive);889XMLPUBFUN xmlNodePtr890 xmlDocCopyNode (xmlNodePtr node,891 xmlDocPtr doc,892 int recursive);893XMLPUBFUN xmlNodePtr894 xmlDocCopyNodeList (xmlDocPtr doc,895 xmlNodePtr node);896XMLPUBFUN xmlNodePtr897 xmlCopyNodeList (xmlNodePtr node);898#ifdef LIBXML_TREE_ENABLED899XMLPUBFUN xmlNodePtr900 xmlNewTextChild (xmlNodePtr parent,901 xmlNsPtr ns,902 const xmlChar *name,903 const xmlChar *content);904XMLPUBFUN xmlNodePtr905 xmlNewDocRawNode (xmlDocPtr doc,906 xmlNsPtr ns,907 const xmlChar *name,908 const xmlChar *content);909XMLPUBFUN xmlNodePtr910 xmlNewDocFragment (xmlDocPtr doc);911#endif /* LIBXML_TREE_ENABLED */912 913/*914 * Navigating.915 */916XMLPUBFUN long917 xmlGetLineNo (const xmlNode *node);918#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)919XMLPUBFUN xmlChar *920 xmlGetNodePath (const xmlNode *node);921#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED) */922XMLPUBFUN xmlNodePtr923 xmlDocGetRootElement (const xmlDoc *doc);924XMLPUBFUN xmlNodePtr925 xmlGetLastChild (const xmlNode *parent);926XMLPUBFUN int927 xmlNodeIsText (const xmlNode *node);928XMLPUBFUN int929 xmlIsBlankNode (const xmlNode *node);930 931/*932 * Changing the structure.933 */934#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)935XMLPUBFUN xmlNodePtr936 xmlDocSetRootElement (xmlDocPtr doc,937 xmlNodePtr root);938#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) */939#ifdef LIBXML_TREE_ENABLED940XMLPUBFUN void941 xmlNodeSetName (xmlNodePtr cur,942 const xmlChar *name);943#endif /* LIBXML_TREE_ENABLED */944XMLPUBFUN xmlNodePtr945 xmlAddChild (xmlNodePtr parent,946 xmlNodePtr cur);947XMLPUBFUN xmlNodePtr948 xmlAddChildList (xmlNodePtr parent,949 xmlNodePtr cur);950#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)951XMLPUBFUN xmlNodePtr952 xmlReplaceNode (xmlNodePtr old,953 xmlNodePtr cur);954#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) */955#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || \956 defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)957XMLPUBFUN xmlNodePtr958 xmlAddPrevSibling (xmlNodePtr cur,959 xmlNodePtr elem);960#endif /* LIBXML_TREE_ENABLED || LIBXML_HTML_ENABLED || LIBXML_SCHEMAS_ENABLED */961XMLPUBFUN xmlNodePtr962 xmlAddSibling (xmlNodePtr cur,963 xmlNodePtr elem);964XMLPUBFUN xmlNodePtr965 xmlAddNextSibling (xmlNodePtr cur,966 xmlNodePtr elem);967XMLPUBFUN void968 xmlUnlinkNode (xmlNodePtr cur);969XMLPUBFUN xmlNodePtr970 xmlTextMerge (xmlNodePtr first,971 xmlNodePtr second);972XMLPUBFUN int973 xmlTextConcat (xmlNodePtr node,974 const xmlChar *content,975 int len);976XMLPUBFUN void977 xmlFreeNodeList (xmlNodePtr cur);978XMLPUBFUN void979 xmlFreeNode (xmlNodePtr cur);980XMLPUBFUN void981 xmlSetTreeDoc (xmlNodePtr tree,982 xmlDocPtr doc);983XMLPUBFUN void984 xmlSetListDoc (xmlNodePtr list,985 xmlDocPtr doc);986/*987 * Namespaces.988 */989XMLPUBFUN xmlNsPtr990 xmlSearchNs (xmlDocPtr doc,991 xmlNodePtr node,992 const xmlChar *nameSpace);993XMLPUBFUN xmlNsPtr994 xmlSearchNsByHref (xmlDocPtr doc,995 xmlNodePtr node,996 const xmlChar *href);997#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || \998 defined(LIBXML_SCHEMAS_ENABLED)999XMLPUBFUN xmlNsPtr *1000 xmlGetNsList (const xmlDoc *doc,1001 const xmlNode *node);1002#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) */1003 1004XMLPUBFUN void1005 xmlSetNs (xmlNodePtr node,1006 xmlNsPtr ns);1007XMLPUBFUN xmlNsPtr1008 xmlCopyNamespace (xmlNsPtr cur);1009XMLPUBFUN xmlNsPtr1010 xmlCopyNamespaceList (xmlNsPtr cur);1011 1012/*1013 * Changing the content.1014 */1015#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || \1016 defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)1017XMLPUBFUN xmlAttrPtr1018 xmlSetProp (xmlNodePtr node,1019 const xmlChar *name,1020 const xmlChar *value);1021XMLPUBFUN xmlAttrPtr1022 xmlSetNsProp (xmlNodePtr node,1023 xmlNsPtr ns,1024 const xmlChar *name,1025 const xmlChar *value);1026#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || \1027 defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) */1028XMLPUBFUN xmlChar *1029 xmlGetNoNsProp (const xmlNode *node,1030 const xmlChar *name);1031XMLPUBFUN xmlChar *1032 xmlGetProp (const xmlNode *node,1033 const xmlChar *name);1034XMLPUBFUN xmlAttrPtr1035 xmlHasProp (const xmlNode *node,1036 const xmlChar *name);1037XMLPUBFUN xmlAttrPtr1038 xmlHasNsProp (const xmlNode *node,1039 const xmlChar *name,1040 const xmlChar *nameSpace);1041XMLPUBFUN xmlChar *1042 xmlGetNsProp (const xmlNode *node,1043 const xmlChar *name,1044 const xmlChar *nameSpace);1045XMLPUBFUN xmlNodePtr1046 xmlStringGetNodeList (const xmlDoc *doc,1047 const xmlChar *value);1048XMLPUBFUN xmlNodePtr1049 xmlStringLenGetNodeList (const xmlDoc *doc,1050 const xmlChar *value,1051 int len);1052XMLPUBFUN xmlChar *1053 xmlNodeListGetString (xmlDocPtr doc,1054 const xmlNode *list,1055 int inLine);1056#ifdef LIBXML_TREE_ENABLED1057XMLPUBFUN xmlChar *1058 xmlNodeListGetRawString (const xmlDoc *doc,1059 const xmlNode *list,1060 int inLine);1061#endif /* LIBXML_TREE_ENABLED */1062XMLPUBFUN void1063 xmlNodeSetContent (xmlNodePtr cur,1064 const xmlChar *content);1065#ifdef LIBXML_TREE_ENABLED1066XMLPUBFUN void1067 xmlNodeSetContentLen (xmlNodePtr cur,1068 const xmlChar *content,1069 int len);1070#endif /* LIBXML_TREE_ENABLED */1071XMLPUBFUN void1072 xmlNodeAddContent (xmlNodePtr cur,1073 const xmlChar *content);1074XMLPUBFUN void1075 xmlNodeAddContentLen (xmlNodePtr cur,1076 const xmlChar *content,1077 int len);1078XMLPUBFUN xmlChar *1079 xmlNodeGetContent (const xmlNode *cur);1080 1081XMLPUBFUN int1082 xmlNodeBufGetContent (xmlBufferPtr buffer,1083 const xmlNode *cur);1084XMLPUBFUN int1085 xmlBufGetNodeContent (xmlBufPtr buf,1086 const xmlNode *cur);1087 1088XMLPUBFUN xmlChar *1089 xmlNodeGetLang (const xmlNode *cur);1090XMLPUBFUN int1091 xmlNodeGetSpacePreserve (const xmlNode *cur);1092#ifdef LIBXML_TREE_ENABLED1093XMLPUBFUN void1094 xmlNodeSetLang (xmlNodePtr cur,1095 const xmlChar *lang);1096XMLPUBFUN void1097 xmlNodeSetSpacePreserve (xmlNodePtr cur,1098 int val);1099#endif /* LIBXML_TREE_ENABLED */1100XMLPUBFUN xmlChar *1101 xmlNodeGetBase (const xmlDoc *doc,1102 const xmlNode *cur);1103#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)1104XMLPUBFUN void1105 xmlNodeSetBase (xmlNodePtr cur,1106 const xmlChar *uri);1107#endif1108 1109/*1110 * Removing content.1111 */1112XMLPUBFUN int1113 xmlRemoveProp (xmlAttrPtr cur);1114#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)1115XMLPUBFUN int1116 xmlUnsetNsProp (xmlNodePtr node,1117 xmlNsPtr ns,1118 const xmlChar *name);1119XMLPUBFUN int1120 xmlUnsetProp (xmlNodePtr node,1121 const xmlChar *name);1122#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) */1123 1124/*1125 * Internal, don't use.1126 */1127XMLPUBFUN void1128 xmlBufferWriteCHAR (xmlBufferPtr buf,1129 const xmlChar *string);1130XMLPUBFUN void1131 xmlBufferWriteChar (xmlBufferPtr buf,1132 const char *string);1133XMLPUBFUN void1134 xmlBufferWriteQuotedString(xmlBufferPtr buf,1135 const xmlChar *string);1136 1137#ifdef LIBXML_OUTPUT_ENABLED1138XMLPUBFUN void xmlAttrSerializeTxtContent(xmlBufferPtr buf,1139 xmlDocPtr doc,1140 xmlAttrPtr attr,1141 const xmlChar *string);1142#endif /* LIBXML_OUTPUT_ENABLED */1143 1144#ifdef LIBXML_TREE_ENABLED1145/*1146 * Namespace handling.1147 */1148XMLPUBFUN int1149 xmlReconciliateNs (xmlDocPtr doc,1150 xmlNodePtr tree);1151#endif1152 1153#ifdef LIBXML_OUTPUT_ENABLED1154/*1155 * Saving.1156 */1157XMLPUBFUN void1158 xmlDocDumpFormatMemory (xmlDocPtr cur,1159 xmlChar **mem,1160 int *size,1161 int format);1162XMLPUBFUN void1163 xmlDocDumpMemory (xmlDocPtr cur,1164 xmlChar **mem,1165 int *size);1166XMLPUBFUN void1167 xmlDocDumpMemoryEnc (xmlDocPtr out_doc,1168 xmlChar **doc_txt_ptr,1169 int * doc_txt_len,1170 const char *txt_encoding);1171XMLPUBFUN void1172 xmlDocDumpFormatMemoryEnc(xmlDocPtr out_doc,1173 xmlChar **doc_txt_ptr,1174 int * doc_txt_len,1175 const char *txt_encoding,1176 int format);1177XMLPUBFUN int1178 xmlDocFormatDump (FILE *f,1179 xmlDocPtr cur,1180 int format);1181XMLPUBFUN int1182 xmlDocDump (FILE *f,1183 xmlDocPtr cur);1184XMLPUBFUN void1185 xmlElemDump (FILE *f,1186 xmlDocPtr doc,1187 xmlNodePtr cur);1188XMLPUBFUN int1189 xmlSaveFile (const char *filename,1190 xmlDocPtr cur);1191XMLPUBFUN int1192 xmlSaveFormatFile (const char *filename,1193 xmlDocPtr cur,1194 int format);1195XMLPUBFUN size_t1196 xmlBufNodeDump (xmlBufPtr buf,1197 xmlDocPtr doc,1198 xmlNodePtr cur,1199 int level,1200 int format);