blob: 47e0212998832b296f6beaf26907d11b221af9b6 [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);
Daniel Veillard82daa812001-04-12 08:55:36 +0000515xmlNodePtr xmlDocCopyNode (xmlNodePtr node,
516 xmlDocPtr doc,
517 int recursive);
Owen Taylor3473f882001-02-23 17:55:21 +0000518xmlNodePtr xmlCopyNodeList (xmlNodePtr node);
519xmlNodePtr xmlNewDocFragment (xmlDocPtr doc);
520
521/*
522 * Navigating
523 */
524xmlNodePtr xmlDocGetRootElement (xmlDocPtr doc);
525xmlNodePtr xmlGetLastChild (xmlNodePtr parent);
526int xmlNodeIsText (xmlNodePtr node);
527int xmlIsBlankNode (xmlNodePtr node);
528
529/*
530 * Changing the structure
531 */
532xmlNodePtr xmlDocSetRootElement (xmlDocPtr doc,
533 xmlNodePtr root);
534void xmlNodeSetName (xmlNodePtr cur,
535 const xmlChar *name);
536xmlNodePtr xmlAddChild (xmlNodePtr parent,
537 xmlNodePtr cur);
538xmlNodePtr xmlAddChildList (xmlNodePtr parent,
539 xmlNodePtr cur);
540xmlNodePtr xmlReplaceNode (xmlNodePtr old,
541 xmlNodePtr cur);
542xmlNodePtr xmlAddSibling (xmlNodePtr cur,
543 xmlNodePtr elem);
544xmlNodePtr xmlAddPrevSibling (xmlNodePtr cur,
545 xmlNodePtr elem);
546xmlNodePtr xmlAddNextSibling (xmlNodePtr cur,
547 xmlNodePtr elem);
548void xmlUnlinkNode (xmlNodePtr cur);
549xmlNodePtr xmlTextMerge (xmlNodePtr first,
550 xmlNodePtr second);
551void xmlTextConcat (xmlNodePtr node,
552 const xmlChar *content,
553 int len);
554void xmlFreeNodeList (xmlNodePtr cur);
555void xmlFreeNode (xmlNodePtr cur);
556void xmlSetTreeDoc (xmlNodePtr tree,
557 xmlDocPtr doc);
558void xmlSetListDoc (xmlNodePtr list,
559 xmlDocPtr doc);
560
561/*
562 * Namespaces
563 */
564xmlNsPtr xmlSearchNs (xmlDocPtr doc,
565 xmlNodePtr node,
566 const xmlChar *nameSpace);
567xmlNsPtr xmlSearchNsByHref (xmlDocPtr doc,
568 xmlNodePtr node,
569 const xmlChar *href);
570xmlNsPtr * xmlGetNsList (xmlDocPtr doc,
571 xmlNodePtr node);
572void xmlSetNs (xmlNodePtr node,
573 xmlNsPtr ns);
574xmlNsPtr xmlCopyNamespace (xmlNsPtr cur);
575xmlNsPtr xmlCopyNamespaceList (xmlNsPtr cur);
576
577/*
578 * Changing the content.
579 */
580xmlAttrPtr xmlSetProp (xmlNodePtr node,
581 const xmlChar *name,
582 const xmlChar *value);
583xmlChar * xmlGetProp (xmlNodePtr node,
584 const xmlChar *name);
585xmlAttrPtr xmlHasProp (xmlNodePtr node,
586 const xmlChar *name);
587xmlAttrPtr xmlSetNsProp (xmlNodePtr node,
588 xmlNsPtr ns,
589 const xmlChar *name,
590 const xmlChar *value);
591xmlChar * xmlGetNsProp (xmlNodePtr node,
592 const xmlChar *name,
593 const xmlChar *nameSpace);
594xmlNodePtr xmlStringGetNodeList (xmlDocPtr doc,
595 const xmlChar *value);
596xmlNodePtr xmlStringLenGetNodeList (xmlDocPtr doc,
597 const xmlChar *value,
598 int len);
599xmlChar * xmlNodeListGetString (xmlDocPtr doc,
600 xmlNodePtr list,
601 int inLine);
602xmlChar * xmlNodeListGetRawString (xmlDocPtr doc,
603 xmlNodePtr list,
604 int inLine);
605void xmlNodeSetContent (xmlNodePtr cur,
606 const xmlChar *content);
607void xmlNodeSetContentLen (xmlNodePtr cur,
608 const xmlChar *content,
609 int len);
610void xmlNodeAddContent (xmlNodePtr cur,
611 const xmlChar *content);
612void xmlNodeAddContentLen (xmlNodePtr cur,
613 const xmlChar *content,
614 int len);
615xmlChar * xmlNodeGetContent (xmlNodePtr cur);
616xmlChar * xmlNodeGetLang (xmlNodePtr cur);
617void xmlNodeSetLang (xmlNodePtr cur,
618 const xmlChar *lang);
619int xmlNodeGetSpacePreserve (xmlNodePtr cur);
620void xmlNodeSetSpacePreserve (xmlNodePtr cur, int
621 val);
622xmlChar * xmlNodeGetBase (xmlDocPtr doc,
623 xmlNodePtr cur);
624void xmlNodeSetBase (xmlNodePtr cur,
625 xmlChar *uri);
626
627/*
628 * Removing content.
629 */
630int xmlRemoveProp (xmlAttrPtr attr);
631int xmlRemoveNode (xmlNodePtr node); /* TODO */
632
633/*
634 * Internal, don't use
635 */
636#ifdef VMS
637void xmlBufferWriteXmlCHAR (xmlBufferPtr buf,
638 const xmlChar *string);
639#define xmlBufferWriteCHAR xmlBufferWriteXmlCHAR
640#else
641void xmlBufferWriteCHAR (xmlBufferPtr buf,
642 const xmlChar *string);
643#endif
644void xmlBufferWriteChar (xmlBufferPtr buf,
645 const char *string);
646void xmlBufferWriteQuotedString(xmlBufferPtr buf,
647 const xmlChar *string);
648
649/*
650 * Namespace handling
651 */
652int xmlReconciliateNs (xmlDocPtr doc,
653 xmlNodePtr tree);
654
655/*
656 * Saving
657 */
658void xmlDocDumpFormatMemory (xmlDocPtr cur,
659 xmlChar**mem,
660 int *size,
661 int format);
662void xmlDocDumpMemory (xmlDocPtr cur,
663 xmlChar**mem,
664 int *size);
665void xmlDocDumpMemoryEnc (xmlDocPtr out_doc,
666 xmlChar **doc_txt_ptr,
667 int * doc_txt_len,
668 const char *txt_encoding);
669void xmlDocDumpFormatMemoryEnc(xmlDocPtr out_doc,
670 xmlChar **doc_txt_ptr,
671 int * doc_txt_len,
672 const char *txt_encoding,
673 int format);
674int xmlDocDump (FILE *f,
675 xmlDocPtr cur);
676void xmlElemDump (FILE *f,
677 xmlDocPtr doc,
678 xmlNodePtr cur);
679int xmlSaveFile (const char *filename,
680 xmlDocPtr cur);
681void xmlNodeDump (xmlBufferPtr buf,
682 xmlDocPtr doc,
683 xmlNodePtr cur,
684 int level,
685 int format);
686
687/* This one is exported from xmlIO.h
688
689int xmlSaveFileTo (xmlOutputBuffer *buf,
690 xmlDocPtr cur,
691 const char *encoding);
692 */
693
694int xmlSaveFileEnc (const char *filename,
695 xmlDocPtr cur,
696 const char *encoding);
697
698/*
699 * Compression
700 */
701int xmlGetDocCompressMode (xmlDocPtr doc);
702void xmlSetDocCompressMode (xmlDocPtr doc,
703 int mode);
704int xmlGetCompressMode (void);
705void xmlSetCompressMode (int mode);
706
707#ifdef __cplusplus
708}
709#endif
710
711#endif /* __XML_TREE_H__ */
712