> For the complete documentation index, see [llms.txt](https://sandbox-docs.verifone.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sandbox-docs.verifone.com/adk-5.0-programmers-guide/xmldoc_8h_source.md).

# xmldoc.h

[Go to the documentation of this file.](/adk-5.0-programmers-guide/readme/files/dir_44d926a17fc606d3c25449ba60427c63/dir_048f823fee1bfb22502a8732b9a001aa/xmldoc_8h.md)

```cpp
 1 #ifndef XML_DOC_H
 2 #define XML_DOC_H
 3 
 4 #ifndef _SLIM_VERSION
 5 
 8 #include <stddef.h>
 9 #include <stdio.h>
 10 #include <stdlib.h>
 11 
 12 #if defined _ARTEMA
 13  #include "posix/posix.h"
 14 #endif
 15 
 16 #ifdef __cplusplus
 17 extern "C" {
 18 #endif
 19 
 20 enum XMLTokenizer__Encoding
 21 {
 22  XMLTokenizer__UTF8, XMLTokenizer__ISOLATIN1, XMLTokenizer__ISOLATIN9
 23 };
 24 
 26 enum XMLTokenizer__Token
 27 {
 28  XMLTokenizer__DONE,
 29  XMLTokenizer__TEXT,
 30  XMLTokenizer__START_NODE,
 31  XMLTokenizer__STOP_NODE,
 32  XMLTokenizer__EMPTY_NODE,
 33  XMLTokenizer__NODE_DONE,
 34  XMLTokenizer__ATTRIBUTE,
 35  XMLTokenizer__SYNTAX_ERROR
 36 };
 37 
 39 struct XMLTokenizer
 40 {
 41 
 42  char *buffer;
 43  int inside_node;
 44 
 45  char bn;
 46  char bv;
 47 
 48  enum XMLTokenizer__Encoding encoding;
 49  char *name;
 50  ptrdiff_t name_len;
 51  char *value;
 52  ptrdiff_t value_len;
 53 
 54  char *(*fill)(void *fill_data);
 55  void *fill_data;
 56 };
 57 
 58 enum XMLTokenizer__Encoding XMLTokenizer__readHeader(struct XMLTokenizer *_this);
 59 enum XMLTokenizer__Token XMLTokenizer__readToken(struct XMLTokenizer *_this);
 60 void XMLTokenizer__Constructor(struct XMLTokenizer *_this);
 61 void XMLTokenizer__Destructor(struct XMLTokenizer *_this);
 62 
 63 void XMLTokenizer__init(struct XMLTokenizer *_this, char *buffer, char * (*fill)(void *fill_data), void *fill_data);
 64 enum XMLTokenizer__Token XMLTokenizer__nextToken(struct XMLTokenizer *_this);
 65 
 67 enum XMLNode__NodeType
 68 {
 69  XMLNode__ROOT,
 70  XMLNode__NODE,
 71  XMLNode__ATTRIBUTE,
 72  XMLNode__VALUE,
 73  XMLNode__ANY
 74 };
 75 
 76 enum XMLNode__CloneMode
 77 {
 78  XMLNode__CLONE_ALL, XMLNode__CLONE_ATTRIBUTE
 79 };
 80 
 85 struct XMLNode
 86 {
 87  char *name;
 88  char *value;
 89  struct XMLNode *content;
 90  struct XMLNode *next;
 91 };
 92 
 93 int XMLNode__Constructor(struct XMLNode *_this, const char *_name, const char *_value);
 94 int XMLNode__Constructor2(struct XMLNode *_this, const char *_name, const char *_value,
 95  enum XMLTokenizer__Encoding source_encoding);
 96 struct XMLNode *XMLNode__Create(const char *_name, const char *_value);
 97 struct XMLNode *XMLNode__Create2(const char *_name, const char *_value,
 98  enum XMLTokenizer__Encoding source_encoding);
 99 void XMLNode__Destructor(struct XMLNode *_this);
 100 void XMLNode__Destroy(struct XMLNode *_this);
 101 
 102 int XMLNode__parse(struct XMLNode *_this, const char *name, struct XMLTokenizer *t);
 103 
 104 int XMLNode__write(struct XMLNode *_this, char *buffer, int size, int level, enum XMLTokenizer__Encoding dest_encoding);
 105 
 106 void XMLNode__addToContent(struct XMLNode *_this, struct XMLNode *node);
 107 
 108 void XMLNode__dump(struct XMLNode *_this, FILE *, int level);
 109 
 110 struct XMLNode *XMLNode__findNode(struct XMLNode *_this, const char *name);
 111 
 112 void XMLNode__insertNode(struct XMLNode *_this, const char *name, struct XMLNode *node);
 113 
 114 enum XMLNode__NodeType XMLNode__type(const struct XMLNode *_this);
 115 
 116 const char *XMLNode__getName(const struct XMLNode *_this);
 117 
 118 const char *XMLNode__getValue(const struct XMLNode *_this);
 119 
 120 void XMLNode__setName(struct XMLNode *_this, const char *_name);
 121 
 122 void XMLNode__setValue(struct XMLNode *_this, const char *_value);
 123 
 124 struct XMLNode *XMLNode__clone(const struct XMLNode *_this, enum XMLNode__CloneMode cm, int clone_successor);
 125 
 126 void XMLNode__swap(struct XMLNode *_this, struct XMLNode *other);
 127 
 128 void XMLNode__reorderContent(struct XMLNode *_this, const char *reference[]);
 129 
 130 
 131 
 133 struct XMLDocument
 134 {
 135  struct XMLNode *root;
 136  enum XMLTokenizer__Encoding encoding;
 137 };
 138 
 139 
 140 void XMLDocument__Constructor(struct XMLDocument *_this, enum XMLTokenizer__Encoding enc);
 141 void XMLDocument__CopyConstructor(struct XMLDocument *_this, const struct XMLDocument *o);
 142 struct XMLDocument *XMLDocument__Assign(struct XMLDocument *_this, const struct XMLDocument *o);
 143 
 144 void XMLDocument__Destructor(struct XMLDocument *_this);
 145 
 146 void XMLDocument__clear(struct XMLDocument *_this);
 147 
 148 int XMLDocument__read(struct XMLDocument *_this, char *);
 149 int XMLDocument__write(const struct XMLDocument *_this, char *, int size);
 150 void XMLDocument__dump(struct XMLDocument *_this, FILE *);
 151 
 152 struct XMLNode *XMLDocument__findNode(struct XMLDocument *_this, const char *name);
 153 void XMLDocument__insertNode(struct XMLDocument *_this, const char *name, struct XMLNode *node);
 154 
 155 void XMLDocument__removeNode(struct XMLDocument *_this, const char *name);
 156 
 157 #ifdef __cplusplus
 158 }
 159 #endif
 160 
 161 #endif // _SLIM_VERSION
 162 
 163 #endif
 164 
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://sandbox-docs.verifone.com/adk-5.0-programmers-guide/xmldoc_8h_source.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
