blob: bf8a77ed2eb9afed1597e8fed50340342021c773 [file] [log] [blame]
Daniel Veillard260a68f1998-08-13 03:39:55 +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 *
Daniel Veillard39a1f9a1999-01-17 19:11:59 +00007 * Daniel.Veillard@w3.org
Daniel Veillard260a68f1998-08-13 03:39:55 +00008 */
9
10#ifndef __XML_TREE_H__
11#define __XML_TREE_H__
12
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
Daniel Veillard39a1f9a1999-01-17 19:11:59 +000018#include <stdio.h>
19
Daniel Veillard260a68f1998-08-13 03:39:55 +000020/*
Daniel Veillardccb09631998-10-27 06:21:04 +000021 * The different element types carried by an XML tree
22 *
23 * NOTE: This is synchronized with DOM Level1 values
24 * See http://www.w3.org/TR/REC-DOM-Level-1/
25 */
26typedef enum {
27 XML_ELEMENT_NODE= 1,
28 XML_ATTRIBUTE_NODE= 2,
29 XML_TEXT_NODE= 3,
30 XML_CDATA_SECTION_NODE= 4,
31 XML_ENTITY_REF_NODE= 5,
32 XML_ENTITY_NODE= 6,
33 XML_PI_NODE= 7,
34 XML_COMMENT_NODE= 8,
35 XML_DOCUMENT_NODE= 9,
36 XML_DOCUMENT_TYPE_NODE= 10,
37 XML_DOCUMENT_FRAG_NODE= 11,
38 XML_NOTATION_NODE= 12
39} xmlElementType;
40
41/*
Daniel Veillard0ba4d531998-11-01 19:34:31 +000042 * Size of an internal character representation.
43 *
44 * Currently we use 8bit chars internal representation for memory efficiency,
45 * but the parser is not tied to that, just define UNICODE to switch to
46 * a 16 bits internal representation. Note that with 8 bits wide
47 * CHARs one can still use UTF-8 to handle correctly non ISO-Latin
48 * input.
Daniel Veillard260a68f1998-08-13 03:39:55 +000049 */
50#ifdef UNICODE
51typedef unsigned short CHAR;
52#else
53typedef unsigned char CHAR;
54#endif
55
Daniel Veillardb96e6431999-08-29 21:02:19 +000056#define BAD_CAST (CHAR *)
57
Daniel Veillard260a68f1998-08-13 03:39:55 +000058/*
59 * a DTD Notation definition
Daniel Veillard260a68f1998-08-13 03:39:55 +000060 */
61
Daniel Veillard1e346af1999-02-22 10:33:01 +000062typedef struct xmlNotation {
63 const CHAR *name; /* Notation name */
64 const CHAR *PublicID; /* Public identifier, if any */
65 const CHAR *SystemID; /* System identifier, if any */
66} xmlNotation;
67typedef xmlNotation *xmlNotationPtr;
68
Daniel Veillard260a68f1998-08-13 03:39:55 +000069/*
70 * a DTD Attribute definition
Daniel Veillard260a68f1998-08-13 03:39:55 +000071 */
72
Daniel Veillard1e346af1999-02-22 10:33:01 +000073typedef enum {
74 XML_ATTRIBUTE_CDATA = 1,
75 XML_ATTRIBUTE_ID,
76 XML_ATTRIBUTE_IDREF ,
77 XML_ATTRIBUTE_IDREFS,
78 XML_ATTRIBUTE_ENTITY,
79 XML_ATTRIBUTE_ENTITIES,
80 XML_ATTRIBUTE_NMTOKEN,
81 XML_ATTRIBUTE_NMTOKENS,
82 XML_ATTRIBUTE_ENUMERATION,
83 XML_ATTRIBUTE_NOTATION
84} xmlAttributeType;
Daniel Veillard39a1f9a1999-01-17 19:11:59 +000085
Daniel Veillard1e346af1999-02-22 10:33:01 +000086typedef enum {
87 XML_ATTRIBUTE_NONE = 1,
88 XML_ATTRIBUTE_REQUIRED,
89 XML_ATTRIBUTE_IMPLIED,
90 XML_ATTRIBUTE_FIXED
91} xmlAttributeDefault;
92
93typedef struct xmlEnumeration {
94 struct xmlEnumeration *next; /* next one */
95 const CHAR *name; /* Enumeration name */
96} xmlEnumeration;
97typedef xmlEnumeration *xmlEnumerationPtr;
98
99typedef struct xmlAttribute {
100 const CHAR *elem; /* Element holding the attribute */
101 const CHAR *name; /* Attribute name */
Daniel Veillardb05deb71999-08-10 19:04:08 +0000102 struct xmlAttribute *next; /* list of attributes of an element */
Daniel Veillard1e346af1999-02-22 10:33:01 +0000103 xmlAttributeType type; /* The type */
104 xmlAttributeDefault def; /* the default */
105 const CHAR *defaultValue;/* or the default value */
106 xmlEnumerationPtr tree; /* or the enumeration tree if any */
107} xmlAttribute;
108typedef xmlAttribute *xmlAttributePtr;
Daniel Veillard39a1f9a1999-01-17 19:11:59 +0000109
Daniel Veillard260a68f1998-08-13 03:39:55 +0000110/*
111 * a DTD Element definition.
112 */
Daniel Veillard1899e851999-02-01 12:18:54 +0000113typedef enum {
Daniel Veillard1e346af1999-02-22 10:33:01 +0000114 XML_ELEMENT_CONTENT_PCDATA = 1,
Daniel Veillard1899e851999-02-01 12:18:54 +0000115 XML_ELEMENT_CONTENT_ELEMENT,
116 XML_ELEMENT_CONTENT_SEQ,
117 XML_ELEMENT_CONTENT_OR
118} xmlElementContentType;
Daniel Veillard39a1f9a1999-01-17 19:11:59 +0000119
Daniel Veillard1899e851999-02-01 12:18:54 +0000120typedef enum {
Daniel Veillard1e346af1999-02-22 10:33:01 +0000121 XML_ELEMENT_CONTENT_ONCE = 1,
Daniel Veillard1899e851999-02-01 12:18:54 +0000122 XML_ELEMENT_CONTENT_OPT,
123 XML_ELEMENT_CONTENT_MULT,
124 XML_ELEMENT_CONTENT_PLUS
125} xmlElementContentOccur;
Daniel Veillard39a1f9a1999-01-17 19:11:59 +0000126
127typedef struct xmlElementContent {
Daniel Veillard1899e851999-02-01 12:18:54 +0000128 xmlElementContentType type; /* PCDATA, ELEMENT, SEQ or OR */
129 xmlElementContentOccur ocur; /* ONCE, OPT, MULT or PLUS */
130 const CHAR *name; /* Element name */
Daniel Veillard39a1f9a1999-01-17 19:11:59 +0000131 struct xmlElementContent *c1; /* first child */
132 struct xmlElementContent *c2; /* second child */
Daniel Veillard1e346af1999-02-22 10:33:01 +0000133} xmlElementContent;
134typedef xmlElementContent *xmlElementContentPtr;
Daniel Veillard39a1f9a1999-01-17 19:11:59 +0000135
Daniel Veillard1899e851999-02-01 12:18:54 +0000136typedef enum {
Daniel Veillard1e346af1999-02-22 10:33:01 +0000137 XML_ELEMENT_TYPE_EMPTY = 1,
Daniel Veillard1899e851999-02-01 12:18:54 +0000138 XML_ELEMENT_TYPE_ANY,
139 XML_ELEMENT_TYPE_MIXED,
140 XML_ELEMENT_TYPE_ELEMENT
141} xmlElementTypeVal;
Daniel Veillard260a68f1998-08-13 03:39:55 +0000142
143typedef struct xmlElement {
Daniel Veillardb05deb71999-08-10 19:04:08 +0000144 const CHAR *name; /* Element name */
145 xmlElementTypeVal type; /* The type */
Daniel Veillard39a1f9a1999-01-17 19:11:59 +0000146 xmlElementContentPtr content; /* the allowed element content */
Daniel Veillardb05deb71999-08-10 19:04:08 +0000147 xmlAttributePtr attributes; /* List of the declared attributes */
Daniel Veillard1e346af1999-02-22 10:33:01 +0000148} xmlElement;
149typedef xmlElement *xmlElementPtr;
Daniel Veillard260a68f1998-08-13 03:39:55 +0000150
151/*
152 * An XML namespace.
153 * Note that prefix == NULL is valid, it defines the default namespace
154 * within the subtree (until overriden).
155 */
156
Daniel Veillard1899e851999-02-01 12:18:54 +0000157typedef enum {
Daniel Veillard1e346af1999-02-22 10:33:01 +0000158 XML_GLOBAL_NAMESPACE = 1, /* old style global namespace */
Daniel Veillard1899e851999-02-01 12:18:54 +0000159 XML_LOCAL_NAMESPACE /* new style local scoping */
160} xmlNsType;
Daniel Veillard260a68f1998-08-13 03:39:55 +0000161
162typedef struct xmlNs {
163 struct xmlNs *next; /* next Ns link for this node */
Daniel Veillard1899e851999-02-01 12:18:54 +0000164 xmlNsType type; /* global or local */
Daniel Veillard260a68f1998-08-13 03:39:55 +0000165 const CHAR *href; /* URL for the namespace */
166 const CHAR *prefix; /* prefix for the namespace */
Daniel Veillard1e346af1999-02-22 10:33:01 +0000167} xmlNs;
168typedef xmlNs *xmlNsPtr;
Daniel Veillard260a68f1998-08-13 03:39:55 +0000169
170/*
171 * An XML DtD, as defined by <!DOCTYPE.
172 */
173typedef struct xmlDtd {
174 const CHAR *name; /* Name of the DTD */
175 const CHAR *ExternalID; /* External identifier for PUBLIC DTD */
176 const CHAR *SystemID; /* URI for a SYSTEM or PUBLIC DTD */
Daniel Veillard1e346af1999-02-22 10:33:01 +0000177 void *notations; /* Hash table for notations if any */
Daniel Veillard260a68f1998-08-13 03:39:55 +0000178 void *elements; /* Hash table for elements if any */
Daniel Veillard1e346af1999-02-22 10:33:01 +0000179 void *attributes; /* Hash table for attributes if any */
Daniel Veillard260a68f1998-08-13 03:39:55 +0000180 void *entities; /* Hash table for entities if any */
181 /* struct xmlDtd *next; * next link for this document */
Daniel Veillard1e346af1999-02-22 10:33:01 +0000182} xmlDtd;
183typedef xmlDtd *xmlDtdPtr;
Daniel Veillard260a68f1998-08-13 03:39:55 +0000184
185/*
186 * A attribute of an XML node.
187 */
188typedef struct xmlAttr {
Daniel Veillard27fb0751998-10-17 06:47:46 +0000189#ifndef XML_WITHOUT_CORBA
190 void *_private; /* for Corba, must be first ! */
191 void *vepv; /* for Corba, must be next ! */
192#endif
Daniel Veillardccb09631998-10-27 06:21:04 +0000193 xmlElementType type; /* XML_ATTRIBUTE_NODE, must be third ! */
Daniel Veillard260a68f1998-08-13 03:39:55 +0000194 struct xmlNode *node; /* attr->node link */
Daniel Veillardb05deb71999-08-10 19:04:08 +0000195 struct xmlAttr *next; /* attribute list link */
Daniel Veillard260a68f1998-08-13 03:39:55 +0000196 const CHAR *name; /* the name of the property */
Daniel Veillardccb09631998-10-27 06:21:04 +0000197 struct xmlNode *val; /* the value of the property */
Daniel Veillardb96e6431999-08-29 21:02:19 +0000198 xmlNs *ns; /* pointer to the associated namespace */
Daniel Veillard1e346af1999-02-22 10:33:01 +0000199} xmlAttr;
200typedef xmlAttr *xmlAttrPtr;
Daniel Veillard260a68f1998-08-13 03:39:55 +0000201
202/*
Daniel Veillard991e63d1999-08-15 23:32:28 +0000203 * An XML ID instance.
204 */
205
206typedef struct xmlID {
207 struct xmlID *next; /* next ID */
208 const CHAR *value; /* The ID name */
209 xmlAttrPtr attr; /* The attribut holding it */
210} xmlID;
211typedef xmlID *xmlIDPtr;
212
213/*
Daniel Veillardc08a2c61999-09-08 21:35:25 +0000214 * An XML IDREF instance.
215 */
216
217typedef struct xmlRef {
218 struct xmlRef *next; /* next Ref */
219 const CHAR *value; /* The Ref name */
220 xmlAttrPtr attr; /* The attribut holding it */
221} xmlRef;
222typedef xmlRef *xmlRefPtr;
223
224/*
Daniel Veillard260a68f1998-08-13 03:39:55 +0000225 * A node in an XML tree.
226 */
Daniel Veillard260a68f1998-08-13 03:39:55 +0000227typedef struct xmlNode {
Daniel Veillard27fb0751998-10-17 06:47:46 +0000228#ifndef XML_WITHOUT_CORBA
229 void *_private; /* for Corba, must be first ! */
230 void *vepv; /* for Corba, must be next ! */
231#endif
Daniel Veillardccb09631998-10-27 06:21:04 +0000232 xmlElementType type; /* type number in the DTD, must be third ! */
Daniel Veillard0bef1311998-10-14 02:36:47 +0000233 struct xmlDoc *doc; /* the containing document */
Daniel Veillard260a68f1998-08-13 03:39:55 +0000234 struct xmlNode *parent; /* child->parent link */
235 struct xmlNode *next; /* next sibling link */
Daniel Veillard0bef1311998-10-14 02:36:47 +0000236 struct xmlNode *prev; /* previous sibling link */
Daniel Veillard260a68f1998-08-13 03:39:55 +0000237 struct xmlNode *childs; /* parent->childs link */
Daniel Veillard39a1f9a1999-01-17 19:11:59 +0000238 struct xmlNode *last; /* last child link */
Daniel Veillard260a68f1998-08-13 03:39:55 +0000239 struct xmlAttr *properties; /* properties list */
Daniel Veillard260a68f1998-08-13 03:39:55 +0000240 const CHAR *name; /* the name of the node, or the entity */
241 xmlNs *ns; /* pointer to the associated namespace */
242 xmlNs *nsDef; /* namespace definitions on this node */
243 CHAR *content; /* the content */
Daniel Veillard1e346af1999-02-22 10:33:01 +0000244} _xmlNode;
245typedef _xmlNode xmlNode;
246typedef _xmlNode *xmlNodePtr;
Daniel Veillard260a68f1998-08-13 03:39:55 +0000247
248/*
249 * An XML document.
250 */
251typedef struct xmlDoc {
Daniel Veillard27fb0751998-10-17 06:47:46 +0000252#ifndef XML_WITHOUT_CORBA
253 void *_private; /* for Corba, must be first ! */
254 void *vepv; /* for Corba, must be next ! */
255#endif
Daniel Veillardccb09631998-10-27 06:21:04 +0000256 xmlElementType type; /* XML_DOCUMENT_NODE, must be second ! */
Daniel Veillard260a68f1998-08-13 03:39:55 +0000257 char *name; /* name/filename/URI of the document */
258 const CHAR *version; /* the XML version string */
259 const CHAR *encoding; /* encoding, if any */
Daniel Veillard15a8df41998-09-24 19:15:06 +0000260 int compression;/* level of zlib compression */
Daniel Veillard260a68f1998-08-13 03:39:55 +0000261 int standalone; /* standalone document (no external refs) */
Daniel Veillard39a1f9a1999-01-17 19:11:59 +0000262 struct xmlDtd *intSubset; /* the document internal subset */
263 struct xmlDtd *extSubset; /* the document external subset */
Daniel Veillard260a68f1998-08-13 03:39:55 +0000264 struct xmlNs *oldNs; /* Global namespace, the old way */
Daniel Veillard260a68f1998-08-13 03:39:55 +0000265 struct xmlNode *root; /* the document tree */
Daniel Veillard991e63d1999-08-15 23:32:28 +0000266 void *ids; /* Hash table for ID attributes if any */
Daniel Veillardc08a2c61999-09-08 21:35:25 +0000267 void *refs; /* Hash table for IDREFs attributes if any */
Daniel Veillard1e346af1999-02-22 10:33:01 +0000268} _xmlDoc;
269typedef _xmlDoc xmlDoc;
270typedef xmlDoc *xmlDocPtr;
Daniel Veillard260a68f1998-08-13 03:39:55 +0000271
272/*
Daniel Veillard5099ae81999-04-21 20:12:07 +0000273 * A buffer structure
274 */
275
276typedef struct xmlBuffer {
277 CHAR *content; /* The buffer content UTF8 */
278 unsigned int use; /* The buffer size used */
279 unsigned int size; /* The buffer size */
280} _xmlBuffer;
281typedef _xmlBuffer xmlBuffer;
282typedef xmlBuffer *xmlBufferPtr;
283
284/*
Daniel Veillard260a68f1998-08-13 03:39:55 +0000285 * Variables.
286 */
287extern xmlNsPtr baseDTD;
288extern int oldXMLWDcompatibility;/* maintain compatibility with old WD */
289extern int xmlIndentTreeOutput; /* try to indent the tree dumps */
290
291/*
Daniel Veillard5099ae81999-04-21 20:12:07 +0000292 * Handling Buffers.
293 */
294
Daniel Veillardb96e6431999-08-29 21:02:19 +0000295xmlBufferPtr xmlBufferCreate (void);
296void xmlBufferFree (xmlBufferPtr buf);
297int xmlBufferDump (FILE *file,
298 xmlBufferPtr buf);
299void xmlBufferAdd (xmlBufferPtr buf,
300 const CHAR *str,
301 int len);
302void xmlBufferCat (xmlBufferPtr buf,
303 const CHAR *str);
304void xmlBufferCCat (xmlBufferPtr buf,
305 const char *str);
306int xmlBufferShrink (xmlBufferPtr buf,
307 int len);
308void xmlBufferEmpty (xmlBufferPtr buf);
Daniel Veillard5099ae81999-04-21 20:12:07 +0000309
310/*
Daniel Veillard16253641998-10-28 22:58:05 +0000311 * Creating/freeing new structures
Daniel Veillard260a68f1998-08-13 03:39:55 +0000312 */
Daniel Veillardb96e6431999-08-29 21:02:19 +0000313xmlDtdPtr xmlCreateIntSubset (xmlDocPtr doc,
314 const CHAR *name,
315 const CHAR *ExternalID,
316 const CHAR *SystemID);
317xmlDtdPtr xmlNewDtd (xmlDocPtr doc,
318 const CHAR *name,
319 const CHAR *ExternalID,
320 const CHAR *SystemID);
321void xmlFreeDtd (xmlDtdPtr cur);
322xmlNsPtr xmlNewGlobalNs (xmlDocPtr doc,
323 const CHAR *href,
324 const CHAR *prefix);
325xmlNsPtr xmlNewNs (xmlNodePtr node,
326 const CHAR *href,
327 const CHAR *prefix);
328void xmlFreeNs (xmlNsPtr cur);
329xmlDocPtr xmlNewDoc (const CHAR *version);
330void xmlFreeDoc (xmlDocPtr cur);
331xmlAttrPtr xmlNewDocProp (xmlDocPtr doc,
332 const CHAR *name,
333 const CHAR *value);
334xmlAttrPtr xmlNewProp (xmlNodePtr node,
335 const CHAR *name,
336 const CHAR *value);
337xmlAttrPtr xmlNewNsProp (xmlNodePtr node,
338 xmlNsPtr ns,
339 const CHAR *name,
340 const CHAR *value);
341void xmlFreePropList (xmlAttrPtr cur);
342void xmlFreeProp (xmlAttrPtr cur);
343xmlAttrPtr xmlCopyProp (xmlNodePtr target,
344 xmlAttrPtr cur);
345xmlAttrPtr xmlCopyPropList (xmlNodePtr target,
346 xmlAttrPtr cur);
347xmlDtdPtr xmlCopyDtd (xmlDtdPtr dtd);
348xmlDocPtr xmlCopyDoc (xmlDocPtr doc,
349 int recursive);
Daniel Veillard16253641998-10-28 22:58:05 +0000350
351/*
352 * Creating new nodes
353 */
Daniel Veillardb96e6431999-08-29 21:02:19 +0000354xmlNodePtr xmlNewDocNode (xmlDocPtr doc,
355 xmlNsPtr ns,
356 const CHAR *name,
357 const CHAR *content);
358xmlNodePtr xmlNewNode (xmlNsPtr ns,
359 const CHAR *name);
360xmlNodePtr xmlNewChild (xmlNodePtr parent,
361 xmlNsPtr ns,
362 const CHAR *name,
363 const CHAR *content);
364xmlNodePtr xmlNewDocText (xmlDocPtr doc,
365 const CHAR *content);
366xmlNodePtr xmlNewText (const CHAR *content);
367xmlNodePtr xmlNewPI (const CHAR *name,
368 const CHAR *content);
369xmlNodePtr xmlNewDocTextLen (xmlDocPtr doc,
370 const CHAR *content,
371 int len);
372xmlNodePtr xmlNewTextLen (const CHAR *content,
373 int len);
374xmlNodePtr xmlNewDocComment (xmlDocPtr doc,
375 const CHAR *content);
376xmlNodePtr xmlNewComment (const CHAR *content);
377xmlNodePtr xmlNewCDataBlock (xmlDocPtr doc,
378 const CHAR *content,
379 int len);
380xmlNodePtr xmlNewReference (xmlDocPtr doc,
381 const CHAR *name);
382xmlNodePtr xmlCopyNode (xmlNodePtr node,
383 int recursive);
384xmlNodePtr xmlCopyNodeList (xmlNodePtr node);
Daniel Veillard16253641998-10-28 22:58:05 +0000385
386/*
387 * Navigating
388 */
Daniel Veillardb96e6431999-08-29 21:02:19 +0000389xmlNodePtr xmlGetLastChild (xmlNodePtr parent);
390int xmlNodeIsText (xmlNodePtr node);
Daniel Veillard16253641998-10-28 22:58:05 +0000391
392/*
393 * Changing the structure
394 */
Daniel Veillardb96e6431999-08-29 21:02:19 +0000395xmlNodePtr xmlAddChild (xmlNodePtr parent,
396 xmlNodePtr cur);
397xmlNodePtr xmlAddSibling (xmlNodePtr cur,
398 xmlNodePtr elem);
399void xmlUnlinkNode (xmlNodePtr cur);
400xmlNodePtr xmlTextMerge (xmlNodePtr first,
401 xmlNodePtr second);
402void xmlTextConcat (xmlNodePtr node,
403 const CHAR *content,
404 int len);
405void xmlFreeNodeList (xmlNodePtr cur);
406void xmlFreeNode (xmlNodePtr cur);
Daniel Veillard16253641998-10-28 22:58:05 +0000407
408/*
409 * Namespaces
410 */
Daniel Veillardb96e6431999-08-29 21:02:19 +0000411xmlNsPtr xmlSearchNs (xmlDocPtr doc,
412 xmlNodePtr node,
413 const CHAR *nameSpace);
414xmlNsPtr xmlSearchNsByHref (xmlDocPtr doc,
415 xmlNodePtr node,
416 const CHAR *href);
417xmlNsPtr * xmlGetNsList (xmlDocPtr doc,
418 xmlNodePtr node);
419void xmlSetNs (xmlNodePtr node,
420 xmlNsPtr ns);
421xmlNsPtr xmlCopyNamespace (xmlNsPtr cur);
422xmlNsPtr xmlCopyNamespaceList (xmlNsPtr cur);
Daniel Veillard260a68f1998-08-13 03:39:55 +0000423
Daniel Veillard16253641998-10-28 22:58:05 +0000424/*
425 * Changing the content.
426 */
Daniel Veillardb96e6431999-08-29 21:02:19 +0000427xmlAttrPtr xmlSetProp (xmlNodePtr node,
428 const CHAR *name,
429 const CHAR *value);
430CHAR * xmlGetProp (xmlNodePtr node,
431 const CHAR *name);
432xmlNodePtr xmlStringGetNodeList (xmlDocPtr doc,
433 const CHAR *value);
434xmlNodePtr xmlStringLenGetNodeList (xmlDocPtr doc,
435 const CHAR *value,
436 int len);
437CHAR * xmlNodeListGetString (xmlDocPtr doc,
438 xmlNodePtr list,
439 int inLine);
440void xmlNodeSetContent (xmlNodePtr cur,
441 const CHAR *content);
442void xmlNodeSetContentLen (xmlNodePtr cur,
443 const CHAR *content,
444 int len);
445void xmlNodeAddContent (xmlNodePtr cur,
446 const CHAR *content);
447void xmlNodeAddContentLen (xmlNodePtr cur,
448 const CHAR *content,
449 int len);
450CHAR * xmlNodeGetContent (xmlNodePtr cur);
451const CHAR * xmlNodeGetLang (xmlNodePtr cur);
452void xmlNodeSetLang (xmlNodePtr cur,
453 const CHAR *lang);
Daniel Veillard16253641998-10-28 22:58:05 +0000454
455/*
Daniel Veillardc08a2c61999-09-08 21:35:25 +0000456 * Removing content.
457 */
458int xmlRemoveProp (xmlAttrPtr attr); /* TODO */
459int xmlRemoveNode (xmlNodePtr node); /* TODO */
460
461/*
Daniel Veillard16253641998-10-28 22:58:05 +0000462 * Internal, don't use
463 */
Daniel Veillardb96e6431999-08-29 21:02:19 +0000464void xmlBufferWriteCHAR (xmlBufferPtr buf,
465 const CHAR *string);
466void xmlBufferWriteChar (xmlBufferPtr buf,
467 const char *string);
468void xmlBufferWriteQuotedString(xmlBufferPtr buf,
469 const CHAR *string);
Daniel Veillard260a68f1998-08-13 03:39:55 +0000470
Daniel Veillard16253641998-10-28 22:58:05 +0000471/*
472 * Saving
473 */
Daniel Veillardb96e6431999-08-29 21:02:19 +0000474void xmlDocDumpMemory (xmlDocPtr cur,
475 CHAR**mem,
476 int *size);
477void xmlDocDump (FILE *f,
478 xmlDocPtr cur);
479int xmlSaveFile (const char *filename,
480 xmlDocPtr cur);
Daniel Veillard151b1b01998-09-23 00:49:46 +0000481
Daniel Veillard16253641998-10-28 22:58:05 +0000482/*
483 * Compression
484 */
Daniel Veillardb96e6431999-08-29 21:02:19 +0000485int xmlGetDocCompressMode (xmlDocPtr doc);
486void xmlSetDocCompressMode (xmlDocPtr doc,
487 int mode);
488int xmlGetCompressMode (void);
489void xmlSetCompressMode (int mode);
Daniel Veillard260a68f1998-08-13 03:39:55 +0000490
491#ifdef __cplusplus
492}
493#endif
494
495#endif /* __XML_TREE_H__ */
496