blob: cd24ed109cb0f09f1ac494c1424559e25368af5a [file] [log] [blame]
Owen Taylor3473f882001-02-23 17:55:21 +00001/*
2 * tree.h : describes the structures found in an tree resulting
3 * from an XML parsing.
4 *
5 * See Copyright for the status of this software.
6 *
7 * Daniel.Veillard@w3.org
8 *
9 * 14 Nov 2000 ht - added redefinition of xmlBufferWriteChar for VMS
10 *
11 */
12
13#ifndef __XML_TREE_H__
14#define __XML_TREE_H__
15
16#include <stdio.h>
17#include <libxml/xmlversion.h>
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23#define XML_XML_NAMESPACE \
24 (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
25
26/*
27 * The different element types carried by an XML tree
28 *
29 * NOTE: This is synchronized with DOM Level1 values
30 * See http://www.w3.org/TR/REC-DOM-Level-1/
31 *
32 * Actually this had diverged a bit, and now XML_DOCUMENT_TYPE_NODE should
33 * be deprecated to use an XML_DTD_NODE.
34 */
35typedef enum {
36 XML_ELEMENT_NODE= 1,
37 XML_ATTRIBUTE_NODE= 2,
38 XML_TEXT_NODE= 3,
39 XML_CDATA_SECTION_NODE= 4,
40 XML_ENTITY_REF_NODE= 5,
41 XML_ENTITY_NODE= 6,
42 XML_PI_NODE= 7,
43 XML_COMMENT_NODE= 8,
44 XML_DOCUMENT_NODE= 9,
45 XML_DOCUMENT_TYPE_NODE= 10,
46 XML_DOCUMENT_FRAG_NODE= 11,
47 XML_NOTATION_NODE= 12,
48 XML_HTML_DOCUMENT_NODE= 13,
49 XML_DTD_NODE= 14,
50 XML_ELEMENT_DECL= 15,
51 XML_ATTRIBUTE_DECL= 16,
52 XML_ENTITY_DECL= 17,
53 XML_NAMESPACE_DECL= 18,
54 XML_XINCLUDE_START= 19,
55 XML_XINCLUDE_END= 20
56#ifdef LIBXML_SGML_ENABLED
57 ,XML_SGML_DOCUMENT_NODE= 21
58#endif
59} xmlElementType;
60
61/*
62 * Size of an internal character representation.
63 *
64 * We use 8bit chars internal representation for memory efficiency,
65 * Note that with 8 bits wide xmlChars one can still use UTF-8 to handle
66 * correctly non ISO-Latin input.
67 */
68
69typedef unsigned char xmlChar;
70
71#ifndef WIN32
72#ifndef CHAR
73#define CHAR xmlChar
74#endif
75#endif
76
77#define BAD_CAST (xmlChar *)
78
79/*
80 * a DTD Notation definition
81 */
82
83typedef struct _xmlNotation xmlNotation;
84typedef xmlNotation *xmlNotationPtr;
85struct _xmlNotation {
Daniel Veillard9e7160d2001-03-18 23:17:47 +000086 const xmlChar *name; /* Notation name */
Owen Taylor3473f882001-02-23 17:55:21 +000087 const xmlChar *PublicID; /* Public identifier, if any */
88 const xmlChar *SystemID; /* System identifier, if any */
89};
90
91/*
92 * a DTD Attribute definition
93 */
94
95typedef enum {
96 XML_ATTRIBUTE_CDATA = 1,
97 XML_ATTRIBUTE_ID,
98 XML_ATTRIBUTE_IDREF ,
99 XML_ATTRIBUTE_IDREFS,
100 XML_ATTRIBUTE_ENTITY,
101 XML_ATTRIBUTE_ENTITIES,
102 XML_ATTRIBUTE_NMTOKEN,
103 XML_ATTRIBUTE_NMTOKENS,
104 XML_ATTRIBUTE_ENUMERATION,
105 XML_ATTRIBUTE_NOTATION
106} xmlAttributeType;
107
108typedef enum {
109 XML_ATTRIBUTE_NONE = 1,
110 XML_ATTRIBUTE_REQUIRED,
111 XML_ATTRIBUTE_IMPLIED,
112 XML_ATTRIBUTE_FIXED
113} xmlAttributeDefault;
114
115typedef struct _xmlEnumeration xmlEnumeration;
116typedef xmlEnumeration *xmlEnumerationPtr;
117struct _xmlEnumeration {
118 struct _xmlEnumeration *next; /* next one */
119 const xmlChar *name; /* Enumeration name */
120};
121
122typedef struct _xmlAttribute xmlAttribute;
123typedef xmlAttribute *xmlAttributePtr;
124struct _xmlAttribute {
125#ifndef XML_WITHOUT_CORBA
126 void *_private; /* for Corba, must be first ! */
127#endif
128 xmlElementType type; /* XML_ATTRIBUTE_DECL, must be second ! */
129 const xmlChar *name; /* Attribute name */
130 struct _xmlNode *children; /* NULL */
131 struct _xmlNode *last; /* NULL */
132 struct _xmlDtd *parent; /* -> DTD */
133 struct _xmlNode *next; /* next sibling link */
134 struct _xmlNode *prev; /* previous sibling link */
135 struct _xmlDoc *doc; /* the containing document */
136
137 struct _xmlAttribute *nexth; /* next in hash table */
138 xmlAttributeType atype; /* The attribute type */
139 xmlAttributeDefault def; /* the default */
140 const xmlChar *defaultValue; /* or the default value */
141 xmlEnumerationPtr tree; /* or the enumeration tree if any */
142 const xmlChar *prefix; /* the namespace prefix if any */
143 const xmlChar *elem; /* Element holding the attribute */
144};
145
146/*
147 * a DTD Element definition.
148 */
149typedef enum {
150 XML_ELEMENT_CONTENT_PCDATA = 1,
151 XML_ELEMENT_CONTENT_ELEMENT,
152 XML_ELEMENT_CONTENT_SEQ,
153 XML_ELEMENT_CONTENT_OR
154} xmlElementContentType;
155
156typedef enum {
157 XML_ELEMENT_CONTENT_ONCE = 1,
158 XML_ELEMENT_CONTENT_OPT,
159 XML_ELEMENT_CONTENT_MULT,
160 XML_ELEMENT_CONTENT_PLUS
161} xmlElementContentOccur;
162
163typedef struct _xmlElementContent xmlElementContent;
164typedef xmlElementContent *xmlElementContentPtr;
165struct _xmlElementContent {
166 xmlElementContentType type; /* PCDATA, ELEMENT, SEQ or OR */
167 xmlElementContentOccur ocur; /* ONCE, OPT, MULT or PLUS */
168 const xmlChar *name; /* Element name */
169 struct _xmlElementContent *c1; /* first child */
170 struct _xmlElementContent *c2; /* second child */
171};
172
173typedef enum {
174 XML_ELEMENT_TYPE_EMPTY = 1,
175 XML_ELEMENT_TYPE_ANY,
176 XML_ELEMENT_TYPE_MIXED,
177 XML_ELEMENT_TYPE_ELEMENT
178} xmlElementTypeVal;
179
180typedef struct _xmlElement xmlElement;
181typedef xmlElement *xmlElementPtr;
182struct _xmlElement {
183#ifndef XML_WITHOUT_CORBA
184 void *_private; /* for Corba, must be first ! */
185#endif
186 xmlElementType type; /* XML_ELEMENT_DECL, must be second ! */
187 const xmlChar *name; /* Element name */
188 struct _xmlNode *children; /* NULL */
189 struct _xmlNode *last; /* NULL */
190 struct _xmlDtd *parent; /* -> DTD */
191 struct _xmlNode *next; /* next sibling link */
192 struct _xmlNode *prev; /* previous sibling link */
193 struct _xmlDoc *doc; /* the containing document */
194
195 xmlElementTypeVal etype; /* The type */
196 xmlElementContentPtr content; /* the allowed element content */
197 xmlAttributePtr attributes; /* List of the declared attributes */
198 const xmlChar *prefix; /* the namespace prefix if any */
199};
200
201/*
202 * An XML namespace.
203 * Note that prefix == NULL is valid, it defines the default namespace
204 * within the subtree (until overriden).
205 *
206 * XML_GLOBAL_NAMESPACE is now deprecated for good
207 * xmlNsType is unified with xmlElementType
208 */
209
210#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL
211typedef xmlElementType xmlNsType;
212
213typedef struct _xmlNs xmlNs;
214typedef xmlNs *xmlNsPtr;
215struct _xmlNs {
216 struct _xmlNs *next; /* next Ns link for this node */
217 xmlNsType type; /* global or local */
218 const xmlChar *href; /* URL for the namespace */
219 const xmlChar *prefix; /* prefix for the namespace */
220};
221
222/*
223 * An XML DtD, as defined by <!DOCTYPE.
224 */
225typedef struct _xmlDtd xmlDtd;
226typedef xmlDtd *xmlDtdPtr;
227struct _xmlDtd {
228#ifndef XML_WITHOUT_CORBA
229 void *_private; /* for Corba, must be first ! */
230#endif
231 xmlElementType type; /* XML_DTD_NODE, must be second ! */
232 const xmlChar *name; /* Name of the DTD */
233 struct _xmlNode *children; /* the value of the property link */
234 struct _xmlNode *last; /* last child link */
235 struct _xmlDoc *parent; /* child->parent link */
236 struct _xmlNode *next; /* next sibling link */
237 struct _xmlNode *prev; /* previous sibling link */
238 struct _xmlDoc *doc; /* the containing document */
239
240 /* End of common part */
241 void *notations; /* Hash table for notations if any */
242 void *elements; /* Hash table for elements if any */
243 void *attributes; /* Hash table for attributes if any */
244 void *entities; /* Hash table for entities if any */
245 const xmlChar *ExternalID; /* External identifier for PUBLIC DTD */
246 const xmlChar *SystemID; /* URI for a SYSTEM or PUBLIC DTD */
247 void *pentities; /* Hash table for param entities if any */
248};
249
250/*
251 * A attribute of an XML node.
252 */
253typedef struct _xmlAttr xmlAttr;
254typedef xmlAttr *xmlAttrPtr;
255struct _xmlAttr {
256#ifndef XML_WITHOUT_CORBA
257 void *_private; /* for Corba, must be first ! */
258#endif
259 xmlElementType type; /* XML_ATTRIBUTE_NODE, must be second ! */
260 const xmlChar *name; /* the name of the property */
261 struct _xmlNode *children; /* the value of the property */
262 struct _xmlNode *last; /* NULL */
263 struct _xmlNode *parent; /* child->parent link */
264 struct _xmlAttr *next; /* next sibling link */
265 struct _xmlAttr *prev; /* previous sibling link */
266 struct _xmlDoc *doc; /* the containing document */
267 xmlNs *ns; /* pointer to the associated namespace */
268 xmlAttributeType atype; /* the attribute type if validating */
269};
270
271/*
272 * An XML ID instance.
273 */
274
275typedef struct _xmlID xmlID;
276typedef xmlID *xmlIDPtr;
277struct _xmlID {
278 struct _xmlID *next; /* next ID */
279 const xmlChar *value; /* The ID name */
280 xmlAttrPtr attr; /* The attribut holding it */
281};
282
283/*
284 * An XML IDREF instance.
285 */
286
287typedef struct _xmlRef xmlRef;
288typedef xmlRef *xmlRefPtr;
289struct _xmlRef {
290 struct _xmlRef *next; /* next Ref */
291 const xmlChar *value; /* The Ref name */
292 xmlAttrPtr attr; /* The attribut holding it */
293};
294
295/*
296 * A buffer structure
297 */
298
299typedef enum {
300 XML_BUFFER_ALLOC_DOUBLEIT,
301 XML_BUFFER_ALLOC_EXACT
302} xmlBufferAllocationScheme;
303
304typedef struct _xmlBuffer xmlBuffer;
305typedef xmlBuffer *xmlBufferPtr;
306struct _xmlBuffer {
307 xmlChar *content; /* The buffer content UTF8 */
308 unsigned int use; /* The buffer size used */
309 unsigned int size; /* The buffer size */
310 xmlBufferAllocationScheme alloc; /* The realloc method */
311};
312
313/*
314 * A node in an XML tree.
315 */
316typedef struct _xmlNode xmlNode;
317typedef xmlNode *xmlNodePtr;
318struct _xmlNode {
319#ifndef XML_WITHOUT_CORBA
320 void *_private; /* for Corba, must be first ! */
321#endif
322 xmlElementType type; /* type number, must be second ! */
323 const xmlChar *name; /* the name of the node, or the entity */
324 struct _xmlNode *children; /* parent->childs link */
325 struct _xmlNode *last; /* last child link */
326 struct _xmlNode *parent; /* child->parent link */
327 struct _xmlNode *next; /* next sibling link */
328 struct _xmlNode *prev; /* previous sibling link */
329 struct _xmlDoc *doc; /* the containing document */
330 xmlNs *ns; /* pointer to the associated namespace */
331#ifndef XML_USE_BUFFER_CONTENT
332 xmlChar *content; /* the content */
333#else
334 xmlBufferPtr content; /* the content in a buffer */
335#endif
336
337 /* End of common part */
338 struct _xmlAttr *properties;/* properties list */
339 xmlNs *nsDef; /* namespace definitions on this node */
340};
341
342/*
343 * An XML document.
344 */
345typedef struct _xmlDoc xmlDoc;
346typedef xmlDoc *xmlDocPtr;
347struct _xmlDoc {
348#ifndef XML_WITHOUT_CORBA
349 void *_private; /* for Corba, must be first ! */
350#endif
351 xmlElementType type; /* XML_DOCUMENT_NODE, must be second ! */
352 char *name; /* name/filename/URI of the document */
353 struct _xmlNode *children; /* the document tree */
354 struct _xmlNode *last; /* last child link */
355 struct _xmlNode *parent; /* child->parent link */
356 struct _xmlNode *next; /* next sibling link */
357 struct _xmlNode *prev; /* previous sibling link */
358 struct _xmlDoc *doc; /* autoreference to itself */
359
360 /* End of common part */
361 int compression;/* level of zlib compression */
362 int standalone; /* standalone document (no external refs) */
363 struct _xmlDtd *intSubset; /* the document internal subset */
364 struct _xmlDtd *extSubset; /* the document external subset */
365 struct _xmlNs *oldNs; /* Global namespace, the old way */
366 const xmlChar *version; /* the XML version string */
367 const xmlChar *encoding; /* external initial encoding, if any */
368 void *ids; /* Hash table for ID attributes if any */
369 void *refs; /* Hash table for IDREFs attributes if any */
370 const xmlChar *URL; /* The URI for that document */
371 int charset; /* encoding of the in-memory content
372 actually an xmlCharEncoding */
373};
374
375/*
376 * Compatibility naming layer with libxml1
377 */
378#ifndef xmlChildrenNode
379#define xmlChildrenNode children
380#define xmlRootNode children
381#endif
382
383/*
384 * Variables.
385 */
386LIBXML_DLL_IMPORT extern xmlNsPtr baseDTD;
387LIBXML_DLL_IMPORT extern int oldXMLWDcompatibility;/* maintain compatibility with old WD */
388LIBXML_DLL_IMPORT extern int xmlIndentTreeOutput; /* try to indent the tree dumps */
389LIBXML_DLL_IMPORT extern xmlBufferAllocationScheme xmlBufferAllocScheme; /* alloc scheme to use */
Daniel Veillarde356c282001-03-10 12:32:04 +0000390LIBXML_DLL_IMPORT extern int xmlSaveNoEmptyTags; /* save empty tags as <empty></empty> */
391LIBXML_DLL_IMPORT extern int xmlDefaultBufferSize; /* default buffer size */
Owen Taylor3473f882001-02-23 17:55:21 +0000392
393/*
394 * Handling Buffers.
395 */
396
Daniel Veillard56a4cb82001-03-24 17:00:36 +0000397void xmlSetBufferAllocationScheme(xmlBufferAllocationScheme scheme);
398xmlBufferAllocationScheme xmlGetBufferAllocationScheme(void);
399
Owen Taylor3473f882001-02-23 17:55:21 +0000400xmlBufferPtr xmlBufferCreate (void);
401xmlBufferPtr xmlBufferCreateSize (size_t size);
Daniel Veillard56a4cb82001-03-24 17:00:36 +0000402int xmlBufferResize (xmlBufferPtr buf,
403 unsigned int size);
Owen Taylor3473f882001-02-23 17:55:21 +0000404void xmlBufferFree (xmlBufferPtr buf);
405int xmlBufferDump (FILE *file,
406 xmlBufferPtr buf);
407void xmlBufferAdd (xmlBufferPtr buf,
408 const xmlChar *str,
409 int len);
410void xmlBufferAddHead (xmlBufferPtr buf,
411 const xmlChar *str,
412 int len);
413void xmlBufferCat (xmlBufferPtr buf,
414 const xmlChar *str);
415void xmlBufferCCat (xmlBufferPtr buf,
416 const char *str);
417int xmlBufferShrink (xmlBufferPtr buf,
418 unsigned int len);
419int xmlBufferGrow (xmlBufferPtr buf,
420 unsigned int len);
421void xmlBufferEmpty (xmlBufferPtr buf);
422const xmlChar* xmlBufferContent (const xmlBufferPtr buf);
423int xmlBufferUse (const xmlBufferPtr buf);
424void xmlBufferSetAllocationScheme(xmlBufferPtr buf,
425 xmlBufferAllocationScheme scheme);
426int xmlBufferLength (const xmlBufferPtr buf);
427
428/*
429 * Creating/freeing new structures
430 */
431xmlDtdPtr xmlCreateIntSubset (xmlDocPtr doc,
432 const xmlChar *name,
433 const xmlChar *ExternalID,
434 const xmlChar *SystemID);
435xmlDtdPtr xmlNewDtd (xmlDocPtr doc,
436 const xmlChar *name,
437 const xmlChar *ExternalID,
438 const xmlChar *SystemID);
439xmlDtdPtr xmlGetIntSubset (xmlDocPtr doc);
440void xmlFreeDtd (xmlDtdPtr cur);
441xmlNsPtr xmlNewGlobalNs (xmlDocPtr doc,
442 const xmlChar *href,
443 const xmlChar *prefix);
444xmlNsPtr xmlNewNs (xmlNodePtr node,
445 const xmlChar *href,
446 const xmlChar *prefix);
447void xmlFreeNs (xmlNsPtr cur);
Daniel Veillard56a4cb82001-03-24 17:00:36 +0000448void xmlFreeNsList (xmlNsPtr cur);
Owen Taylor3473f882001-02-23 17:55:21 +0000449xmlDocPtr xmlNewDoc (const xmlChar *version);
450void xmlFreeDoc (xmlDocPtr cur);
451xmlAttrPtr xmlNewDocProp (xmlDocPtr doc,
452 const xmlChar *name,
453 const xmlChar *value);
454xmlAttrPtr xmlNewProp (xmlNodePtr node,
455 const xmlChar *name,
456 const xmlChar *value);
457xmlAttrPtr xmlNewNsProp (xmlNodePtr node,
458 xmlNsPtr ns,
459 const xmlChar *name,
460 const xmlChar *value);
461void xmlFreePropList (xmlAttrPtr cur);
462void xmlFreeProp (xmlAttrPtr cur);
463xmlAttrPtr xmlCopyProp (xmlNodePtr target,
464 xmlAttrPtr cur);
465xmlAttrPtr xmlCopyPropList (xmlNodePtr target,
466 xmlAttrPtr cur);
467xmlDtdPtr xmlCopyDtd (xmlDtdPtr dtd);
468xmlDocPtr xmlCopyDoc (xmlDocPtr doc,
469 int recursive);
470
471/*
472 * Creating new nodes
473 */
474xmlNodePtr xmlNewDocNode (xmlDocPtr doc,
475 xmlNsPtr ns,
476 const xmlChar *name,
477 const xmlChar *content);
478xmlNodePtr xmlNewDocRawNode (xmlDocPtr doc,
479 xmlNsPtr ns,
480 const xmlChar *name,
481 const xmlChar *content);
482xmlNodePtr xmlNewNode (xmlNsPtr ns,
483 const xmlChar *name);
484xmlNodePtr xmlNewChild (xmlNodePtr parent,
485 xmlNsPtr ns,
486 const xmlChar *name,
487 const xmlChar *content);
488xmlNodePtr xmlNewTextChild (xmlNodePtr parent,
489 xmlNsPtr ns,
490 const xmlChar *name,
491 const xmlChar *content);
492xmlNodePtr xmlNewDocText (xmlDocPtr doc,
493 const xmlChar *content);
494xmlNodePtr xmlNewText (const xmlChar *content);
495xmlNodePtr xmlNewPI (const xmlChar *name,
496 const xmlChar *content);
497xmlNodePtr xmlNewDocTextLen (xmlDocPtr doc,
498 const xmlChar *content,
499 int len);
500xmlNodePtr xmlNewTextLen (const xmlChar *content,
501 int len);
502xmlNodePtr xmlNewDocComment (xmlDocPtr doc,
503 const xmlChar *content);
504xmlNodePtr xmlNewComment (const xmlChar *content);
505xmlNodePtr xmlNewCDataBlock (xmlDocPtr doc,
506 const xmlChar *content,
507 int len);
508xmlNodePtr xmlNewCharRef (xmlDocPtr doc,
509 const xmlChar *name);
510xmlNodePtr xmlNewReference (xmlDocPtr doc,
511 const xmlChar *name);
512xmlNodePtr xmlCopyNode (xmlNodePtr node,
513 int recursive);
514xmlNodePtr xmlCopyNodeList (xmlNodePtr node);
515xmlNodePtr xmlNewDocFragment (xmlDocPtr doc);
516
517/*
518 * Navigating
519 */
520xmlNodePtr xmlDocGetRootElement (xmlDocPtr doc);
521xmlNodePtr xmlGetLastChild (xmlNodePtr parent);
522int xmlNodeIsText (xmlNodePtr node);
523int xmlIsBlankNode (xmlNodePtr node);
524
525/*
526 * Changing the structure
527 */
528xmlNodePtr xmlDocSetRootElement (xmlDocPtr doc,
529 xmlNodePtr root);
530void xmlNodeSetName (xmlNodePtr cur,
531 const xmlChar *name);
532xmlNodePtr xmlAddChild (xmlNodePtr parent,
533 xmlNodePtr cur);
534xmlNodePtr xmlAddChildList (xmlNodePtr parent,
535 xmlNodePtr cur);
536xmlNodePtr xmlReplaceNode (xmlNodePtr old,
537 xmlNodePtr cur);
538xmlNodePtr xmlAddSibling (xmlNodePtr cur,
539 xmlNodePtr elem);
540xmlNodePtr xmlAddPrevSibling (xmlNodePtr cur,
541 xmlNodePtr elem);
542xmlNodePtr xmlAddNextSibling (xmlNodePtr cur,
543 xmlNodePtr elem);
544void xmlUnlinkNode (xmlNodePtr cur);
545xmlNodePtr xmlTextMerge (xmlNodePtr first,
546 xmlNodePtr second);
547void xmlTextConcat (xmlNodePtr node,
548 const xmlChar *content,
549 int len);
550void xmlFreeNodeList (xmlNodePtr cur);
551void xmlFreeNode (xmlNodePtr cur);
552void xmlSetTreeDoc (xmlNodePtr tree,
553 xmlDocPtr doc);
554void xmlSetListDoc (xmlNodePtr list,
555 xmlDocPtr doc);
556
557/*
558 * Namespaces
559 */
560xmlNsPtr xmlSearchNs (xmlDocPtr doc,
561 xmlNodePtr node,
562 const xmlChar *nameSpace);
563xmlNsPtr xmlSearchNsByHref (xmlDocPtr doc,
564 xmlNodePtr node,
565 const xmlChar *href);
566xmlNsPtr * xmlGetNsList (xmlDocPtr doc,
567 xmlNodePtr node);
568void xmlSetNs (xmlNodePtr node,
569 xmlNsPtr ns);
570xmlNsPtr xmlCopyNamespace (xmlNsPtr cur);
571xmlNsPtr xmlCopyNamespaceList (xmlNsPtr cur);
572
573/*
574 * Changing the content.
575 */
576xmlAttrPtr xmlSetProp (xmlNodePtr node,
577 const xmlChar *name,
578 const xmlChar *value);
579xmlChar * xmlGetProp (xmlNodePtr node,
580 const xmlChar *name);
581xmlAttrPtr xmlHasProp (xmlNodePtr node,
582 const xmlChar *name);
583xmlAttrPtr xmlSetNsProp (xmlNodePtr node,
584 xmlNsPtr ns,
585 const xmlChar *name,
586 const xmlChar *value);
587xmlChar * xmlGetNsProp (xmlNodePtr node,
588 const xmlChar *name,
589 const xmlChar *nameSpace);
590xmlNodePtr xmlStringGetNodeList (xmlDocPtr doc,
591 const xmlChar *value);
592xmlNodePtr xmlStringLenGetNodeList (xmlDocPtr doc,
593 const xmlChar *value,
594 int len);
595xmlChar * xmlNodeListGetString (xmlDocPtr doc,
596 xmlNodePtr list,
597 int inLine);
598xmlChar * xmlNodeListGetRawString (xmlDocPtr doc,
599 xmlNodePtr list,
600 int inLine);
601void xmlNodeSetContent (xmlNodePtr cur,
602 const xmlChar *content);
603void xmlNodeSetContentLen (xmlNodePtr cur,
604 const xmlChar *content,
605 int len);
606void xmlNodeAddContent (xmlNodePtr cur,
607 const xmlChar *content);
608void xmlNodeAddContentLen (xmlNodePtr cur,
609 const xmlChar *content,
610 int len);
611xmlChar * xmlNodeGetContent (xmlNodePtr cur);
612xmlChar * xmlNodeGetLang (xmlNodePtr cur);
613void xmlNodeSetLang (xmlNodePtr cur,
614 const xmlChar *lang);
615int xmlNodeGetSpacePreserve (xmlNodePtr cur);
616void xmlNodeSetSpacePreserve (xmlNodePtr cur, int
617 val);
618xmlChar * xmlNodeGetBase (xmlDocPtr doc,
619 xmlNodePtr cur);
620void xmlNodeSetBase (xmlNodePtr cur,
621 xmlChar *uri);
622
623/*
624 * Removing content.
625 */
626int xmlRemoveProp (xmlAttrPtr attr);
627int xmlRemoveNode (xmlNodePtr node); /* TODO */
628
629/*
630 * Internal, don't use
631 */
632#ifdef VMS
633void xmlBufferWriteXmlCHAR (xmlBufferPtr buf,
634 const xmlChar *string);
635#define xmlBufferWriteCHAR xmlBufferWriteXmlCHAR
636#else
637void xmlBufferWriteCHAR (xmlBufferPtr buf,
638 const xmlChar *string);
639#endif
640void xmlBufferWriteChar (xmlBufferPtr buf,
641 const char *string);
642void xmlBufferWriteQuotedString(xmlBufferPtr buf,
643 const xmlChar *string);
644
645/*
646 * Namespace handling
647 */
648int xmlReconciliateNs (xmlDocPtr doc,
649 xmlNodePtr tree);
650
651/*
652 * Saving
653 */
654void xmlDocDumpFormatMemory (xmlDocPtr cur,
655 xmlChar**mem,
656 int *size,
657 int format);
658void xmlDocDumpMemory (xmlDocPtr cur,
659 xmlChar**mem,
660 int *size);
661void xmlDocDumpMemoryEnc (xmlDocPtr out_doc,
662 xmlChar **doc_txt_ptr,
663 int * doc_txt_len,
664 const char *txt_encoding);
665void xmlDocDumpFormatMemoryEnc(xmlDocPtr out_doc,
666 xmlChar **doc_txt_ptr,
667 int * doc_txt_len,
668 const char *txt_encoding,
669 int format);
670int xmlDocDump (FILE *f,
671 xmlDocPtr cur);
672void xmlElemDump (FILE *f,
673 xmlDocPtr doc,
674 xmlNodePtr cur);
675int xmlSaveFile (const char *filename,
676 xmlDocPtr cur);
677void xmlNodeDump (xmlBufferPtr buf,
678 xmlDocPtr doc,
679 xmlNodePtr cur,
680 int level,
681 int format);
682
683/* This one is exported from xmlIO.h
684
685int xmlSaveFileTo (xmlOutputBuffer *buf,
686 xmlDocPtr cur,
687 const char *encoding);
688 */
689
690int xmlSaveFileEnc (const char *filename,
691 xmlDocPtr cur,
692 const char *encoding);
693
694/*
695 * Compression
696 */
697int xmlGetDocCompressMode (xmlDocPtr doc);
698void xmlSetDocCompressMode (xmlDocPtr doc,
699 int mode);
700int xmlGetCompressMode (void);
701void xmlSetCompressMode (int mode);
702
703#ifdef __cplusplus
704}
705#endif
706
707#endif /* __XML_TREE_H__ */
708