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