You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1311 lines
37 KiB

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