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