tree.h 36 KB

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