tree.h 40 KB

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