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