ixml.h 57 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835
  1. /**************************************************************************
  2. *
  3. * Copyright (c) 2000-2003 Intel Corporation
  4. * All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions are met:
  8. *
  9. * - Redistributions of source code must retain the above copyright notice,
  10. * this list of conditions and the following disclaimer.
  11. * - Redistributions in binary form must reproduce the above copyright notice,
  12. * this list of conditions and the following disclaimer in the documentation
  13. * and/or other materials provided with the distribution.
  14. * - Neither name of Intel Corporation nor the names of its contributors
  15. * may be used to endorse or promote products derived from this software
  16. * without specific prior written permission.
  17. *
  18. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  19. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  20. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  21. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
  22. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  23. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  24. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  25. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  26. * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  27. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  28. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  29. *
  30. **************************************************************************/
  31. #ifndef IXML_H
  32. #define IXML_H
  33. /*!
  34. * \file
  35. *
  36. * \defgroup XMLAPI XML API
  37. *
  38. * @{
  39. */
  40. #include "UpnpGlobal.h" /* For EXPORT_SPEC */
  41. /* Define BOOL. */
  42. #ifndef __OBJC__
  43. typedef int BOOL;
  44. #else
  45. /* For Objective C compilers, include objc.h which defines BOOL. */
  46. #include <objc/objc.h>
  47. #endif
  48. /*!
  49. * \brief The type of DOM strings.
  50. */
  51. #define DOMString char *
  52. /*typedef char *DOMString;*/
  53. #ifndef TRUE
  54. #define TRUE 1
  55. #endif
  56. #ifndef FALSE
  57. #define FALSE 0
  58. #endif
  59. #ifndef IN
  60. #define IN
  61. #endif
  62. #ifndef OUT
  63. #define OUT
  64. #endif
  65. #ifndef INOUT
  66. #define INOUT
  67. #endif
  68. /*!
  69. * \name DOM Interfaces
  70. *
  71. * The Document Object Model consists of a set of objects and interfaces
  72. * for accessing and manipulating documents. IXML does not implement all
  73. * the interfaces documented in the DOM2-Core recommendation but defines
  74. * a subset of the most useful interfaces. A description of the supported
  75. * interfaces and methods is presented in this section.
  76. *
  77. * For a complete discussion on the object model, the object hierarchy,
  78. * etc., refer to section 1.1 of the DOM2-Core recommendation.
  79. *
  80. * @{
  81. */
  82. /*!
  83. * \brief The type of the DOM node
  84. */
  85. typedef enum {
  86. eINVALID_NODE = 0,
  87. eELEMENT_NODE = 1,
  88. eATTRIBUTE_NODE = 2,
  89. eTEXT_NODE = 3,
  90. eCDATA_SECTION_NODE = 4,
  91. eENTITY_REFERENCE_NODE = 5,
  92. eENTITY_NODE = 6,
  93. ePROCESSING_INSTRUCTION_NODE = 7,
  94. eCOMMENT_NODE = 8,
  95. eDOCUMENT_NODE = 9,
  96. eDOCUMENT_TYPE_NODE = 10,
  97. eDOCUMENT_FRAGMENT_NODE = 11,
  98. eNOTATION_NODE = 12,
  99. } IXML_NODE_TYPE;
  100. /*!
  101. * \brief Error codes returned by the XML API, see the DOM spec
  102. */
  103. typedef enum {
  104. IXML_SUCCESS = 0,
  105. IXML_INDEX_SIZE_ERR = 1,
  106. IXML_DOMSTRING_SIZE_ERR = 2,
  107. IXML_HIERARCHY_REQUEST_ERR = 3,
  108. IXML_WRONG_DOCUMENT_ERR = 4,
  109. IXML_INVALID_CHARACTER_ERR = 5,
  110. IXML_NO_DATA_ALLOWED_ERR = 6,
  111. IXML_NO_MODIFICATION_ALLOWED_ERR = 7,
  112. IXML_NOT_FOUND_ERR = 8,
  113. IXML_NOT_SUPPORTED_ERR = 9,
  114. IXML_INUSE_ATTRIBUTE_ERR = 10,
  115. IXML_INVALID_STATE_ERR = 11,
  116. IXML_SYNTAX_ERR = 12,
  117. IXML_INVALID_MODIFICATION_ERR = 13,
  118. IXML_NAMESPACE_ERR = 14,
  119. IXML_INVALID_ACCESS_ERR = 15,
  120. IXML_NO_SUCH_FILE = 101,
  121. IXML_INSUFFICIENT_MEMORY = 102,
  122. IXML_FILE_DONE = 104,
  123. IXML_INVALID_PARAMETER = 105,
  124. IXML_FAILED = 106,
  125. IXML_INVALID_ITEM_NUMBER = 107,
  126. } IXML_ERRORCODE;
  127. #define DOCUMENTNODENAME "#document"
  128. #define TEXTNODENAME "#text"
  129. #define CDATANODENAME "#cdata-section"
  130. typedef struct _IXML_Document *Docptr;
  131. typedef struct _IXML_Node *Nodeptr;
  132. /*!
  133. * \brief Data structure common to all types of nodes.
  134. */
  135. typedef struct _IXML_Node
  136. {
  137. DOMString nodeName;
  138. DOMString nodeValue;
  139. IXML_NODE_TYPE nodeType;
  140. DOMString namespaceURI;
  141. DOMString prefix;
  142. DOMString localName;
  143. BOOL readOnly;
  144. Nodeptr parentNode;
  145. Nodeptr firstChild;
  146. Nodeptr prevSibling;
  147. Nodeptr nextSibling;
  148. Nodeptr firstAttr;
  149. Docptr ownerDocument;
  150. } IXML_Node;
  151. /*!
  152. * \brief Data structure representing the DOM Document.
  153. */
  154. typedef struct _IXML_Document
  155. {
  156. IXML_Node n;
  157. } IXML_Document;
  158. /*!
  159. * \brief Data structure representing a CDATA section node.
  160. */
  161. typedef struct _IXML_CDATASection
  162. {
  163. IXML_Node n;
  164. } IXML_CDATASection;
  165. /*!
  166. * \brief Data structure representing an Element node.
  167. */
  168. typedef struct _IXML_Element
  169. {
  170. IXML_Node n;
  171. DOMString tagName;
  172. } IXML_Element;
  173. /*!
  174. * \brief Data structure representing an Attribute node.
  175. */
  176. typedef struct _IXML_ATTR
  177. {
  178. IXML_Node n;
  179. BOOL specified;
  180. IXML_Element *ownerElement;
  181. } IXML_Attr;
  182. /*!
  183. * \brief Data structure representing a Text node.
  184. */
  185. typedef struct _IXML_Text
  186. {
  187. IXML_Node n;
  188. } IXML_Text;
  189. /*!
  190. * \brief Data structure representing a list of nodes.
  191. */
  192. typedef struct _IXML_NodeList
  193. {
  194. IXML_Node *nodeItem;
  195. struct _IXML_NodeList *next;
  196. } IXML_NodeList;
  197. /*!
  198. * \brief Data structure representing a list of named nodes.
  199. */
  200. typedef struct _IXML_NamedNodeMap
  201. {
  202. IXML_Node *nodeItem;
  203. struct _IXML_NamedNodeMap *next;
  204. } IXML_NamedNodeMap;
  205. /* @} DOM Interfaces */
  206. #ifdef __cplusplus
  207. extern "C" {
  208. #endif
  209. /*!
  210. * \name Interface Node
  211. *
  212. * The \b Node interface forms the primary datatype for all other DOM
  213. * objects. Every other interface is derived from this interface, inheriting
  214. * its functionality. For more information, refer to DOM2-Core page 34.
  215. *
  216. * @{
  217. */
  218. /*!
  219. * \brief Returns the name of the \b Node, depending on what type of
  220. * \b Node it is, in a read-only string.
  221. *
  222. * Refer to the table in the
  223. * DOM2-Core for a description of the node names for various interfaces.
  224. *
  225. * \return A constant \b DOMString of the node name.
  226. */
  227. EXPORT_SPEC const DOMString ixmlNode_getNodeName(
  228. /*! [in] Pointer to the node to retrieve the name. */
  229. IXML_Node *nodeptr);
  230. /*!
  231. * \brief Returns the value of the \b Node as a string.
  232. *
  233. * Note that this string is not a copy and modifying it will modify the value
  234. * of the \b Node.
  235. *
  236. * \return A \b DOMString of the \b Node value.
  237. */
  238. EXPORT_SPEC const DOMString ixmlNode_getNodeValue(
  239. /*! [in] Pointer to the \b Node to retrieve the value. */
  240. IXML_Node *nodeptr);
  241. /*!
  242. * \brief Assigns a new value to a \b Node.
  243. *
  244. * The \b newNodeValue string is duplicated and stored in the \b Node so that
  245. * the original does not have to persist past this call.
  246. *
  247. * \return An integer representing one of the following:
  248. * \li \c IXML_SUCCESS: The operation completed successfully.
  249. * \li \c IXML_INVALID_PARAMETER: The <b>Node *</b> is not a valid pointer.
  250. * \li \c IXML_INSUFFICIENT_MEMORY: Not enough free memory exists to
  251. * complete this operation.
  252. */
  253. EXPORT_SPEC int ixmlNode_setNodeValue(
  254. /*! [in] The \b Node to which to assign a new value. */
  255. IXML_Node *nodeptr,
  256. /*! [in] The new value of the \b Node. */
  257. const char *newNodeValue);
  258. /*!
  259. * \brief Retrieves the type of a \b Node.
  260. *
  261. * \return An enum IXML_NODE_TYPE representing the type of the \b Node.
  262. */
  263. EXPORT_SPEC unsigned short ixmlNode_getNodeType(
  264. /*! [in] The \b Node from which to retrieve the type. */
  265. IXML_Node *nodeptr);
  266. /*!
  267. * \brief Retrieves the parent \b Node for a \b Node.
  268. *
  269. * \return A pointer to the parent \b Node or \c NULL if the \b Node has no
  270. * parent.
  271. */
  272. EXPORT_SPEC IXML_Node *ixmlNode_getParentNode(
  273. /*! [in] The \b Node from which to retrieve the parent. */
  274. IXML_Node *nodeptr);
  275. /*!
  276. * \brief Retrieves the list of children of a \b Node in a \b NodeList
  277. * structure.
  278. *
  279. * If a \b Node has no children, \b ixmlNode_getChildNodes
  280. * returns a \b NodeList structure that contains no \b Nodes.
  281. *
  282. * \return A \b NodeList of the children of the \b Node.
  283. */
  284. EXPORT_SPEC IXML_NodeList *ixmlNode_getChildNodes(
  285. /*! [in] The \b Node from which to retrieve the children. */
  286. IXML_Node *nodeptr);
  287. /*!
  288. * \brief Retrieves the first child \b Node of a \b Node.
  289. *
  290. * \return A pointer to the first child \b Node or \c NULL if the \b Node does
  291. * not have any children.
  292. */
  293. EXPORT_SPEC IXML_Node *ixmlNode_getFirstChild(
  294. /*! [in] The \b Node from which to retrieve the first child. */
  295. IXML_Node *nodeptr);
  296. /*!
  297. * \brief Retrieves the last child \b Node of a \b Node.
  298. *
  299. * \return A pointer to the last child \b Node or \c NULL if the \b Node does
  300. * not have any children.
  301. */
  302. EXPORT_SPEC IXML_Node *ixmlNode_getLastChild(
  303. /*! [in] The \b Node from which to retrieve the last child. */
  304. IXML_Node *nodeptr);
  305. /*!
  306. * \brief Retrieves the sibling \b Node immediately preceding this \b Node.
  307. *
  308. * \return A pointer to the previous sibling \b Node or \c NULL if no such
  309. * \b Node exists.
  310. */
  311. EXPORT_SPEC IXML_Node *ixmlNode_getPreviousSibling(
  312. /*! [in] The \b Node for which to retrieve the previous sibling. */
  313. IXML_Node *nodeptr);
  314. /*!
  315. * \brief Retrieves the sibling \b Node immediately following this \b Node.
  316. *
  317. * \return A pointer to the next sibling \b Node or \c NULL if no such
  318. * \b Node exists.
  319. */
  320. EXPORT_SPEC IXML_Node *ixmlNode_getNextSibling(
  321. /*! [in] The \b Node from which to retrieve the next sibling. */
  322. IXML_Node *nodeptr);
  323. /*!
  324. * \brief Retrieves the attributes of a \b Node, if it is an \b Element node,
  325. * in a \b NamedNodeMap structure.
  326. *
  327. * \return A \b NamedNodeMap of the attributes or \c NULL.
  328. */
  329. EXPORT_SPEC IXML_NamedNodeMap *ixmlNode_getAttributes(
  330. /*! [in] The \b Node from which to retrieve the attributes. */
  331. IXML_Node *nodeptr);
  332. /*!
  333. * \brief Retrieves the document object associated with this \b Node.
  334. *
  335. * This owner document \b Node allows other \b Nodes to be created in the
  336. * context of this document. Note that \b Document nodes do not have an
  337. * owner document.
  338. *
  339. * \return A pointer to the owning \b Document or \c NULL, if the \b Node
  340. * does not have an owner.
  341. */
  342. EXPORT_SPEC IXML_Document *ixmlNode_getOwnerDocument(
  343. /*! [in] The \b Node from which to retrieve the owner document. */
  344. IXML_Node *nodeptr);
  345. /*!
  346. * \brief Retrieves the namespace URI for a \b Node as a \b DOMString.
  347. *
  348. * Only \b Nodes of type \c eELEMENT_NODE or \c eATTRIBUTE_NODE can have a
  349. * namespace URI. \b Nodes created through the \b Document interface will
  350. * only contain a namespace if created using \b ixmlDocument_createElementNS.
  351. *
  352. * \return A \b DOMString representing the URI of the namespace or \c NULL.
  353. */
  354. EXPORT_SPEC const DOMString ixmlNode_getNamespaceURI(
  355. /*! [in] The \b Node for which to retrieve the namespace. */
  356. IXML_Node *nodeptr);
  357. /*!
  358. * \brief Retrieves the namespace prefix, if present.
  359. *
  360. * The prefix is the name used as an alias for the namespace URI for this
  361. * element. Only \b Nodes of type \c eELEMENT_NODE or \c eATTRIBUTE_NODE can
  362. * have a prefix. \b Nodes created through the \b Document interface will only
  363. * contain a prefix if created using \b ixmlDocument_createElementNS.
  364. *
  365. * \return A \b DOMString representing the namespace prefix or \c NULL.
  366. */
  367. EXPORT_SPEC const DOMString
  368. ixmlNode_getPrefix(
  369. /*! The \b Node from which to retrieve the prefix. */
  370. IXML_Node *nodeptr);
  371. /*!
  372. * \brief Retrieves the local name of a \b Node, if present.
  373. *
  374. * The local name is the tag name without the namespace prefix. Only \b Nodes
  375. * of type \c eELEMENT_NODE or \c eATTRIBUTE_NODE can have a local name.
  376. * \b Nodes created through the \b Document interface will only contain a local
  377. * name if created using \b ixmlDocument_createElementNS.
  378. *
  379. * \return A \b DOMString representing the local name of the \b Element or
  380. * \c NULL.
  381. */
  382. EXPORT_SPEC const DOMString ixmlNode_getLocalName(
  383. /*! [in] The \b Node from which to retrieve the local name. */
  384. IXML_Node *nodeptr);
  385. /*!
  386. * \brief Inserts a new child \b Node before the existing child \b Node.
  387. *
  388. * \b refChild can be \c NULL, which inserts \b newChild at the
  389. * end of the list of children. Note that the \b Node (or \b Nodes)
  390. * in \b newChild must already be owned by the owner document (or have no
  391. * owner at all) of \b nodeptr for insertion. If not, the \b Node
  392. * (or \b Nodes) must be imported into the document using
  393. * \b ixmlDocument_importNode. If \b newChild is already in the tree,
  394. * it is removed first.
  395. *
  396. * \return An integer representing one of the following:
  397. * \li \c IXML_SUCCESS: The operation completed successfully.
  398. * \li \c IXML_INVALID_PARAMETER: Either \b nodeptr or
  399. * \b newChild is \c NULL.
  400. * \li \c IXML_HIERARCHY_REQUEST_ERR: The type of the \b Node
  401. * does not allow children of the type of \b newChild.
  402. * \li \c IXML_WRONG_DOCUMENT_ERR: \b newChild has an owner
  403. * document that does not match the owner of \b nodeptr.
  404. * \li \c IXML_NO_MODIFICATION_ALLOWED_ERR: \b nodeptr is
  405. * read-only or the parent of the \b Node being inserted is
  406. * read-only.
  407. * \li \c IXML_NOT_FOUND_ERR: \b refChild is not a child of
  408. * \b nodeptr.
  409. */
  410. EXPORT_SPEC int ixmlNode_insertBefore(
  411. /*! [in] The parent of the \b Node before which to insert the new child. */
  412. IXML_Node *nodeptr,
  413. /*! [in] The \b Node to insert into the tree. */
  414. IXML_Node * newChild,
  415. /*! [in] The reference child where the new \b Node should be inserted.
  416. * The new \b Node will appear directly before the reference child. */
  417. IXML_Node * refChild);
  418. /*!
  419. * \brief Replaces an existing child \b Node with a new child \b Node in the
  420. * list of children of a \b Node.
  421. *
  422. * If \b newChild is already in the tree, it will first be removed.
  423. * \b returnNode will contain the \b oldChild \b Node, appropriately removed
  424. * from the tree (i.e. it will no longer have an owner document).
  425. *
  426. * \return An integer representing one of the following:
  427. * \li \c IXML_SUCCESS: The operation completed successfully.
  428. * \li \c IXML_INVALID_PARAMTER: Either \b nodeptr, \b newChild,
  429. * or \b oldChild is \c NULL.
  430. * \li \c IXML_HIERARCHY_REQUEST_ERR: The \b newChild is not
  431. * a type of \b Node that can be inserted into this tree or
  432. * \b newChild is an ancestor of \b nodePtr.
  433. * \li \c IXML_WRONG_DOCUMENT_ERR: \b newChild was created from
  434. * a different document than \b nodeptr.
  435. * \li \c IXML_NO_MODIFICATION_ALLOWED_ERR: \b nodeptr or
  436. * its parent is read-only.
  437. * \li \c IXML_NOT_FOUND_ERR: \b oldChild is not a child of
  438. * \b nodeptr.
  439. */
  440. EXPORT_SPEC int ixmlNode_replaceChild(
  441. /*! [in] The parent of the \b Node which contains the child to replace. */
  442. IXML_Node *nodeptr,
  443. /*! [in] The child with which to replace \b oldChild. */
  444. IXML_Node *newChild,
  445. /*! [in] The child to replace with \b newChild. */
  446. IXML_Node *oldChild,
  447. /*! [out] Pointer to a \b Node to place the removed \b oldChild \b Node. */
  448. IXML_Node **returnNode);
  449. /*!
  450. * \brief Removes a child from the list of children of a \b Node.
  451. *
  452. * \b returnNode will contain the \b oldChild \b Node,
  453. * appropriately removed from the tree (i.e. it will no longer have an
  454. * owner document).
  455. *
  456. * \return An integer representing one of the following:
  457. * \li \c IXML_SUCCESS: The operation completed successfully.
  458. * \li \c IXML_INVALID_PARAMETER: Either \b nodeptr or
  459. * \b oldChild is \c NULL.
  460. * \li \c IXML_NO_MODIFICATION_ALLOWED_ERR: \b nodeptr or its
  461. * parent is read-only.
  462. * \li \c IXML_NOT_FOUND_ERR: \b oldChild is not among the
  463. * children of \b nodeptr.
  464. */
  465. EXPORT_SPEC int ixmlNode_removeChild(
  466. /*! [in] The parent of the child to remove. */
  467. IXML_Node *nodeptr,
  468. /*! [in] The child \b Node to remove. */
  469. IXML_Node *oldChild,
  470. /*! [out] Pointer to a \b Node to place the removed \b oldChild \b Node. */
  471. IXML_Node **returnNode);
  472. /*!
  473. * \brief Appends a child \b Node to the list of children of a \b Node.
  474. *
  475. * If \b newChild is already in the tree, it is removed first.
  476. *
  477. * \return An integer representing one of the following:
  478. * \li \c IXML_SUCCESS: The operation completed successfully.
  479. * \li \c IXML_INVALID_PARAMETER: Either \b nodeptr or
  480. * \b newChild is \c NULL.
  481. * \li \c IXML_HIERARCHY_REQUEST_ERR: \b newChild is of a type
  482. * that cannot be added as a child of \b nodeptr or
  483. * \b newChild is an ancestor of \b nodeptr.
  484. * \li \c IXML_WRONG_DOCUMENT_ERR: \b newChild was created from
  485. * a different document than \b nodeptr.
  486. * \li \c IXML_NO_MODIFICATION_ALLOWED_ERR: \b nodeptr is a
  487. * read-only \b Node.
  488. */
  489. EXPORT_SPEC int ixmlNode_appendChild(
  490. /*! [in] The \b Node in which to append the new child. */
  491. IXML_Node *nodeptr,
  492. /*! [in] The new child to append. */
  493. IXML_Node * newChild);
  494. /*!
  495. * \brief Queries whether or not a \b Node has children.
  496. *
  497. * \return \c TRUE if the \b Node has one or more children otherwise \c FALSE.
  498. */
  499. EXPORT_SPEC BOOL ixmlNode_hasChildNodes(
  500. /*! [in] The \b Node to query for children. */
  501. IXML_Node *nodeptr);
  502. /*!
  503. * \brief Clones a \b Node.
  504. *
  505. * The new \b Node does not have a parent. The \b deep parameter controls
  506. * whether the subtree of the \b Node is also cloned.
  507. *
  508. * For details on cloning specific types of \b Nodes, refer to the
  509. * DOM2-Core recommendation.
  510. *
  511. * \return A clone of \b nodeptr or \c NULL.
  512. */
  513. EXPORT_SPEC IXML_Node *ixmlNode_cloneNode(
  514. /*! [in] The \b Node to clone. */
  515. IXML_Node *nodeptr,
  516. /*! [in] \c TRUE to clone the subtree also or \c FALSE to clone only
  517. * \b nodeptr. */
  518. BOOL deep);
  519. /*!
  520. * \brief Queries whether this \b Node has attributes.
  521. *
  522. * Note that only \b Element nodes have attributes.
  523. *
  524. * \return \c TRUE if the \b Node has attributes otherwise \c FALSE.
  525. */
  526. EXPORT_SPEC BOOL ixmlNode_hasAttributes(
  527. /*! [in] The \b Node to query for attributes. */
  528. IXML_Node *nodeptr);
  529. /*!
  530. * \brief Frees a \b Node and all \b Nodes in its subtree.
  531. */
  532. EXPORT_SPEC void ixmlNode_free(
  533. /*! [in] The \b Node tree to free. */
  534. IXML_Node *nodeptr);
  535. /* @} Interface Node */
  536. /*!
  537. * \name Interface Attr
  538. *
  539. * The \b Attr interface represents an attribute of an \b Element. The document
  540. * type definition (DTD) or schema usually dictate the allowable attributes and
  541. * values for a particular element.
  542. *
  543. * For more information, refer to the <em>Interface Attr</em> section in the
  544. * DOM2-Core.
  545. *
  546. * @{
  547. */
  548. /*!
  549. * \brief Frees an \b Attr node.
  550. */
  551. EXPORT_SPEC void ixmlAttr_free(
  552. /*! The \b Attr node to free. */
  553. IXML_Attr *attrNode);
  554. /* @} Interface Attr */
  555. /*!
  556. * \name Interface CDATASection
  557. *
  558. * The \b CDATASection is used to escape blocks of text containing
  559. * characters that would otherwise be regarded as markup. CDATA sections
  560. * cannot be nested. Their primary purpose is for including material such
  561. * XML fragments, without needing to escape all the delimiters.
  562. *
  563. * For more information, refer to the <em>Interface CDATASection</em> section
  564. * in the DOM2-Core.
  565. *
  566. * @{
  567. */
  568. /*!
  569. * \brief Initializes a \b CDATASection node.
  570. */
  571. EXPORT_SPEC void ixmlCDATASection_init(
  572. /*! [in] The <b>CDATA Section Node</b> to iniatialize. */
  573. IXML_CDATASection *nodeptr);
  574. /*!
  575. * \brief Frees a \b CDATASection node.
  576. */
  577. EXPORT_SPEC void ixmlCDATASection_free(
  578. /*! The \b CDATASection node to free. */
  579. IXML_CDATASection *nodeptr);
  580. /* @} Interface CDATASection */
  581. /*!
  582. * \name Interface Document
  583. *
  584. * The \b Document interface represents the entire XML document. In essence, it
  585. * is the root of the document tree and provides the primary interface to the
  586. * elements of the document.
  587. *
  588. * For more information, refer to the <em>Interface Document</em> section in
  589. * the DOM2Core.
  590. *
  591. * @{
  592. */
  593. /*!
  594. * \brief Initializes a \b Document node.
  595. */
  596. EXPORT_SPEC void ixmlDocument_init(
  597. /*! [in] The \b Document node to initialize. */
  598. IXML_Document *nodeptr);
  599. /*!
  600. * \brief Creates a new empty \b Document node.
  601. *
  602. * The \b ixmlDocument_createDocumentEx API differs from the
  603. * \b ixmlDocument_createDocument API in that it returns an error code
  604. * describing the reason for the failure rather than just \c NULL.
  605. *
  606. * \return An integer representing one of the following:
  607. * \li \c IXML_SUCCESS: The operation completed successfully.
  608. * \li \c IXML_INSUFFICIENT_MEMORY: Not enough free memory exists
  609. * to complete this operation.
  610. */
  611. EXPORT_SPEC int ixmlDocument_createDocumentEx(
  612. /*! [out] Pointer to a \b Document where the new object will be stored. */
  613. IXML_Document **doc);
  614. /*!
  615. * \brief Creates a new empty \b Document node.
  616. *
  617. * \return A pointer to the new \b Document object with the nodeName set to
  618. * "#document" or \c NULL on failure.
  619. */
  620. EXPORT_SPEC IXML_Document *ixmlDocument_createDocument(void);
  621. /*!
  622. * \brief Creates a new \b Element node with the given tag name.
  623. *
  624. * The new \b Element node has a \c nodeName of \b tagName and the
  625. * \c localName, \c prefix, and \c namespaceURI set to \c NULL. To create an
  626. * \b Element with a namespace, see \b ixmlDocument_createElementNS.
  627. *
  628. * The \b ixmlDocument_createElementEx API differs from the \b
  629. * ixmlDocument_createElement API in that it returns an error code
  630. * describing the reason for failure rather than just \c NULL.
  631. *
  632. * \return An integer representing one of the following:
  633. * \li \c IXML_SUCCESS: The operation completed successfully.
  634. * \li \c IXML_INVALID_PARAMETER: Either \b doc or
  635. * \b tagName is \c NULL.
  636. * \li \c IXML_INSUFFICIENT_MEMORY: Not enough free memory exists
  637. * to complete this operation.
  638. */
  639. EXPORT_SPEC int ixmlDocument_createElementEx(
  640. /*! [in] The owner \b Document of the new node. */
  641. IXML_Document *doc,
  642. /*! [in] The tag name of the new \b Element node. */
  643. const DOMString tagName,
  644. /*! [out] Pointer to an \b Element where the new object will be stored. */
  645. IXML_Element **rtElement);
  646. /*!
  647. * \brief Creates a new \b Element node with the given tag name.
  648. *
  649. * The new \b Element node has a \c nodeName of \b tagName and the
  650. * \c localName, \c prefix, and \c namespaceURI set to \c NULL. To create an
  651. * \b Element with a namespace, see \b ixmlDocument_createElementNS.
  652. *
  653. * \return A pointer to the new \b Element object with the node name set to
  654. * tagName, and localName, prefix and namespaceURI set to \c NULL, or \c NULL
  655. * on failure.
  656. */
  657. EXPORT_SPEC IXML_Element *ixmlDocument_createElement(
  658. /*! [in] The owner \b Document of the new node. */
  659. IXML_Document *doc,
  660. /*! [in] The tag name of the new \b Element node (case-sensitive). */
  661. const DOMString tagName);
  662. /*!
  663. * \brief Creates a new \b Text node with the given data.
  664. *
  665. * The \b ixmlDocument_createTextNodeEx() API differs from the
  666. * \b ixmlDocument_createTextNode API in that it returns an error code
  667. * describing the reason for failure rather than just \c NULL.
  668. *
  669. * \return An integer representing one of the following:
  670. * \li \c IXML_SUCCESS: The operation completed successfully.
  671. * \li \c IXML_INVALID_PARAMETER: Either \b doc or \b data
  672. * is \c NULL.
  673. * \li \c IXML_INSUFFICIENT_MEMORY: Not enough free memory exists
  674. * to complete this operation.
  675. */
  676. EXPORT_SPEC int ixmlDocument_createTextNodeEx(
  677. /*! [in] The owner \b Document of the new node. */
  678. IXML_Document *doc,
  679. /*! [in] The data to associate with the new \b Text node.
  680. * It is stored in nodeValue field.*/
  681. const DOMString data,
  682. /*! [out] A pointer to a \b Node where the new object will be stored. */
  683. IXML_Node **textNode);
  684. /*!
  685. * \brief Creates a new \b Text node with the given data.
  686. *
  687. * \return A pointer to the new \b Node or \c NULL on failure.
  688. */
  689. EXPORT_SPEC IXML_Node *ixmlDocument_createTextNode(
  690. /*! [in] The owner \b Document of the new node. */
  691. IXML_Document *doc,
  692. /*! [in] The data to associate with the new \b Text node. It is stored in
  693. * the nodeValue field. */
  694. const DOMString data);
  695. /*!
  696. * \brief Creates a new \b CDATASection node with given data.
  697. *
  698. * The \b ixmlDocument_createCDATASectionEx API differs from the \b
  699. * ixmlDocument_createCDATASection API in that it returns an error code
  700. * describing the reason for failure rather than just \c NULL.
  701. *
  702. * \return An integer representing one of the following:
  703. * \li \c IXML_SUCCESS: The operation completed successfully.
  704. * \li \c IXML_INVALID_PARAMETER: Either \b doc or \b data
  705. * is \c NULL.
  706. * \li \c IXML_INSUFFICIENT_MEMORY: Not enough free memory exists
  707. * to complete this operation.
  708. */
  709. EXPORT_SPEC int ixmlDocument_createCDATASectionEx(
  710. /*! [in] The owner \b Document of the new node. */
  711. IXML_Document *doc,
  712. /*! [in] The data to associate with the new \b CDATASection node. */
  713. const DOMString data,
  714. /*! [out] A pointer to a \b Node where the new object will be stored. */
  715. IXML_CDATASection** cdNode);
  716. /*!
  717. * \brief Creates a new \b CDATASection node with given data.
  718. *
  719. * \return A pointer to the new \b CDATASection or \c NULL on failure.
  720. */
  721. EXPORT_SPEC IXML_CDATASection *ixmlDocument_createCDATASection(
  722. /*! [in] The owner \b Document of the new node. */
  723. IXML_Document *doc,
  724. /*! [in] The data to associate with the new \b CDATASection node. */
  725. const DOMString data);
  726. /*!
  727. * \brief Creates a new \b Attr node with the given name.
  728. *
  729. * \return A pointer to the new \b Attr object with the nodeName attribute
  730. * set to the given name, and the localName, prefix and namespaceURI set
  731. * to NULL or \c NULL on failure.
  732. *
  733. * The value of the attribute is the empty string.
  734. */
  735. EXPORT_SPEC IXML_Attr *ixmlDocument_createAttribute(
  736. /*! [in] The owner \b Document of the new node. */
  737. IXML_Document *doc,
  738. /*! [in] The name of the new attribute. */
  739. const char *name);
  740. /*!
  741. * \brief Creates a new \b Attr node with the given name.
  742. *
  743. * The \b ixmlDocument_createAttributeEx API differs from the \b
  744. * ixmlDocument_createAttribute API in that it returns an error code
  745. * describing the reason for failure rather than just \c NULL.
  746. *
  747. * \return An integer representing one of the following:
  748. * \li \c IXML_SUCCESS: The operation completed successfully.
  749. * \li \c IXML_INVALID_PARAMETER: Either \b doc or \b name
  750. * is \c NULL.
  751. * \li \c IXML_INSUFFICIENT_MEMORY: Not enough free memory exists
  752. * to complete this operation.
  753. */
  754. EXPORT_SPEC int ixmlDocument_createAttributeEx(
  755. /*! [in] The owner \b Document of the new node. */
  756. IXML_Document *doc,
  757. /*! [in] The name of the new attribute. */
  758. const char *name,
  759. /*! [out] A pointer to a \b Attr where the new object will be stored. */
  760. IXML_Attr **attrNode);
  761. /*!
  762. * \brief Returns a \b NodeList of all \b Elements that match the given
  763. * tag name in the order in which they were encountered in a preorder
  764. * traversal of the \b Document tree.
  765. *
  766. * \return A pointer to a \b NodeList containing the matching items or \c NULL
  767. * on an error.
  768. */
  769. EXPORT_SPEC IXML_NodeList *ixmlDocument_getElementsByTagName(
  770. /*! [in] The \b Document to search. */
  771. IXML_Document *doc,
  772. /*! [in] The tag name to find. The special value "*" matches all tags.*/
  773. const DOMString tagName);
  774. /*
  775. * introduced in DOM level 2
  776. */
  777. /*!
  778. * \brief Creates a new \b Element node in the given qualified name and
  779. * namespace URI.
  780. *
  781. * The \b ixmlDocument_createElementNSEx API differs from the \b
  782. * ixmlDocument_createElementNS API in that it returns an error code
  783. * describing the reason for failure rather than just \c NULL.
  784. *
  785. * \return An integer representing one of the following:
  786. * \li \c IXML_SUCCESS: The operation completed successfully.
  787. * \li \c IXML_INVALID_PARAMETER: Either \b doc,
  788. * \b namespaceURI, or \b qualifiedName is \c NULL.
  789. * \li \c IXML_INSUFFICIENT_MEMORY: Not enough free memory exists
  790. * to complete this operation.
  791. */
  792. EXPORT_SPEC int ixmlDocument_createElementNSEx(
  793. /*! [in] The owner \b Document of the new node. */
  794. IXML_Document *doc,
  795. /*! [in] The namespace URI for the new \b Element. */
  796. const DOMString namespaceURI,
  797. /*! [in] The qualified name of the new \b Element. */
  798. const DOMString qualifiedName,
  799. /*! [out] A pointer to an \b Element where the new object will be stored. */
  800. IXML_Element **rtElement);
  801. /*!
  802. * \brief Creates a new \b Element node in the given qualified name and
  803. * namespace URI.
  804. *
  805. * \return A pointer to the new \b Element object with tagName qualifiedName,
  806. * prefix and localName extraced from qualfiedName, nodeName of qualfiedName,
  807. * namespaceURI of namespaceURI or \c NULL on failure.
  808. */
  809. EXPORT_SPEC IXML_Element *ixmlDocument_createElementNS(
  810. /*! [in] The owner \b Document of the new node. */
  811. IXML_Document *doc,
  812. /*! [in] The namespace URI for the new \b Element. */
  813. const DOMString namespaceURI,
  814. /*! [in] The qualified name of the new \b Element. */
  815. const DOMString qualifiedName);
  816. /*!
  817. * \brief Creates a new \b Attr node with the given qualified name and
  818. * namespace URI.
  819. *
  820. * The \b ixmlDocument_createAttributeNSEx API differs from the \b
  821. * ixmlDocument_createAttributeNS API in that it returns an error code
  822. * describing the reason for failure rather than just \c NULL.
  823. *
  824. * \return An integer representing one of the following:
  825. * \li \c IXML_SUCCESS: The operation completed successfully.
  826. * \li \c IXML_INVALID_PARAMETER: Either \b doc,
  827. * \b namespaceURI, or \b qualifiedName is \c NULL.
  828. * \li \c IXML_INSUFFICIENT_MEMORY: Not enough free memory exists
  829. * to complete this operation.
  830. */
  831. EXPORT_SPEC int ixmlDocument_createAttributeNSEx(
  832. /*! [in] The owner \b Document of the new \b Attr. */
  833. IXML_Document *doc,
  834. /*! [in] The namespace URI for the attribute. */
  835. const DOMString namespaceURI,
  836. /*! [in] The qualified name of the attribute. */
  837. const DOMString qualifiedName,
  838. /*! [out] A pointer to an \b Attr where the new object will be stored. */
  839. IXML_Attr **attrNode);
  840. /*!
  841. * \brief Creates a new \b Attribute node with the given qualified name and
  842. * namespace URI.
  843. *
  844. * \return A pointer to the new \b Attr node with the given namespaceURI and
  845. * qualifiedName. The prefix and localname are extracted from
  846. * the qualifiedName. The node value is empty. Or \c NULL on failure.
  847. */
  848. EXPORT_SPEC IXML_Attr *ixmlDocument_createAttributeNS(
  849. /*! [in] The owner \b Document of the new \b Attribute. */
  850. IXML_Document *doc,
  851. /*! [in] The namespace URI for the attribute. */
  852. const DOMString namespaceURI,
  853. /*! [in] The qualified name of the attribute. */
  854. const DOMString qualifiedName);
  855. /*!
  856. * \brief Returns a \b NodeList of \b Elements that match the given
  857. * local name and namespace URI in the order they are encountered
  858. * in a preorder traversal of the \b Document tree.
  859. *
  860. * Either \b namespaceURI or \b localName can be the special <tt>"*"</tt>
  861. * character, which matches any namespace or any local name respectively.
  862. *
  863. * \return A pointer to a \b NodeList containing the matching items or \c NULL
  864. * on an error.
  865. */
  866. EXPORT_SPEC IXML_NodeList *ixmlDocument_getElementsByTagNameNS(
  867. /*! [in] The \b Document to search. */
  868. IXML_Document *doc,
  869. /*! [in] The namespace of the elements to find or <tt>"*"</tt> to match any
  870. * namespace. */
  871. const DOMString namespaceURI,
  872. /*! [in] The local name of the elements to find or <tt>"*"</tt> to match any
  873. * local name. */
  874. const DOMString localName);
  875. /*!
  876. * \brief Returns the \b Element whose \c ID matches that given id.
  877. *
  878. * \return A pointer to the matching \b Element or \c NULL on an error.
  879. */
  880. EXPORT_SPEC IXML_Element *ixmlDocument_getElementById(
  881. /*! [in] The owner \b Document of the \b Element. */
  882. IXML_Document *doc,
  883. /*! [in] The name of the \b Element.*/
  884. const DOMString tagName);
  885. /*!
  886. * \brief Frees a \b Document object and all \b Nodes associated with it.
  887. *
  888. * Any \b Nodes extracted via any other interface function, e.g.
  889. * \b ixmlDocument_GetElementById, become invalid after this call unless
  890. * explicitly cloned.
  891. */
  892. EXPORT_SPEC void ixmlDocument_free(
  893. /*! [in] The \b Document to free. */
  894. IXML_Document *doc);
  895. /*!
  896. * \brief Imports a \b Node from another \b Document into this \b Document.
  897. *
  898. * The returned new \b Node does not a have parent node (parentNode is null):
  899. * it is a clone of the original \b Node with the \c ownerDocument set to
  900. * \b doc. The source node is not altered or removed from the original
  901. * document.
  902. *
  903. * For all nodes, importing a node creates a node object owned by the
  904. * importing document, with attribute values identical to the source
  905. * node's nodeName and nodeType, plus the attributes related to namespaces
  906. * (prefix, localName, and namespaceURI).
  907. *
  908. * As in the cloneNode operation on a node, the source node is not altered.
  909. *
  910. * The \b deep parameter controls whether all the children of the \b Node are
  911. * imported.
  912. *
  913. * Refer to the DOM2-Core recommendation for details on importing specific
  914. * node types.
  915. *
  916. * \return An integer representing one of the following:
  917. * \li \c IXML_SUCCESS: The operation completed successfully.
  918. * \li \c IXML_INVALID_PARAMETER: Either \b doc or
  919. * \b importNode is not a valid pointer.
  920. * \li \c IXML_NOT_SUPPORTED_ERR: \b importNode is a
  921. * \b Document, which cannot be imported.
  922. * \li \c IXML_FAILED: The import operation failed because the
  923. * \b Node to be imported could not be cloned.
  924. */
  925. EXPORT_SPEC int ixmlDocument_importNode(
  926. /*! [in] The \b Document into which to import. */
  927. IXML_Document *doc,
  928. /*! [in] The \b Node to import. */
  929. IXML_Node * importNode,
  930. /*! [in] \c TRUE to import all children of \b importNode or \c FALSE to
  931. * import only the root node. */
  932. BOOL deep,
  933. /*! [out] A pointer to a new \b Node owned by \b doc. */
  934. IXML_Node **rtNode);
  935. /* @} Interface Document */
  936. /*!
  937. * \name Interface Element
  938. *
  939. * The \b Element interface represents an element in an XML document.
  940. * Only \b Elements are allowed to have attributes, which are stored in the
  941. * \c attributes member of a \b Node. The \b Element interface
  942. * extends the \b Node interface and adds more operations to manipulate
  943. * attributes.
  944. *
  945. * @{
  946. */
  947. /*!
  948. * \brief Initializes a \b IXML_Element node.
  949. */
  950. EXPORT_SPEC void ixmlElement_init(
  951. /*! [in] The \b Element to initialize.*/
  952. IXML_Element *element);
  953. /*!
  954. * \brief Returns the name of the tag as a constant string.
  955. *
  956. * \return The name of the \b Element.
  957. */
  958. EXPORT_SPEC const DOMString ixmlElement_getTagName(
  959. /*! [in] The \b Element from which to retrieve the name. */
  960. IXML_Element *element);
  961. /*!
  962. * \brief Retrieves an attribute of an \b Element by name.
  963. *
  964. * \return The value of the attribute, or \b NULL if that attribute
  965. * does not have a specified value.
  966. */
  967. EXPORT_SPEC const DOMString ixmlElement_getAttribute(
  968. /*! [in] The \b Element from which to retrieve the attribute. */
  969. IXML_Element* element,
  970. /*! [in] The name of the attribute to retrieve. */
  971. const DOMString name);
  972. /*!
  973. * \brief Adds a new attribute to an \b Element.
  974. *
  975. * If an attribute with the same name already exists in the element, the
  976. * attribute value will be updated with the new value parameter. Otherwise,
  977. * a new attribute is inserted into the element.
  978. *
  979. * \return An integer representing of the following:
  980. * \li \c IXML_SUCCESS: The operation completed successfully.
  981. * \li \c IXML_INVALID_PARAMETER: Either \b element,
  982. * \b name, or \b value is \c NULL.
  983. * \li \c IXML_INVALID_CHARACTER_ERR: \b name contains an
  984. * illegal character.
  985. * \li \c IXML_INSUFFICIENT_MEMORY: Not enough free memory exists
  986. * to complete the operation.
  987. */
  988. EXPORT_SPEC int ixmlElement_setAttribute(
  989. /*! [in] The \b Element on which to set the attribute. */
  990. IXML_Element *element,
  991. /*! [in] The name of the attribute. */
  992. const DOMString name,
  993. /*! [in] The value of the attribute. Note that this is a non-parsed string
  994. * and any markup must be escaped. */
  995. const DOMString value);
  996. /*!
  997. * \brief Removes an attribute value by name. The attribute node is not removed.
  998. *
  999. * \return An integer representing one of the following:
  1000. * \li \c IXML_SUCCESS: The operation completed successfully.
  1001. * \li \c IXML_INVALID_PARAMETER: Either \b element or
  1002. * \b name is \c NULL.
  1003. */
  1004. EXPORT_SPEC int ixmlElement_removeAttribute(
  1005. /*! [in] The \b Element from which to remove the attribute. */
  1006. IXML_Element *element,
  1007. /*! [in] The name of the attribute to remove. */
  1008. const DOMString name);
  1009. /*!
  1010. * \brief Retrieves an attribute node by name.
  1011. * See \b ixmlElement_getAttributeNodeNS to retrieve an attribute node using
  1012. * a qualified name or namespace URI.
  1013. *
  1014. * \return A pointer to the attribute matching \b name or \c NULL on if there
  1015. * is no such attribute.
  1016. */
  1017. EXPORT_SPEC IXML_Attr *ixmlElement_getAttributeNode(
  1018. /*! [in] The \b Element from which to get the attribute node. */
  1019. IXML_Element *element,
  1020. /*! [in] The name of the attribute node to find. */
  1021. const DOMString name);
  1022. /*!
  1023. * \brief Adds a new attribute node to an \b Element.
  1024. *
  1025. * If an attribute already exists with \b newAttr as a name, it will be
  1026. * replaced with the new one and the old one will be returned in \b rtAttr.
  1027. *
  1028. * \return If successfull, the replaced attribute node is returned in rtAttr,
  1029. * otherwise, \b NULL is returned in this pointer. The function return value
  1030. * is an integer representing one of the following:
  1031. * \li \c IXML_SUCCESS: The operation completed successfully.
  1032. * \li \c IXML_INVALID_PARAMETER: Either \b element or
  1033. * \b newAttr is \c NULL.
  1034. * \li \c IXML_WRONG_DOCUMENT_ERR: \b newAttr does not belong
  1035. * to the same one as \b element.
  1036. * \li \c IXML_INUSE_ATTRIBUTE_ERR: \b newAttr is already
  1037. * an attribute of another \b Element.
  1038. */
  1039. EXPORT_SPEC int ixmlElement_setAttributeNode(
  1040. /*! [in] The \b Element in which to add the new attribute. */
  1041. IXML_Element *element,
  1042. /*! [in] The new \b Attr to add. */
  1043. IXML_Attr* newAttr,
  1044. /*! [out] A pointer to an \b Attr where the old \b Attr will be stored.
  1045. * This will have a \c NULL if no prior node existed. */
  1046. IXML_Attr** rtAttr);
  1047. /*!
  1048. * \brief Removes the specified attribute node from an \b Element.
  1049. *
  1050. * \return An integer representing one of the following:
  1051. * \li \c IXML_SUCCESS: The operation completed successfully.
  1052. * \li \c IXML_INVALID_PARAMETER: Either \b element or
  1053. * \b oldAttr is \c NULL.
  1054. * \li \c IXML_NOT_FOUND_ERR: \b oldAttr is not among the list
  1055. * attributes of \b element.
  1056. */
  1057. EXPORT_SPEC int ixmlElement_removeAttributeNode(
  1058. /*! [in] The \b Element from which to remove the attribute. */
  1059. IXML_Element *element,
  1060. /*! [in] The attribute to remove from the \b Element. */
  1061. IXML_Attr* oldAttr,
  1062. /*! [out] A pointer to an attribute in which to place the removed attribute. */
  1063. IXML_Attr** rtAttr);
  1064. /*!
  1065. * \brief Returns a \b NodeList of all \em descendant \b Elements with
  1066. * a given tag name, in the order in which they are encountered in a
  1067. * pre-order traversal of this \b Element tree.
  1068. *
  1069. * \return A \b NodeList of the matching \b Elements or \c NULL on an error.
  1070. */
  1071. EXPORT_SPEC IXML_NodeList *ixmlElement_getElementsByTagName(
  1072. /*! [in] The \b Element from which to start the search. */
  1073. IXML_Element *element,
  1074. /*! [in] The name of the tag for which to search. */
  1075. const DOMString tagName);
  1076. /*
  1077. * Introduced in DOM 2
  1078. */
  1079. /*!
  1080. * \brief Retrieves an attribute value using the local name and namespace URI.
  1081. *
  1082. * \return A \b DOMString representing the value of the matching attribute, or
  1083. * \b NULL if that attribute does not have the specified value.
  1084. */
  1085. EXPORT_SPEC const DOMString ixmlElement_getAttributeNS(
  1086. /*! [in] The \b Element from which to get the attribute value. */
  1087. IXML_Element *element,
  1088. /*! [in] The namespace URI of the attribute. */
  1089. const DOMString namespaceURI,
  1090. /*! [in] The local name of the attribute. */
  1091. const DOMString localname);
  1092. /*!
  1093. * \brief Adds a new attribute to an \b Element using the local name and
  1094. * namespace URI.
  1095. *
  1096. * If another attribute matches the same local name and namespace, the prefix
  1097. * is changed to be the prefix part of the \c qualifiedName and the value is
  1098. * changed to \b value.
  1099. *
  1100. * \return An integer representing one of the following:
  1101. * \li \c IXML_SUCCESS: The operation completed successfully.
  1102. * \li \c IXML_INVALID_PARAMETER: Either \b element,
  1103. * \b namespaceURI, \b qualifiedName, or \b value is
  1104. * \c NULL.
  1105. * \li \c IXML_INVALID_CHARACTER_ERR: \b qualifiedName contains
  1106. * an invalid character.
  1107. * \li \c IXML_NAMESPACE_ERR: Either the \b qualifiedName or
  1108. * \b namespaceURI is malformed. Refer to the DOM2-Core for
  1109. * possible reasons.
  1110. * \li \c IXML_INSUFFICIENT_MEMORY: Not enough free memory exist
  1111. * to complete the operation.
  1112. * \li \c IXML_FAILED: The operation could not be completed.
  1113. */
  1114. EXPORT_SPEC int ixmlElement_setAttributeNS(
  1115. /*! [in] The \b Element on which to set the attribute. */
  1116. IXML_Element *element,
  1117. /*! [in] The namespace URI of the new attribute. */
  1118. const DOMString namespaceURI,
  1119. /*! [in] The qualified name of the attribute. */
  1120. const DOMString qualifiedName,
  1121. /*! [in] The new value for the attribute. */
  1122. const DOMString value);
  1123. /*!
  1124. * \brief Removes an attribute using the namespace URI and local name.
  1125. *
  1126. * The replacing attribute has the same namespace URI and local name, as well
  1127. * as the original prefix.
  1128. *
  1129. * \return An integer representing one of the following:
  1130. * \li \c IXML_SUCCESS: The operation completed successfully.
  1131. * \li \c IXML_INVALID_PARAMETER: Either \b element,
  1132. * \b namespaceURI, or \b localName is \c NULL.
  1133. */
  1134. EXPORT_SPEC int ixmlElement_removeAttributeNS(
  1135. /*! [in] The \b Element from which to remove the the attribute. */
  1136. IXML_Element *element,
  1137. /*! [in] The namespace URI of the attribute. */
  1138. const DOMString namespaceURI,
  1139. /*! [in] The local name of the attribute.*/
  1140. const DOMString localName);
  1141. /*!
  1142. * \brief Retrieves an \b Attr node by local name and namespace URI.
  1143. *
  1144. * \return A pointer to an \b Attribute node with the specified attribute
  1145. * local name and namespace URI or \c NULL if there is no such attribute.
  1146. */
  1147. EXPORT_SPEC IXML_Attr *ixmlElement_getAttributeNodeNS(
  1148. /*! [in] The \b Element from which to get the attribute. */
  1149. IXML_Element *element,
  1150. /*! [in] The namespace URI of the attribute. */
  1151. const DOMString namespaceURI,
  1152. /*! [in] The local name of the attribute. */
  1153. const DOMString localName);
  1154. /*!
  1155. * \brief Adds a new attribute node to the element node specified.
  1156. *
  1157. * If an attribute with the same local name and namespace URI already exists in
  1158. * the \b Element, the existing attribute node is replaced with \b newAttr and
  1159. * the old returned in \b rcAttr.
  1160. *
  1161. * \return The output parameter rcAttr receives the replaced attribute node if
  1162. * the newAttr attribute replaces an existing attribute with the same local name
  1163. * and namespace, otherwise rcAttr receives \b NULL.
  1164. *
  1165. * The function return value is an integer representing one of the following:
  1166. * \li \c IXML_SUCCESS: The operation completed successfully.
  1167. * \li \c IXML_INVALID_PARAMETER: Either \b element or
  1168. * \b newAttr is \c NULL.
  1169. * \li \c IXML_WRONG_DOCUMENT_ERR: \b newAttr does not belong
  1170. * to the same document as \b element.
  1171. * \li \c IXML_INUSE_ATTRIBUTE_ERR: \b newAttr already is an
  1172. * attribute of another \b Element.
  1173. */
  1174. EXPORT_SPEC int ixmlElement_setAttributeNodeNS(
  1175. /*! [in] The \b Element in which to add the attribute node. */
  1176. IXML_Element *element,
  1177. /*! [in] The new \b Attr to add. */
  1178. IXML_Attr *newAttr,
  1179. /*! [out] A pointer to the replaced \b Attr, if it exists. */
  1180. IXML_Attr **rcAttr);
  1181. /*!
  1182. * \brief Returns a \b NodeList of all \em descendant \b Elements with a
  1183. * given local name and namespace in the order in which they are encountered in
  1184. * the pre-order traversal of the \b Element tree.
  1185. *
  1186. * \return A \b NodeList of matching \b Elements or \c NULL on an error.
  1187. */
  1188. EXPORT_SPEC IXML_NodeList *ixmlElement_getElementsByTagNameNS(
  1189. /*! [in] The \b Element from which to start the search. */
  1190. IXML_Element *element,
  1191. /*! [in] The namespace URI of the \b Elements to find. The special value
  1192. * "*" matches all namespaces. */
  1193. const DOMString namespaceURI,
  1194. /*! [in] The local name of the \b Elements to find. The special value "*"
  1195. * matches all local names. */
  1196. const DOMString localName);
  1197. /*!
  1198. * \brief Queries whether the \b Element has an attribute with the given name
  1199. * or a default value.
  1200. *
  1201. * \return \c TRUE if the \b Element has an attribute with this name or has a
  1202. * default value for that attribute, otherwise \c FALSE.
  1203. */
  1204. EXPORT_SPEC BOOL ixmlElement_hasAttribute(
  1205. /*! [in] The \b Element on which to check for an attribute. */
  1206. IXML_Element *element,
  1207. /*! [in] The name of the attribute for which to check. */
  1208. const DOMString name);
  1209. /*!
  1210. * \brief Queries whether the \b Element has an attribute with the given
  1211. * local name and namespace URI or has a default value for that attribute.
  1212. *
  1213. * \return \c TRUE if the \b Element has an attribute with the given namespace
  1214. * and local name or has a default value for that attribute, otherwise \c FALSE.
  1215. */
  1216. EXPORT_SPEC BOOL ixmlElement_hasAttributeNS(
  1217. /*! [in] The \b Element on which to check for the attribute. */
  1218. IXML_Element *element,
  1219. /*! [in] The namespace URI of the attribute. */
  1220. const DOMString namespaceURI,
  1221. /*! [in] The local name of the attribute. */
  1222. const DOMString localName);
  1223. /*!
  1224. * \brief Frees the given \b Element and any subtree of the \b Element.
  1225. */
  1226. EXPORT_SPEC void ixmlElement_free(
  1227. /*! [in] The \b Element to free. */
  1228. IXML_Element *element);
  1229. /* @} Interface Element */
  1230. /*!
  1231. * \name Interface NamedNodeMap
  1232. *
  1233. * A \b NamedNodeMap object represents a list of objects that can be
  1234. * accessed by name. A \b NamedNodeMap maintains the objects in
  1235. * no particular order. The \b Node interface uses a \b NamedNodeMap
  1236. * to maintain the attributes of a node.
  1237. *
  1238. * @{
  1239. */
  1240. /*!
  1241. * \brief Returns the number of items contained in this \b NamedNodeMap.
  1242. *
  1243. * \return The number of nodes in this map.
  1244. */
  1245. EXPORT_SPEC unsigned long ixmlNamedNodeMap_getLength(
  1246. /*! [in] The \b NamedNodeMap from which to retrieve the size. */
  1247. IXML_NamedNodeMap *nnMap);
  1248. /*!
  1249. * \brief Retrieves a \b Node from the \b NamedNodeMap by name.
  1250. *
  1251. * \return A Node with the specified nodeName, or \b NULL if it
  1252. * does not identify any node in this map.
  1253. */
  1254. EXPORT_SPEC IXML_Node *ixmlNamedNodeMap_getNamedItem(
  1255. /*! [in] The \b NamedNodeMap to search. */
  1256. IXML_NamedNodeMap *nnMap,
  1257. /*! [in] The name of the \b Node to find. */
  1258. const DOMString name);
  1259. /*!
  1260. * \brief Adds a new \b Node to the \b NamedNodeMap using the \b Node name
  1261. * attribute.
  1262. *
  1263. * \return The old \b Node if the new \b Node replaces it or \c NULL if the
  1264. * \b Node was not in the \b NamedNodeMap before.
  1265. */
  1266. EXPORT_SPEC IXML_Node *ixmlNamedNodeMap_setNamedItem(
  1267. /*! The \b NamedNodeMap in which to add the new \b Node. */
  1268. IXML_NamedNodeMap *nnMap,
  1269. /*! The new \b Node to add to the \b NamedNodeMap. */
  1270. IXML_Node *arg);
  1271. /*!
  1272. * \brief Removes a \b Node from a \b NamedNodeMap specified by name.
  1273. *
  1274. * \return A pointer to the \b Node, if found, or \c NULL if it wasn't.
  1275. */
  1276. EXPORT_SPEC IXML_Node *ixmlNamedNodeMap_removeNamedItem(
  1277. /*! The \b NamedNodeMap from which to remove the item. */
  1278. IXML_NamedNodeMap *nnMap,
  1279. /*! The name of the item to remove. */
  1280. const DOMString name);
  1281. /*!
  1282. * \brief Retrieves the indexth item in the map. If index is greater than or
  1283. * equal to the number of nodes in this map, this returns \b NULL.
  1284. *
  1285. * \return The node at the indexth position in the map, or \b NULL if that is
  1286. * not a valid index.
  1287. */
  1288. EXPORT_SPEC IXML_Node *ixmlNamedNodeMap_item(
  1289. /*! [in] The \b NamedNodeMap from which to remove the \b Node. */
  1290. IXML_NamedNodeMap *nnMap,
  1291. /*! [in] The index into the map to remove. */
  1292. unsigned long index);
  1293. /*
  1294. * Introduced in DOM level 2
  1295. */
  1296. /*!
  1297. * \brief Retrieves a \b Node from a \b NamedNodeMap specified by namespace
  1298. * URI and local name.
  1299. *
  1300. * \return A pointer to the \b Node, if found, or \c NULL if it wasn't
  1301. */
  1302. EXPORT_SPEC IXML_Node *ixmlNamedNodeMap_getNamedItemNS(
  1303. /*! The \b NamedNodeMap from which to remove the \b Node. */
  1304. IXML_NamedNodeMap *nnMap,
  1305. /*! The namespace URI of the \b Node to remove. */
  1306. const DOMString *namespaceURI,
  1307. /*! The local name of the \b Node to remove. */
  1308. const DOMString localName);
  1309. /*!
  1310. * \brief Adds a new \b Node to the \b NamedNodeMap using the \b Node
  1311. * local name and namespace URI attributes.
  1312. *
  1313. * \return The old \b Node if the new \b Node replaces it or \c NULL if the
  1314. * \b Node was not in the \b NamedNodeMap before.
  1315. */
  1316. EXPORT_SPEC IXML_Node *ixmlNamedNodeMap_setNamedItemNS(
  1317. /*! The \b NamedNodeMap in which to add the \b Node. */
  1318. IXML_NamedNodeMap *nnMap,
  1319. /*! The \b Node to add to the map. */
  1320. IXML_Node *arg);
  1321. /*!
  1322. * \brief Removes a \b Node from a \b NamedNodeMap specified by
  1323. * namespace URI and local name.
  1324. *
  1325. * \return A pointer to the \b Node, if found, or \c NULL if it wasn't.
  1326. */
  1327. EXPORT_SPEC IXML_Node *ixmlNamedNodeMap_removeNamedItemNS(
  1328. /*! The \b NamedNodeMap from which to remove the \b Node. */
  1329. IXML_NamedNodeMap *nnMap,
  1330. /*! The namespace URI of the \b Node to remove. */
  1331. const DOMString namespaceURI,
  1332. /*! The local name of the \b Node to remove. */
  1333. const DOMString localName);
  1334. /*! \brief Frees a \b NamedNodeMap.
  1335. *
  1336. * The \b Nodes inside the map are not freed, just the \b NamedNodeMap object.
  1337. */
  1338. EXPORT_SPEC void ixmlNamedNodeMap_free(
  1339. /*! [in] The \b NamedNodeMap to free. */
  1340. IXML_NamedNodeMap *nnMap);
  1341. /* @} Interface NodeMap */
  1342. /*!
  1343. * \name Interface NodeList
  1344. *
  1345. * The \b NodeList interface abstracts an ordered collection of
  1346. * nodes. Note that changes to the underlying nodes will change
  1347. * the nodes contained in a \b NodeList. The DOM2-Core refers to
  1348. * this as being \em live.
  1349. *
  1350. * @{
  1351. */
  1352. /*!
  1353. * \brief Retrieves a \b Node from a \b NodeList specified by a
  1354. * numerical index.
  1355. *
  1356. * \return A pointer to a \b Node or \c NULL if there was an error.
  1357. */
  1358. EXPORT_SPEC IXML_Node *ixmlNodeList_item(
  1359. /*! [in] The \b NodeList from which to retrieve the \b Node. */
  1360. IXML_NodeList *nList,
  1361. /*! [in] The index into the \b NodeList to retrieve. */
  1362. unsigned long index);
  1363. /*!
  1364. * \brief Returns the number of \b Nodes in a \b NodeList.
  1365. *
  1366. * \return The number of \b Nodes in the \b NodeList.
  1367. */
  1368. EXPORT_SPEC unsigned long ixmlNodeList_length(
  1369. /*! [in] The \b NodeList for which to retrieve the number of \b Nodes. */
  1370. IXML_NodeList *nList);
  1371. /*!
  1372. * \brief Frees a \b NodeList object.
  1373. *
  1374. * Since the underlying \b Nodes are references, they are not freed using this
  1375. * operation. This only frees the \b NodeList object.
  1376. */
  1377. EXPORT_SPEC void ixmlNodeList_free(
  1378. /*! [in] The \b NodeList to free. */
  1379. IXML_NodeList *nList);
  1380. /* @} Interface NodeList */
  1381. /*!
  1382. * \name IXML API
  1383. *
  1384. * The IXML API contains utility functions that are not part of the standard
  1385. * DOM interfaces. They include functions to create a DOM structure from a
  1386. * file or buffer, create an XML file from a DOM structure, and manipulate
  1387. * DOMString objects.
  1388. *
  1389. * @{
  1390. */
  1391. /*!
  1392. * \brief Renders a \b Node and all sub-elements into an XML document
  1393. * representation.
  1394. *
  1395. * The caller is required to free the \b DOMString
  1396. * returned from this function using \b ixmlFreeDOMString when it
  1397. * is no longer required.
  1398. *
  1399. * Note that this function can be used for any \b Node-derived
  1400. * interface. The difference between \b ixmlPrintDocument and
  1401. * \b ixmlPrintNode is \b ixmlPrintDocument includes the XML prolog
  1402. * while \b ixmlPrintNode only produces XML elements. An XML
  1403. * document is not well formed unless it includes the prolog
  1404. * and at least one element.
  1405. *
  1406. * This function introduces lots of white space to print the
  1407. * \b DOMString in readable format.
  1408. *
  1409. * \return A \b DOMString with the XML document representation
  1410. * of the DOM tree or \c NULL on an error.
  1411. */
  1412. EXPORT_SPEC DOMString ixmlPrintDocument(
  1413. /*! [in] The document node to print. */
  1414. IXML_Document *doc);
  1415. /*!
  1416. * \brief Renders a \b Node and all sub-elements into an XML text
  1417. * representation.
  1418. *
  1419. * The caller is required to free the \b DOMString
  1420. * returned from this function using \b ixmlFreeDOMString when it
  1421. * is no longer required.
  1422. *
  1423. * Note that this function can be used for any \b Node-derived
  1424. * interface. A similar \b ixmlPrintDocument function is defined
  1425. * to avoid casting when printing whole documents. This function
  1426. * introduces lots of white space to print the \b DOMString in readable
  1427. * format.
  1428. *
  1429. * \return A \b DOMString with the XML text representation of the DOM tree or
  1430. * \c NULL on an error.
  1431. */
  1432. EXPORT_SPEC DOMString ixmlPrintNode(
  1433. /*! [in] The root of the \b Node tree to render to XML text. */
  1434. IXML_Node *doc
  1435. );
  1436. /*!
  1437. * \brief Renders a \b Node and all sub-elements into an XML document
  1438. * representation.
  1439. *
  1440. * The caller is required to free the \b DOMString
  1441. * returned from this function using \b ixmlFreeDOMString when it
  1442. * is no longer required.
  1443. *
  1444. * Note that this function can be used for any \b Node-derived
  1445. * interface. The difference between \b ixmlDocumenttoString and
  1446. * \b ixmlNodetoString is \b ixmlDocumenttoString includes the XML
  1447. * prolog while \b ixmlNodetoString only produces XML elements. An XML
  1448. * document is not well formed unless it includes the prolog
  1449. * and at least one element.
  1450. *
  1451. * \return A \b DOMString with the XML text representation of the DOM tree or
  1452. * \c NULL on an error.
  1453. */
  1454. EXPORT_SPEC DOMString ixmlDocumenttoString(
  1455. /*! [in] The root of the \b Node tree to render to XML text. */
  1456. IXML_Document *doc);
  1457. /*!
  1458. * \brief Renders a \b Node and all sub-elements into an XML text
  1459. * representation. The caller is required to free the \b DOMString
  1460. * returned from this function using \b ixmlFreeDOMString when it
  1461. * is no longer required.
  1462. *
  1463. * Note that this function can be used for any \b Node-derived
  1464. * interface. The difference between \b ixmlNodetoString and
  1465. * \b ixmlDocumenttoString is \b ixmlNodetoString does not include
  1466. * the XML prolog, it only produces XML elements.
  1467. *
  1468. * \return A \b DOMString with the XML text representation of the DOM tree or
  1469. * \c NULL on an error.
  1470. */
  1471. EXPORT_SPEC DOMString ixmlNodetoString(
  1472. /*! [in] The root of the \b Node tree to render to XML text. */
  1473. IXML_Node *doc);
  1474. /*!
  1475. * \brief Makes the XML parser more tolerant to malformed text.
  1476. */
  1477. EXPORT_SPEC void ixmlRelaxParser(
  1478. /*! [in] If \b errorChar is 0 (default), the parser is strict about XML
  1479. * encoding : invalid UTF-8 sequences or "&" entities are rejected, and
  1480. * the parsing aborts.
  1481. *
  1482. * If \b errorChar is not 0, the parser is relaxed: invalid UTF-8
  1483. * characters are replaced by the \b errorChar, and invalid "&" entities
  1484. * are left untranslated. The parsing is then allowed to continue.
  1485. */
  1486. char errorChar);
  1487. /*!
  1488. * \brief Parses an XML text buffer converting it into an IXML DOM representation.
  1489. *
  1490. * \return A \b Document if the buffer correctly parses or \c NULL on an error.
  1491. */
  1492. EXPORT_SPEC IXML_Document *ixmlParseBuffer(
  1493. /*! [in] The buffer that contains the XML text to convert to a \b Document. */
  1494. const char *buffer);
  1495. /*!
  1496. * \brief Parses an XML text buffer converting it into an IXML DOM representation.
  1497. *
  1498. * The \b ixmlParseBufferEx API differs from the \b ixmlParseBuffer
  1499. * API in that it returns an error code representing the actual failure
  1500. * rather than just \c NULL.
  1501. *
  1502. * \return An integer representing one of the following:
  1503. * \li \c IXML_SUCCESS: The operation completed successfully.
  1504. * \li \c IXML_INVALID_PARAMETER: The \b buffer is not a valid
  1505. * pointer.
  1506. * \li \c IXML_INSUFFICIENT_MEMORY: Not enough free memory exists
  1507. * to complete this operation.
  1508. */
  1509. EXPORT_SPEC int ixmlParseBufferEx(
  1510. /*! [in] The buffer that contains the XML text to convert to a \b Document. */
  1511. const char *buffer,
  1512. /*! [out] A point to store the \b Document if file correctly parses or \b NULL on an error. */
  1513. IXML_Document** doc);
  1514. /*!
  1515. * \brief Parses an XML text file converting it into an IXML DOM representation.
  1516. *
  1517. * \return A \b Document if the file correctly parses or \c NULL on an error.
  1518. */
  1519. EXPORT_SPEC IXML_Document *ixmlLoadDocument(
  1520. /*! [in] The filename of the XML text to convert to a \b Document. */
  1521. const char* xmlFile);
  1522. /*!
  1523. * \brief Parses an XML text file converting it into an IXML DOM representation.
  1524. *
  1525. * The \b ixmlLoadDocumentEx API differs from the \b ixmlLoadDocument
  1526. * API in that it returns a an error code representing the actual failure
  1527. * rather than just \c NULL.
  1528. *
  1529. * \return An integer representing one of the following:
  1530. * \li \c IXML_SUCCESS: The operation completed successfully.
  1531. * \li \c IXML_INVALID_PARAMETER: The \b xmlFile is not a valid
  1532. * pointer.
  1533. * \li \c IXML_INSUFFICIENT_MEMORY: Not enough free memory exists
  1534. * to complete this operation.
  1535. */
  1536. EXPORT_SPEC int ixmlLoadDocumentEx(
  1537. /*! [in] The filename of the XML text to convert to a \b Document. */
  1538. const char *xmlFile,
  1539. /*! [out] A pointer to the \b Document if file correctly parses or \b NULL
  1540. * on an error. */
  1541. IXML_Document **doc);
  1542. /*!
  1543. * \brief Clones an existing \b DOMString.
  1544. *
  1545. * \return A new \b DOMString that is a duplicate of the original or \c NULL
  1546. * if the operation could not be completed.
  1547. */
  1548. EXPORT_SPEC DOMString ixmlCloneDOMString(
  1549. /*! [in] The source \b DOMString to clone. */
  1550. const DOMString src);
  1551. /*!
  1552. * \brief Frees a \b DOMString.
  1553. */
  1554. EXPORT_SPEC void ixmlFreeDOMString(
  1555. /*! [in] The \b DOMString to free. */
  1556. DOMString buf);
  1557. /* @} IXML API */
  1558. #ifdef __cplusplus
  1559. }
  1560. #endif
  1561. /* @} XMLAPI XML API */
  1562. #endif /* IXML_H */