// =====================================
// I N D E X
// =====================================
XML_ChildNode()
XML_CopyNode()
XML_Create()
XML_CreateNode()
XML_DeleteNode()
XML_ExamineAttributes()
XML_Format()
XML_Free()
XML_GetAttribute()
XML_GetEncoding()
XML_GetNodeName()
XML_GetNodeOffset()
XML_GetNodeText()
XML_GetStandalone()
XML_IsXML()
XML_Load()
XML_MainNode()
XML_MoveNode()
XML_NextAttribute()
XML_NextNode()
XML_ParentNode()
XML_PreviousNode()
XML_RemoveAttribute()
XML_ResolveAttributeName()
XML_ResolveNodeName()
XML_RootNode()
XML_Save()
XML_SetAttribute()
XML_SetEncoding()
XML_SetNodeName()
XML_SetNodeOffset()
XML_SetNodeText()
XML_SetStandalone()
XML_AttributeName()
XML_AttributeValue()
XML_ChildCount()
XML_Error()
XML_ErrorLine()
XML_ErrorPosition()
XML_NodeFromID()
XML_NodeFromPath()
XML_NodePath()
XML_NodeType()
XML_Status()
XML_GetVersion()
// =====================================
// D O C U M E N T A T I O N
// =====================================
Function XML_ChildNode(Node, Index: Integer): Integer;SyntaxResult := XML_ChildNode(Node, Index);DescriptionReturns a pointer to a child node of the given XML node.
Index specifies the one based index of the node to return.
Return valueReturns the node pointer for the requested child node or 0 if there are no children or index is too high.
// [Index] =======================================================================================
Function XML_CopyNode(Node, ParentNode, PreviousNode: Integer): Integer;SyntaxResult := XML_CopyNode(Node, ParentNode, PreviousNode);DescriptionCopies the given XML node and all its contained text and children to a new location. This function can even be used to copy nodes into a different XML tree. For moving a complete node to a new location
XML_MoveNode() can be used.
ParametersNode specifies the node to copy.
ParentNode is the node into which to insert the new node. To insert the new node at the root of the tree,
XML_RootNode() can be used here.
PreviousNode specifies a childnode of
ParentNode after which the new node should be inserted. If this value is 0, the new node is inserted as the first child of its parent. If this value is -1, the node is inserted as the last child of its parent.
The following rules must be followed for a successful copying:
- The root node of a tree cannot be copied
-
ParentNode may not be of type
XML_Comment or
XML_CData-
PreviousNode must be a direct child of
ParentNode- If the XML tree already has a main node, only nodes other than
XML_Normal and
XML_CData can be inserted at the root level
Return valueReturns the pointer to the new XML node if it was copied successfully or 0 if copying was not possible.
// [Index] =======================================================================================
Function XML_Create(XML, Encoding: Integer): Integer;SyntaxResult := XML_Create(XML, Encoding);DescriptionCreates a new empty XML tree identified by the
XML number. If
XML_Any is used as
XML parameter, the new
XML tree number will be returned as "Result".
Encoding specifies the encoding to use for the tree. Valid values are
XML_Ascii,
XML_Unicode or
XML_UTF8.
The new tree will only have a root node which can be accessed with
XML_RootNode(). To add new nodes,
XML_CreateNode() can be used.
Example // Create XML tree
XML := XML_Create(XML_Any);
MainNode := XML_CreateNode(XML_RootNode(XML));
XML_SetNodeName(mainNode, 'Settings');
// Create first XML node (in main node)
Item := XML_CreateNode(mainNode);
XML_SetNodeName(Item, 'Bot');
XML_SetAttribute(Item, 'id', '1');
XML_SetNodeText(Item, 'Admiral');
// Create second XML node (in main node)
Item := CreateXMLNode(mainNode);
XML_SetNodeName(Item, 'Bot');
XML_SetAttribute(Item, 'id', '2');
XML_SetNodeText(Item, 'Danko');
// Save the XML tree into a XML file
XML_Save(XML, 'settings.xml');
// [Index] =======================================================================================
Function XML_CreateNode(ParentNode, PreviousNode, TType: Integer): Integer;SyntaxResult := XML_CreateNode(ParentNode, PreviousNode, TType);DescriptionCreates a new XML node and inserts it into the given parent node.
ParametersParentNode is the node into which to insert the new node. To insert the new node at the root of the tree,
XML_RootNode() can be used here.
PreviousNode specifies a childnode of
ParentNode after which the new node should be inserted. If this value is 0, the new node is inserted as the first child of its parent. If this value is -1, the node is inserted as the last child of its parent.
TType specifies the type for the new node. The default is
XML_Normal. Note that the node type cannot be changed after the node was created.
The following rules must be followed for a successful insertion:
-
ParentNode may not be of type
XML_Comment or
XML_CData-
PreviousNode must be a direct child of
ParentNode- A node of type
XML_Root cannot be created manually
- If the XML tree already has a main node, only nodes other than
XML_Normal and
XML_CData can be inserted at the root level
Return valueReturns the pointer to the new XML node if it was created successfully or 0 if no node could be inserted at this point.
// [Index] =======================================================================================
Procedure XML_DeleteNode(Node: Integer);SyntaxXML_DeleteNode(Node);DescriptionDeletes the given XML node and all its contained text and children from its XML tree.
Note: the root node of a tree cannot be deleted.
// [Index] =======================================================================================
Function XML_ExamineAttributes(Node: Integer): Integer;SyntaxResult := XML_ExamineAttributes(Node);DescriptionStarts to examine the attributes of the given XML node.
Return valueReturns nonzero if the node is of type
XML_Normal and zero else (as such nodes cannot have attributes).
// [Index] =======================================================================================
Procedure XML_Format(XML, Flags, IndentStep: Integer);SyntaxXML_Format(XML, Flags, IndentStep);DescriptionCleans up or reformats the XML tree for a better look when saving. It can be used to have a very compact output for efficient transfer or a more formatted output for better reading.
The formatting of the parsed XML document is stored in the "text" and "offset" fields of each node in the tree (see
XML_GetNodeText() and
XML_GetNodeOffset() for more information).
ParametersFlags can be a combination of the following values (with the
Or operator):
XML_WindowsNewline: Changes all newline to CRLF
XML_LinuxNewline : Changes all newline to LF
XML_MacNewline : Changes all newline to CR
XML_CutNewline : Removes all newline
XML_ReduceNewline : Removes all empty lines
XML_CutSpace : Removes all spaces
XML_ReduceSpace : Removes all multiple spaces
XML_ReFormat : Completely reformats the tree structure
XML_ReIndent : Changes the indentation of the lines
For
XML_ReFormat and
XML_ReIndent the
IndentStep parameter specifies how many spaces of indentation to add for each level.
Note: There is no reformatting in CData sections and Processing Instructions except for the newline changes, as the whitespace contained inside these sections may be important depending on what is contained in the section.
// [Index] =======================================================================================
Procedure XML_Free(XML: Integer);SyntaxXML_Free(XML);DescriptionFrees the XML object and all data it contains.
ParametersXML : The XML object to free. If
XML_All is specified, all the remaining XML objects are freed.
// [Index] =======================================================================================
Function XML_GetAttribute(Node: Integer; Attribute: PChar): PChar;SyntaxResult := XML_GetAttribute(Node, Attribute);DescriptionReturns the value of an attribute in the given XML node. If the attribute does not exist an empty string is returned.
Only nodes of type
XML_Normal can have attributes. For all other node types the compiler raises an error.
// [Index] =======================================================================================
Function XML_GetEncoding(XML: Integer): Integer;SyntaxResult := XML_GetEncoding(XML);DescriptionReturns the text encoding used for saving the given XML tree.
Return valueReturns either
XML_Ascii,
XML_Unicode (= UTF16) or
XML_UTF8.
// [Index] =======================================================================================
Function XML_GetNodeName(Node: Integer): PChar;SyntaxResult := XML_GetNodeName(Node);DescriptionReturns the tagname of the given XML node. If the node is not of type
XML_Normal or
XML_Instruction, an empty string is returned.
// [Index] =======================================================================================
Function XML_GetNodeOffset(Node: Integer): Integer;SyntaxResult := XML_GetNodeOffset(Node);DescriptionReturns the character offset of this
Node within its parent.
The returned value represents the number of characters in the parent nodes text data that lie between this node and the previous child node. So if this node directly follows the previous one, this value will be 0.
// [Index] =======================================================================================
Function XML_GetNodeText(Node: Integer): PChar;SyntaxResult := XML_GetNodeText(Node);DescriptionReturns the text inside the given XML node.
For a node of type
XML_Normal, this is all text and whitespace within the node that is not contained within a child node.
For the root node, this is all whitespace outside of the main node (there can be no text outside of the main node).
For
XML_Comment or
XML_CData nodes, this is all text contained in the node.
// [Index] =======================================================================================
Function XML_GetStandalone(XML: Integer): Integer;SyntaxResult := XML_GetStandalone(XML);DescriptionReturns the value of the "standalone" attribute in the XML declaration of the document.
Return valueReturns one of the following values:
XML_StandaloneYes : The document mode is standalone
XML_StandaloneNo : The document mode is not standalone
XML_StandaloneUnset: The standalone mode is not specified in the declaration
// [Index] =======================================================================================
Function XML_IsXML(XML: Integer): Integer;SyntaxResult := XML_IsXML(XML);DescriptionReturns nonzero if XML refers to an existing XML tree.
// [Index] =======================================================================================
Function XML_Load(XML: Integer; Filename: PChar; Encoding: Integer): Integer;SyntaxResult := XML_Load(XML, Filename, Encoding);DescriptionLoads a XML tree from the given file. The tree can later be accessed trough the
XML value. If
XML_Any is used as
XML parameter, the new XML tree number will be returned as "Result".
Encoding parameter can be used to force the parser to use a specific encoding. (This overwrites the encoding set in the XML declaration!) Possible values are
XML_Ascii,
XML_Unicode or
XML_UTF8. This parameter should be used when the document does not have an XML declaration, or the encoding information is provided outside of the XML document, for example through a mime type header in a communication protocol.
If
XML_Any is used as
Encoding parameter, parser will use the encoding set in the XML declaration.
Return valueReturns nonzero if the file could be opened and read. Note that this does not mean that the XML contained in the file was valid. To check for parser errors
XML_Status() should be used. In case of a parsing error, all data parsed before the error is accessible in the XML tree.
// [Index] =======================================================================================
Function XML_MainNode(XML: Integer): Integer;SyntaxResult := XML_MainNode(XML);DescriptionReturns the main XML node of the tree. A valid XML document must have one "main" or "document" node which contains all other nodes. Other than this node, there can only be comments on the first level below the root node. The type of this node is
XML_Normal.
Return valueReturns a pointer to the main node, or 0 if the tree has no main node (which happens if the tree is empty or the main node was deleted).
// [Index] =======================================================================================
Function XML_MoveNode(Node, ParentNode, PreviousNode: Integer): Integer;SyntaxResult := XML_MoveNode(Node, ParentNode, PreviousNode);DescriptionMoves the given XML node and all its contained text and children to a new location. This function can even be used to move nodes into a different XML tree. For copying a complete node to a new location
XML_CopyNode() can be used.
ParametersNode specifies the node to move.
ParentNode is the node into which to insert the node. To insert the node at the root of the tree,
XML_RootNode() can be used here.
PreviousNode specifies a childnode of
ParentNode after which the node should be inserted. If this value is 0, the node is inserted as the first child of its parent. If this value is -1, the node is inserted as the last child of its parent.
The following rules must be followed for a successful move:
- The root node of a tree cannot be moved
-
ParentNode may not be of type
XML_Comment or
XML_CData-
PreviousNode must be a direct child of
ParentNode-
Node and
PreviousNode cannot be equal
-
ParentNode cannot be equal to, or a child of
Node (a node cannot be moved into itself)
- If the XML tree already has a main node, only nodes other than
XML_Normal and
XML_CData can be inserted at the root level
Return valueReturns nonzero if the move was successful or zero if the node could not be moved.
// [Index] =======================================================================================
Function XML_NextAttribute(Node: Integer): Integer;SyntaxResult := XML_NextAttribute(Node);DescriptionThis function must be called after
XML_ExamineAttributes() to move step by step through the attributes of the given XML node.
Return valueReturns zero if there are no more attributes or nonzero if there still is one.
// [Index] =======================================================================================
Function XML_NextNode(Node: Integer): Integer;SyntaxResult := XML_NextNode(Node);DescriptionReturns the next XML node after the given one (inside their parent node).
Return valueReturns the node pointer to the next node or 0 if there are no more nodes after the given one.
// [Index] =======================================================================================
Function XML_ParentNode(Node: Integer): Integer;SyntaxResult := XML_ParentNode(Node);DescriptionReturns the parent node of the given XML node. Every XML node has a parent, except the root node.
Return valueReturns the parent node pointer or 0 if
Node was the root node.
// [Index] =======================================================================================
Function XML_PreviousNode(Node: Integer): Integer;SyntaxResult := XML_PreviousNode(Node);DescriptionReturns the previous XML node from the given one (inside their parent node).
Return valueReturns the node pointer to the previous node or 0 if the given node was the first child of its parent.
// [Index] =======================================================================================
Procedure XML_RemoveAttribute(Node: Integer; Attribute: PChar);SyntaxXML_RemoveAttribute(Node, Attribute);DescriptionRemoves the attribute from the given XML node.
Only nodes of type
XML_Normal can have attributes. For all other node types this function is ignored.
// [Index] =======================================================================================
Function XML_ResolveAttributeName(Node: Integer; Attribute, Separator: PChar): PChar;SyntaxResult := XML_ResolveAttributeName(Node, Attribute, Separator);DescriptionReturns the expanded name of the given node's attribute in a document that uses XML namespaces. The expanded name consists of the namespace URI (if any) and the local attribute name, separated by the separator character given in
Separator.
Note: Unlike with node names, the default namespace is not applied to attribute names that do not have a namespace prefix. So attribute names without a namespace prefix simply get their local name returned.
Return valueIn a document using namespaces, returns the expanded name of the attribute if it could be correctly resolved or an empty string if a namespace prefix is used that is never declared (which is invalid).
In a document without namespaces, returns the attribute name itself.
// [Index] =======================================================================================
Function XML_ResolveNodeName(Node: Integer; Separator: PChar): PChar;SyntaxResult := XML_ResolveNodeName(Node, Separator);DescriptionReturns the expanded name of the given node in a document that uses XML namespaces. The expanded name consists of the namespace URI (if any) and the local node name, separated by the separator character given in
Separator.
Return valueIn a document using namespaces, returns the expanded name of the node if it could be correctly resolved or an empty string if a namespace prefix is used that is never declared (which is invalid).
In a document without namespaces, returns the node name itself.
// [Index] =======================================================================================
Function XML_RootNode(XML: Integer): Integer;SyntaxResult := XML_RootNode(XML);DescriptionReturns a pointer to the root node of the XML tree. This node is always present. It represents the XML document itself. The text contained in this node represents the whitespace outside of any XML node (there can be no text outside of nodes). The children of this node are the main node and any comments outside the main node. The type of this node is
XML_Root.
Return valueAlways returns a valid XML node pointer if
XML is an existing XML tree.
// [Index] =======================================================================================
Function XML_Save(XML: Integer; Filename: PChar; Flags: Integer): Integer;SyntaxResult := XML_Save(XML, Filename, Flags);DescriptionSaves the
XML tree to the given file.
The created XML markup is not reformatted. It is written back as it was initially parsed/created. The amount of newline/whitespace written between the tags is stored in the "text" of each XML node. (see
XML_GetNodeText() for more information) To reformat the XML markup before saving, the "text" for each XML node can be altered or
XML_Format() can be used to apply some common reformatting options to the tree.
ParametersFlags can be a combination of the following values (with the
Or operator):
XML_StringFormat : Includes a byte order mark (BOM).
XML_NoDeclaration: Does not include the XML declaration.
Note: According to the XML specification, the XML declaration can only be omitted if the document is encoded in UTF-8 or UTF-16 or if the encoding information is provided externally through a transfer protocol for example. Even then, it is advised to keep the declaration in the document.
Return valueReturns nonzero if the file was successfully saved and zero otherwise.
// [Index] =======================================================================================
Procedure XML_SetAttribute(Node: Integer; Attribute, Value: PChar);SyntaxXML_SetAttribute(Node, Attribute, Value);DescriptionSets the value of the attribute on the given XML node. If the attribute does not exist yet, it will be added.
Only nodes of type
XML_Normal can have attributes. For all other node types this function is ignored.
// [Index] =======================================================================================
Procedure XML_SetEncoding(XML, Encoding: Integer);SyntaxXML_SetEncoding(XML, Encoding);DescriptionChanges the text encoding used for saving the given XML tree. Encoding can be either
XML_Ascii,
XML_Unicode (= UTF16) or
XML_UTF8.
Note: This only affects the saving of the tree. The data in the
XML object is always stored in the library internal string format (Ascii or Unicode depending on the compiled version). So a unicode executable that uses unicode library can safely change the encoding to
XML_Ascii for saving and then back to something else without loosing any information in the tree in memory.
// [Index] =======================================================================================
Procedure XML_SetNodeName(Node: Integer; Name: PChar);SyntaxXML_SetNodeName(Node, Name);DescriptionChanges the tagname of the given XML node. If the node is not of type
XML_Normal or
XML_Instruction, this function is ignored.
// [Index] =======================================================================================
Procedure XML_SetNodeOffset(Node, Offset: Integer);SyntaxXML_SetNodeOffset(Node, Offset);DescriptionChanges the character offset of the given XML node within its parent nodes text data. See
XML_GetNodeOffset() for more information.
// [Index] =======================================================================================
Procedure XML_SetNodeText(Node: Integer; Text: PChar);SyntaxXML_SetNodeText(Node, Text);DescriptionChanges the text contained within the given XML node. See
XML_GetNodeText() for more information.
Note: If the node contains children, changing its contained text may require an adjustment of the child nodes offset values as well.
// [Index] =======================================================================================
Procedure XML_SetStandalone(XML, Standalone: Integer);SyntaxXML_SetStandalone(XML, Standalone);DescriptionChanges the "standalone" attribute of the XML declaration when saving the document.
Standalone can be one of these values:
XML_StandaloneYes : The document mode is standalone
XML_StandaloneNo : The document mode is not standalone
XML_StandaloneUnset: The standalone mode is not specified in the declaration
Note: Since this library does not validate document type definitions (DTDs), the value of this attribute has no effect on the parsing/saving of documents with this library except that it is read from and written to the XML declaration. This value is however important when working with XML documents intended for validating parsers, that's why this command exists.
// [Index] =======================================================================================
Function XML_AttributeName(Node: Integer): PChar;SyntaxResult := XML_AttributeName(Node: Integer): PChar;DescriptionAfter calling
XML_ExamineAttributes() and
XML_NextAttribute() this function returns the attribute name of the currently examined attribute on the given XML node.
// [Index] =======================================================================================
Function XML_AttributeValue(Node: Integer): PChar;SyntaxResult := XML_AttributeValue(Node);DescriptionAfter calling
XML_ExamineAttributes() and
XML_NextAttribute() this function returns the attribute value of the currently examined attribute on the given XML node.
// [Index] =======================================================================================
Function XML_ChildCount(Node: Integer): Integer;SyntaxResult := XML_ChildCount(Node);DescriptionReturns the number of child nodes inside the given XML node.
// [Index] =======================================================================================
Function XML_Error(XML: Integer): PChar;SyntaxResult := XML_Error(XML);DescriptionIn case of an error while parsing XML data this function returns an error-message describing the error.
XML_Status() can be used to detect parsing errors.
To get more information about the error,
XML_ErrorLine() or
XML_ErrorPosition() can be used.
// [Index] =======================================================================================
Function XML_ErrorLine(XML: Integer): Integer;SyntaxResult := XML_ErrorLine(XML);DescriptionIn case of an error while parsing XML data this function returns the line in the input that caused the error (one based).
XML_Status() can be used to detect parsing errors.
To get the position within the line at which the error happened,
XML_ErrorPosition() can be used.
// [Index] =======================================================================================
Function XML_ErrorPosition(XML: Integer): Integer;SyntaxResult := XML_ErrorPosition(XML);DescriptionIn case of an error while parsing XML data this function returns character position within the line returned by
XML_ErrorLine() at which the error was caused. The first character of the line is at position 1.
XML_Status() can be used to detect parsing errors.
// [Index] =======================================================================================
Function XML_NodeFromID(XML: Integer; ID: PChar): Integer;SyntaxResult := Function XML_NodeFromID(XML, ID);DescriptionIn valid XML, if a node has an attribute called "ID", the value of this attribute must be unique within the XML document. This function can be used to search for a node in the document based on its ID attribute.
Return valueReturns the node pointer of the node with the given ID tag or 0 if no such node exists within the tree.
// [Index] =======================================================================================
Function XML_NodeFromPath(ParentNode: Integer; Path: PChar): Integer;SyntaxResult := XML_NodeFromPath(ParentNode, Path);DescriptionReturns the XML node inside
ParentNode who's relation to
ParentNode is described through
Path.
XML_NodePath() can be used to get such a path to a node.
ParametersPath contains a list of node names separated by "/" to indicate the way to follow from the parent to the target node. For example "childtag/subchildtag" specifies the first node with name "subchildtag" inside the first node with name "childtag" inside
ParentNode.
A node name can have an index (one based) to specify which of multiple child tags of the same name should be selected. "childtag/subchildtag[3]" specifies the 3rd "subchildtag" inside the first "childtag" of
ParentNode.
Other rules:
- If a path starts with "/" it is relative to the tree's root. No matter which node
ParentNode specifies.
- A wildcard "*" can be used instead of a tag name to specify that any tag is to be selected.
- A Comment node has the tagname "#comment"
- A CData node has the tagname "#cdata"
- A DTD node has the tagname "#dtd"
- A Processing Instruction node has the tagname "#instruction"
Some examples of valid paths:
"/mainnode/#comment[4]" - the 4th comment inside the "mainnode" node inside the root of the tree
"*[10]" - the 10th node (of any type) inside
ParentNode "*/*/*" - the 1st node 3 levels below
ParentNode independent of its type
"node[3]/*[3]/#cdata" - the first CData section inside the 3rd node of any kind inside the 3rd "node" node inside
ParentNodeNote: This command is not an implementation of the XPath specification. The syntax used and understood by this command is only a small subset of XPath. This means a path returned from
XML_NodePath() is a valid XPath query, but this command only understands the syntax described here, not just any XPath query.
Return valueReturns the node pointer of the target node or 0 if the path did not lead to a valid node.
// [Index] =======================================================================================
Function XML_NodePath(Node, ParentNode: Integer): PChar;SyntaxResult := XML_NodePath(Node, ParentNode);DescriptionReturns a string representing the relation between
Node and
ParentNode. If
ParentNode is specified, it must be a parent or grandparent of
Node. If it is not specified, the root node of the tree is used.
See
XML_NodeFromPath() for a description of the returned path string.
// [Index] =======================================================================================
Function XML_NodeType(Node: Integer): Integer;SyntaxResult := Function XML_NodeType(Node: Integer): Integer;DescriptionReturns the type of the given XML node. It can be one of the following:
XML_RootThis is the trees root node. It represents the document itself. This node cannot be created or deleted manually. Inside the root node, there can be only one node of type
XML_Normal and also no plain text (this is required to be a well-formed XML document).
XML_NormalThis is a normal node in the tree. It can have a list of attributes and contain text and/or child nodes.
Example:
<node attribute="hello"> contained text </node>XML_CommentThis node represents a comment. It can have no children or attributes. Its text represents the content of the comment.
Example:
<!-- comment text -->XML_CDataThis is a CData section. A CData section contains only text. Its content is not interpreted by the parser so it can contain unescaped "<", ">" and "&" characters for example. CData sections can be used to include other markup or code inside a document without having to escape all characters that could be interpreted as XML.
Example:
<![CDATA[ cdata content ]]>XML_DTDThis is a document type declaration (DTD). This library does not use a validating parser, so these declarations are actually ignored when parsing a document. In order to save them back correctly, they are contained within such a DTD node. The text content of the node is the entire DTD tag. It can be read and modified through commands like
XML_SetNodeText() and will be written back to the document when saving without modification. The
XML_SetStandalone() command could be useful as well when working with DTDs.
Example:
<!DOCTYPE name SYSTEM "external dtd uri">XML_InstructionThis node represents a Processing Instruction. Processing Instructions contain information that is intended to be interpreted/executed by the target application. They have a name to specify the content of the instruction and the instruction data which can be accessed with
XML_GetNodeText().
Example:
<?php if (...) ... ?>(here "php" is the node name, and the rest up to the "?>" is the node text.)
// [Index] =======================================================================================
Function XML_Status(XML: Integer): Integer;SyntaxResult := XML_Status(XML);DescriptionReturns the status of the last parsing operation done on this XML tree (using
XML_Load()). This function should be called after every
XML_Load() call to ensure that the parsing succeeded. A string representation of the parsing status (i.e. a readable error-message) is returned by the
XML_Error() function.
Return valueA value of 0 (
XML_Success) indicates a successful parsing, all other values indicate various error conditions.
The following returnvalues are possible:
XML_Success : no error
XML_NoMemory : out of memory
XML_Syntax : syntax error
XML_NoElements : no element found
XML_InvalidToken : not well-formed (invalid token)
XML_UnclosedToken : unclosed token
XML_PartialCharacter : partial character
XML_TagMismatch : mismatched tag
XML_DublicateAttribute : duplicate attribute
XML_JunkAfterDocElement : junk after document element
XML_ParamEntityRef : illegal parameter entity reference
XML_UndefinedEntity : undefined entity
XML_RecursiveEntityRef : recursive entity reference
XML_AsyncEntity : asynchronous entity
XML_BadCharacterRef : reference to invalid character number
XML_BinaryEntityRef : reference to binary entity
XML_AttributeExternalEntityRef: reference to external entity in attribute
XML_MisplacedXML : XML or text declaration not at start of entity
XML_UnknownEncoding : unknown encoding
XML_IncorrectEncoding : encoding specified in XML declaration is incorrect
XML_UnclosedCDataSection: unclosed CDATA section
XML_ExternalEntityHandling: error in processing external entity reference
XML_NotStandalone : document is not standalone
XML_UnexpectedState : unexpected parser state
XML_EntityDeclaredInPE : entity declared in parameter entity
XML_FeatureRequiresDTD : requested feature requires XML_DTD support in Expat
XML_CantChangeFeatures : cannot change setting once parsing has begun
XML_UnboundPrefix : unbound prefix
XML_UndeclaringPrefix : must not undeclare prefix
XML_IncompletePE : incomplete markup in parameter entity
XML_XMLDeclaration : XML declaration not well-formed
XML_TextDeclaration : text declaration not well-formed
XML_PublicID : illegal character(s) in public id
XML_Suspended : parser suspended
XML_NotSuspended : parser not suspended
XML_Aborted : parsing aborted
XML_Finished : parsing finished
XML_SuspendedPE : cannot suspend in external parameter entity
XML_ReservedPrefixXML : reserved prefix (xml) must not be undeclared or bound to another namespace name
XML_ReservedPrefixXMLNS : reserved prefix (xmlns) must not be declared or undeclared
XML_ReservedNamespaceURI: prefix must not be bound to one of the reserved namespace names
// [Index] =======================================================================================
Function XML_GetVersion(): Integer;SyntaxResult := XML_GetVersion();DescriptionReturns the version of the
libxml library.