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