Xml C Library Reference
Xml
A free non-validating XML parser C library with encryption and compression features.
Create/Dispose
HCkXml CkXml_Create(void);
Creates an instance of the CkXml object and returns a handle (i.e. a "void *" pointer). The handle is passed in the 1st argument for the functions listed on this page.
void CkXml_Dispose(HCkXml handle);
Objects created by calling CkXml_Create must be freed by calling this method. A memory leak occurs if a handle is not disposed by calling this function.
C "Properties"
BOOL CkXml_getCdata(HCkXml handle); void CkXml_putCdata(HCkXml handle, BOOL newVal);
When True, causes an XML node's content to be encapsulated in a CDATA section.
void CkXml_getContent(HCkXml handle, HCkString retval); void CkXml_putContent(HCkXml handle, const char *newVal);
This is the content of the XML node. It is the text between the open and close tags, such as:This is the content Content vs. Children: A common misconception explained.
int CkXml_getContentInt(HCkXml handle); void CkXml_putContentInt(HCkXml handle, int newVal);
Set/get the content as an integer.
void CkXml_getEncoding(HCkXml handle, HCkString retval); void CkXml_putEncoding(HCkXml handle, const char *newVal);
This is the encoding attribute in the XML declaration, such as "utf-8" or "iso-8859-1". If not present, this property returns an empty string. This property can be set from any node in the XML document and when set, causes the encoding property to be added to the XML declaration. Setting this property does not cause the document to be converted to a different encoding.
void CkXml_getLastErrorHtml(HCkXml handle, HCkString retval);
To be documented soon.Error information in HTML format for the last method called.
void CkXml_getLastErrorText(HCkXml handle, HCkString retval);
To be documented soon.Error information in plain-text format for the last method called.
void CkXml_getLastErrorXml(HCkXml handle, HCkString retval);
To be documented soon.Error information in XML format for the last method called.
long CkXml_getNumAttributes(HCkXml handle);
The number of attributes. For example, the following node has 2 attributes: This is the content
long CkXml_getNumChildren(HCkXml handle);
The number of child nodes contained under this XML node.
BOOL CkXml_getSortCaseInsensitive(HCkXml handle); void CkXml_putSortCaseInsensitive(HCkXml handle, BOOL newVal);
If true (or 1 for ActiveX), then all Sort* methods use case insensitive sorting.
BOOL CkXml_getStandalone(HCkXml handle); void CkXml_putStandalone(HCkXml handle, BOOL newVal);
This is the standalone attribute in the XML declaration. This property can be set from any node in the XML document. A value of true adds a standalone="yes" to the XML declaration:
<?xml ... standalone="yes">
void CkXml_getTag(HCkXml handle, HCkString retval); void CkXml_putTag(HCkXml handle, const char *newVal);
The XML node's tag.
long CkXml_getTreeId(HCkXml handle);
Each tree (or XML document) has a unique TreeId. This is the ID of the tree, and can be used to determine if two Xml objects belong to the same tree.
BOOL CkXml_getUtf8(HCkXml handle); void CkXml_putUtf8(HCkXml handle, BOOL newVal);
When set to true, all "const char *" arguments are expected to be utf-8 strings. If set to false, the "const char *" arguments are expected to be ANSI strings.
BOOL CkXml_getVersion(HCkXml handle);
The version of the XML component, such as "2.0.0".
C "Methods"
void CkXml_AccumulateTagContent(HCkXml handle, const char *tag, const char *skipTags, HCkString str);
Accumulates the content of all nodes having a specific tag into a single result string. SkipTags specifies a set of tags whose are to be avoided. The skipTags are formatted as a string of tags delimited by vertical bar characters. All nodes in sub-trees rooted with a tag appearing in skipTags are not included in the result.
BOOL CkXml_AddAttribute(HCkXml handle, const char *name, const char *value);
Adds an attribute to the calling node in the XML document. Returns True for success, and False for failure.
BOOL CkXml_AddAttributeInt(HCkXml handle, const char *name, int value);
Adds an integer attribute to a node.
BOOL CkXml_AddChildTree(HCkXml handle, HCkXml tree);
Adds an entire subtree as a child. If the child was a subtree within another Xml document then the subtree is effectively transferred from one XML document to another.
void CkXml_AddOrUpdateAttribute(HCkXml handle, const char *name, const char *value);
Adds an attribute to an XML node. If an attribute having the specified name already exists, the value is updated.
void CkXml_AddOrUpdateAttributeI(HCkXml handle, const char *name, long value);
Adds an integer attribute to an XML node. If an attribute having the specified name already exists, the value is updated.
void CkXml_AddStyleSheet(HCkXml handle, const char *styleSheet);
Adds a style sheet declaration to the XML document. The styleSheet should be a string such as:
<?xml-stylesheet href="mystyle.css" title="Compact" type="text/css"?>
void CkXml_AddToAttribute(HCkXml handle, const char *name, long amount);
Adds an integer amount to an integer attribute's value. If the attribute does not yet exist, this method behaves the same as AddOrUpdateAttributeI.
void CkXml_AddToChildContent(HCkXml handle, const char *tag, long amount);
Adds an integer value to the content of a child node.
void CkXml_AddToContent(HCkXml handle, long amount);
Adds an integer amount to the node's content.
BOOL CkXml_AppendToContent(HCkXml handle, const char *str);
Appends text to the content of an XML node
BOOL CkXml_BEncodeContent(HCkXml handle, const char *charset, HCkByteData db);
Sets the node's content with 8bit data that is in a specified multibyte character encoding such as utf-8, shift-jis, big5, etc. The data is first B-encoded and the content is set to be the B-encoded string. For example, if called with "Big5"for the charset, you would get a string that looks something like this: "=?Big5?B?pHCtsw==?=". The data is Base64-encoded and stored between the last pair of "?" delimiters. Use the DecodeContent method to retrieve the byte data from a B encoded string.
BOOL CkXml_ChildContentMatches(HCkXml handle, const char *tag, const char *pattern, BOOL caseSensitive);
Return true if a child having a specific tag contains content that matches a wildcarded pattern.
BOOL CkXml_Clear(HCkXml handle);
Removes all children, attributes, and content from the XML node. Resets the tag name to "unnamed".
BOOL CkXml_ContentMatches(HCkXml handle, const char *pattern, BOOL caseSensitive);
Return true if the node's content matches a wildcarded pattern.
BOOL CkXml_DecodeContent(HCkXml handle, HCkByteData db);
Decodes a node's Q or B-encoded content string and returns the byte data.
BOOL CkXml_DecodeEntities(HCkXml handle, const char *str, HCkString outStr);
Utility method to decode HTML entities. It accepts a string containing (potentially) HTML entities and returns a string with the entities decoded.
BOOL CkXml_DecryptContent(HCkXml handle, const char *password);
Decrypts the content of an XML node that was previously 128-bit AES encrypted with the EncryptContent method.
BOOL CkXml_EncryptContent(HCkXml handle, const char *password);
AES encrypts the content of the calling XML node using 128-bit Rijndael encryption.
HCkXml CkXml_ExtractChildByIndex(HCkXml handle, long index);
Removes and returns the Nth child of an XML node. The first child is at index 0.
HCkXml CkXml_ExtractChildByName(HCkXml handle, const char *tag, const char *attrName, const char *attrValue);
Removes and returns the first child node having a tag equal to the tagName. The attributeName and attrValue may be empty or NULL, in which case the first child matching the tag is removed and returned. If attributeName is specified, then the first child having a tag equal to tagName, and an attribute with attributeName is returned. If attrValue is also specified, then only a child having a tag equal to tagName, and an attribute named attributeName, with a value equal to attrValue is returned.
HCkXml CkXml_FindChild(HCkXml handle, const char *tag);
Returns the child having a specified tag.
BOOL CkXml_FindChild2(HCkXml handle, const char *tag);
Updates the Xml object's internal reference to point to a child with a specified tag.
HCkXml CkXml_FindNextRecord(HCkXml handle, const char *tag, const char *contentPattern);
Returns the next record node where the child with a specific tag matches a wildcarded pattern. This method makes it easy to iterate over high-level records.
HCkXml CkXml_FindOrAddNewChild(HCkXml handle, const char *tag);
First searches for a child having a tag equal to tagName, and if found, returns it. Otherwise creates a new child, sets the tag equal to tagName, and initializes the Content to empty.
HCkXml CkXml_FirstChild(HCkXml handle);
Returns the first child. A program can step through the children by calling FirstChild, and then NextSibling repeatedly.
BOOL CkXml_FirstChild2(HCkXml handle);
Updates the internal reference of the caller to point to its first child. More information about XML methods ending in "2"
BOOL CkXml_GetAttrValue(HCkXml handle, const char *name, HCkString str);
Find and return the value of an attribute having a specified name.
int CkXml_GetAttrValueInt(HCkXml handle, const char *name);
Returns an attribute as an integer.
BOOL CkXml_GetAttributeName(HCkXml handle, long index, HCkString str);
Returns the name of the Nth attribute of an XML node. The first attribute is at index 0.
BOOL CkXml_GetAttributeValue(HCkXml handle, long index, HCkString str);
Returns the value of the Nth attribute of an XML node. The first attribute is at index 0.
int CkXml_GetAttributeValueInt(HCkXml handle, int index);
Returns an attribute as an integer.
BOOL CkXml_GetBinaryContent(HCkXml handle, HCkByteData data, BOOL unzipFlag, BOOL decryptFlag, const char *password);
Returns binary content of an XML node as a byte array. The content may have been Zip compressed, AES encrypted, or both. Unzip compression and AES decryption flags should be set appropriately.
HCkXml CkXml_GetChild(HCkXml handle, long index);
Returns the Nth child of an XML node
BOOL CkXml_GetChild2(HCkXml handle, long index);
Updates the calling object's internal reference to the Nth child node. Returns TRUE for success, FALSE for failure. More information about XML methods ending in "2"
BOOL CkXml_GetChildBoolValue(HCkXml handle, const char *tag);
Returns false if the node's content is "0", otherwise returns true if the node contains a non-zero integer.
BOOL CkXml_GetChildContent(HCkXml handle, const char *tag, HCkString str);
Returns the content of a child having a specified tag.
BOOL CkXml_GetChildContentByIndex(HCkXml handle, long index, HCkString str);
Returns the content of the Nth child node.
HCkXml CkXml_GetChildExact(HCkXml handle, const char *tag, const char *content);
Returns the child having the exact tag and content.
int CkXml_GetChildIntValue(HCkXml handle, const char *tag);
Returns the child integer content for a given tag.
BOOL CkXml_GetChildTag(HCkXml handle, long index, HCkString str);
Returns the tag name of the Nth child node.
BOOL CkXml_GetChildTagByIndex(HCkXml handle, int index, HCkString outStr);
Returns the tag name of the Nth child node.
HCkXml CkXml_GetChildWithContent(HCkXml handle, const char *content);
Returns the first child found having the exact content specified.
HCkXml CkXml_GetChildWithTag(HCkXml handle, const char *tag);
Returns the Xml child object having a tag matching tagName.
HCkXml CkXml_GetNthChildWithTag(HCkXml handle, const char *tag, long n);
Returns the Nth child having a tag that matches exactly with the tagName. Use the NumChildrenHavingTag method to determine how many children have a particular tag.
BOOL CkXml_GetNthChildWithTag2(HCkXml handle, const char *tag, long n);
Updates the calling object's internal reference to the Nth child node having a specific tag. Returns TRUE for success, FALSE for failure.
HCkXml CkXml_GetParent(HCkXml handle);
Returns the parent of this XML node, or NULL if the node is the root of the tree.
BOOL CkXml_GetParent2(HCkXml handle);
Updates the internal reference of the caller to its parent. More information about XML methods ending in "2"
HCkXml CkXml_GetRoot(HCkXml handle);
Returns the root node of the XML document
void CkXml_GetRoot2(HCkXml handle);
Updates the internal reference of the caller to the document root. More information about XML methods ending in "2"
BOOL CkXml_GetXml(HCkXml handle, HCkString str);
Generate the XML text document for the XML tree rooted at this node.
BOOL CkXml_HasAttrWithValue(HCkXml handle, const char *name, const char *value);
Returns true if the node contains attribute with the name and value.
BOOL CkXml_HasAttribute(HCkXml handle, const char *name);
Returns true if the node contains an attribute with the specified name.
BOOL CkXml_HasChildWithContent(HCkXml handle, const char *content);
Returns true if the node has a child node containing the exact content string specified.
BOOL CkXml_HasChildWithTag(HCkXml handle, const char *tag);
Returns true (1 for ActiveX) if the node has a child with a given tag.
BOOL CkXml_HasChildWithTagAndContent(HCkXml handle, const char *tag, const char *content);
Returns true if the node contains a child having the exact tag and content specified.
HCkXml CkXml_HttpGet(HCkXml handle, const char *url);
Gets an XML document from a URL. This can be tested with the following URL: http://www.chilkatsoft.com/test.xml
HCkXml CkXml_HttpPost(HCkXml handle, const char *url);
Provides client-side protocol support for communication with HTTP servers. A client can use this method to send an arbitrary HTTP request, receive the response, and have Chilkat XML.NET parse that response.The request body is sent directly from the Chilkat XML object and the response is parsed directly into the returned Chilkat XML object. When combined with the support for Extensible Stylesheet Language (XSL), this provides an easy way to send structured queries to HTTP servers and efficiently display the results with a variety of presentations.
BOOL CkXml_InsertChildTreeAfter(HCkXml handle, int index, HCkXml tree);
Adds an entire subtree as a child. If the child was a subtree within another Xml document then the subtree is effectively transferred from one XML document to another. The child tree is inserted in a position after the Nth child (of the calling node).
BOOL CkXml_InsertChildTreeBefore(HCkXml handle, int index, HCkXml tree);
Adds an entire subtree as a child. If the child was a subtree within another Xml document then the subtree is effectively transferred from one XML document to another. The child tree is inserted in a position before the Nth child (of the calling node).
HCkXml CkXml_LastChild(HCkXml handle);
Returns the last Xml child node. A node's children can be enumerated by calling LastChild and then repeatedly calling PreviousSibling, until a NULL is returned.
BOOL CkXml_LastChild2(HCkXml handle);
Updates the internal reference of the caller to its last child.
BOOL CkXml_LoadXml(HCkXml handle, const char *xmlData);
Loads an XML document from a memory buffer and returns True if successful. The contents of the calling node are replaced with the root node of the XML document loaded.
BOOL CkXml_LoadXml2(HCkXml handle, const char *xmlData, BOOL autoTrim);
Same as LoadXml, but an additional argument controls whether or not leading/trailing whitespace is auto-trimmed from each node's content. Returns TRUE for success, FALSE for failure.
BOOL CkXml_LoadXmlFile(HCkXml handle, const char *fileName);
Loads an XML document from a file and returns True if successful. The contents of the calling node are replaced with the root node of the XML document loaded.
BOOL CkXml_LoadXmlFile2(HCkXml handle, const char *fileName, BOOL autoTrim);
Same as LoadXmlFile, but an additional argument controls whether or not leading/trailing whitespace is auto-trimmed from each node's content. Returns TRUE for success, FALSE for failure.
HCkXml CkXml_NewChild(HCkXml handle, const char *tag, const char *content);
Creates a new child having tag and content. The new child is created even if a child with a tag equal to tagName already exists. (Use FindOrAddNewChild to prevent creating children having the same tags.)
void CkXml_NewChild2(HCkXml handle, const char *tag, const char *content);
Creates a new child but does not return the node that is created.
HCkXml CkXml_NewChildAfter(HCkXml handle, int index, const char *tag, const char *content);
Inserts a new child in a position after the Nth child node.
HCkXml CkXml_NewChildBefore(HCkXml handle, int index, const char *tag, const char *content);
Inserts a new child in a position before the Nth child node.
void CkXml_NewChildInt2(HCkXml handle, const char *tag, int value);
Inserts a new child having an integer for content.
HCkXml CkXml_NextSibling(HCkXml handle);
Returns the nodes next sibling, or NULL if there are no more.
BOOL CkXml_NextSibling2(HCkXml handle);
Updates the internal reference of the caller to its next sibling. More information about XML methods ending in "2"
long CkXml_NumChildrenHavingTag(HCkXml handle, const char *tag);
Returns the number of children having a specific tag name.
HCkXml CkXml_PreviousSibling(HCkXml handle);
Returns the Xml object that is the node's previous sibling, or NULL if there are no more.
BOOL CkXml_PreviousSibling2(HCkXml handle);
Updates the internal reference of the caller to its previous sibling. More information about XML methods ending in "2"
BOOL CkXml_QEncodeContent(HCkXml handle, const char *charset, HCkByteData db);
Sets the node's content with 8bit data that is in a specified multibyte character encoding such as utf-8, shift-jis, big5, etc. The data is first Q-encoded and the content is set to be the Q-encoded string. For example, if called with "gb2312"for the charset, you would get a string that looks something like this: "=?gb2312?Q?=C5=B5=BB=F9?=". Character that are not 7bit are represented as "=XX" where XX is the hexidecimal value of the byte. Use the DecodeContent method to retrieve the byte data from a Q encoded string.
BOOL CkXml_RemoveAllAttributes(HCkXml handle);
Removes all attributes from an XML node. Should always return True.
void CkXml_RemoveAllChildren(HCkXml handle);
Removes all children from the calling node.
BOOL CkXml_RemoveAttribute(HCkXml handle, const char *name);
Removes an attribute by name from and XML node.
void CkXml_RemoveChild(HCkXml handle, const char *tag);
Removes a child with a given tag.
void CkXml_RemoveChildByIndex(HCkXml handle, long index);
Removes the Nth child from the calling node.
void CkXml_RemoveChildWithContent(HCkXml handle, const char *content);
Removes all children having the exact content specified.
void CkXml_RemoveFromTree(HCkXml handle);
Removes the calling object and its sub-tree from the XML document making it the root of its own tree.
BOOL CkXml_SaveBinaryContent(HCkXml handle, const char *filename, BOOL unzipFlag, BOOL decryptFlag, const char *password);
Saves a node's binary content to a file.
BOOL CkXml_SaveLastError(HCkXml handle, const char *filename);
Saves the last error information to an XML formatted file.
BOOL CkXml_SaveXml(HCkXml handle, const char *fileName);
Generates XML representing the tree or subtree rooted at this node and writes it to a file.
HCkXml CkXml_SearchAllForContent(HCkXml handle, HCkXml after, const char *contentPattern);
Returns the first node whose content matches the contentPattern, which is a case-sensitive string that can use any number of '*'s to represent 0 or more occurances of any character. The search is breadth-first over the tree, and the previous node returned can be passed to the next call as afterNode to continue the search after that node.
BOOL CkXml_SearchAllForContent2(HCkXml handle, HCkXml after, const char *contentPattern);
Same as SearchAllForContent except the internal reference of the caller is updated to point to the search result (instead of returning a new object).
HCkXml CkXml_SearchForAttribute(HCkXml handle, HCkXml after, const char *tag, const char *attr, const char *valuePattern);
Returns the first node having a tag equal to tagName, and an attribute named attrName whose value matches valuePattern, which is a case-sensitive string that can use any number of '*'s to represent 0 or more occurances of any character. The search is breadth-first over the tree, and the previous node returned can be passed to the next call as afterNode to continue the search after that node.
BOOL CkXml_SearchForAttribute2(HCkXml handle, HCkXml after, const char *tag, const char *attr, const char *valuePattern);
Same as SearchForAttribute except the internal reference of the caller is updated to point to the search result (instead of returning a new object).
HCkXml CkXml_SearchForContent(HCkXml handle, HCkXml after, const char *tag, const char *contentPattern);
Returns the first node having a tag equal to tagName whose content matches contentPattern, which is a case-sensitive string that can use any number of '*'s to represent 0 or more occurances of any character. The search is breadth-first over the tree, and the previous node returned can be passed to the next call as afterNode to continue the search after that node.
BOOL CkXml_SearchForContent2(HCkXml handle, HCkXml after, const char *tag, const char *contentPattern);
Same as SearchForContent except the internal reference of the caller is updated to point to the search result (instead of returning a new object).
HCkXml CkXml_SearchForTag(HCkXml handle, HCkXml after, const char *tag);
Returns the first node having a tag equal to tagName. The search is breadth-first over the tree, and the previous node returned can be passed to the next call as afterNode to continue the search after that node.
BOOL CkXml_SearchForTag2(HCkXml handle, HCkXml after, const char *tag);
Same as SearchForTag except the internal reference of the caller is updated to point to the search result (instead of returning a new object).
BOOL CkXml_SetBinaryContent(HCkXml handle, const unsigned char *data, unsigned long dataLen, BOOL zipFlag, BOOL encryptFlag, const char *password);
Sets the node's content to a block of binary data with optional Zip compression and/or AES encryption. The binary data is automatically converted to base64 format whenever XML text is generated. If the zipFlag is True, the data is first compressed. If the encryptFlag is True, the data is AES encrypted using the Rijndael 128-bit symmetric-encryption algorithm.
BOOL CkXml_SetBinaryContent(HCkXml handle, HCkByteData data, BOOL zipFlag, BOOL encryptFlag, const char *password);
Sets the node's content to a block of binary data with optional Zip compression and/or AES encryption. The binary data is automatically converted to base64 format whenever XML text is generated. If the zipFlag is True, the data is first compressed. If the encryptFlag is True, the data is AES encrypted using the Rijndael 128-bit symmetric-encryption algorithm.
BOOL CkXml_SetBinaryContentFromFile(HCkXml handle, const char *filename, BOOL zipFlag, BOOL encryptFlag, const char *password);
Sets the node's content with binary (or text) data from a file. The file contents can be Zip compressed and/or encrypted, and the result is base-64 encoded.
void CkXml_SortByAttribute(HCkXml handle, const char *attrName, long ascending);
Sorts the child nodes by the value of a specified attribute.
void CkXml_SortByAttributeInt(HCkXml handle, const char *attrName, BOOL ascending);
Sorts the child nodes by the value of a specified attribute interpreted as an integer (not lexicographically as strings).
void CkXml_SortByContent(HCkXml handle, long ascending);
Sorts the child nodes by content.
void CkXml_SortByTag(HCkXml handle, long ascending);
Sorts the child nodes by tag.
void CkXml_SortRecordsByAttribute(HCkXml handle, const char *sortTag, const char *attrName, long ascending);
Sorts the child nodes by the content of an attribute in the grandchild nodes.
void CkXml_SortRecordsByContent(HCkXml handle, const char *sortTag, long ascending);
Sorts the child nodes by the content of the grandchild nodes.
BOOL CkXml_SwapNode(HCkXml handle, HCkXml node);
Swaps another node's tag, content, and attributes with this one.
BOOL CkXml_SwapTree(HCkXml handle, HCkXml tree);
Swaps another node's tag, content, attributes, and children with this one.
BOOL CkXml_TagEquals(HCkXml handle, const char *tag);
Returns true if the node's tag equals the specified string.
BOOL CkXml_UnzipContent(HCkXml handle);
Unzip the content of the XML node replacing it's content with the decompressed data.
BOOL CkXml_UnzipTree(HCkXml handle);
Unzips and recreates the XML node and the entire subtree, restoring it to the state before it was zip compressed.
BOOL CkXml_UpdateAttribute(HCkXml handle, const char *attrName, const char *attrValue);
Adds an attribute to the node if it doesn't already exist. Otherwise it updates the existing attribute with the new value.
BOOL CkXml_UpdateAttributeInt(HCkXml handle, const char *attrName, int value);
Updates an attribute value. (Call UpdateAttribute if the attribute value is a string.)
void CkXml_UpdateChildContent(HCkXml handle, const char *tag, const char *value);
Replaces the content of a child node.
void CkXml_UpdateChildContentInt(HCkXml handle, const char *tag, int value);
Replaces the content of a child node where the content is an integer.
BOOL CkXml_ZipContent(HCkXml handle);
Applies Zip compression to the content of an XML node and replaces the content with base64-encoded compressed data.
BOOL CkXml_ZipTree(HCkXml handle);
Zip compresses the content and entire subtree rooted at the calling XML node and replaces the current content with base64-encoded Zip compressed data. The node and subtree can be restored by calling UnzipTree. Note that the node name and attributes are unaffected.
const char *CkXml_accumulateTagContent(HCkXml handle, const char *tag, const char *skipTags);
Accumulates the content of all nodes having a specific tag into a single result string. SkipTags specifies a set of tags whose are to be avoided. The skipTags are formatted as a string of tags delimited by vertical bar characters. All nodes in sub-trees rooted with a tag appearing in skipTags are not included in the result.
const char *CkXml_attr(HCkXml handle, const char *name);
Find and return the value of an attribute having a specified name.
const char *CkXml_attrName(HCkXml handle, long index);
Returns the name of the Nth attribute of an XML node. The first attribute is at index 0.
const char *CkXml_attrValue(HCkXml handle, long index);
Returns the value of the Nth attribute of an XML node. The first attribute is at index 0.
const char *CkXml_childContent(HCkXml handle, const char *tag);
Returns the content of a child having a specified tag.
const char *CkXml_content(HCkXml handle);
This is the content of the XML node. It is the text between the open and close tags, such as:This is the content Content vs. Children: A common misconception explained.
const char *CkXml_decodeEntities(HCkXml handle, const char *str);
Utility method to decode HTML entities. It accepts a string containing (potentially) HTML entities and returns a string with the entities decoded.
const char *CkXml_encoding(HCkXml handle);
This is the encoding attribute in the XML declaration, such as "utf-8" or "iso-8859-1". If not present, this property returns an empty string. This property can be set from any node in the XML document and when set, causes the encoding property to be added to the XML declaration. Setting this property does not cause the document to be converted to a different encoding.
const char *CkXml_getAttrValue(HCkXml handle, const char *name);
Find and return the value of an attribute having a specified name.
const char *CkXml_getAttributeName(HCkXml handle, long index);
Returns the name of the Nth attribute of an XML node. The first attribute is at index 0.
const char *CkXml_getAttributeValue(HCkXml handle, long index);
Returns the value of the Nth attribute of an XML node. The first attribute is at index 0.
const char *CkXml_getChildContent(HCkXml handle, const char *tag);
Returns the content of a child having a specified tag.
const char *CkXml_getChildContentByIndex(HCkXml handle, long index);
Returns the content of the Nth child node.
const char *CkXml_getChildTag(HCkXml handle, long index);
Returns the tag name of the Nth child node.
const char *CkXml_getChildTagByIndex(HCkXml handle, int index);
Returns the tag name of the Nth child node.
const char *CkXml_getXml(HCkXml handle);
Generate the XML text document for the XML tree rooted at this node.
const char *CkXml_lastErrorHtml(HCkXml handle);
Error information in HTML format for the last method called.
const char *CkXml_lastErrorText(HCkXml handle);
Error information in plain-text format for the last method called.
const char *CkXml_lastErrorXml(HCkXml handle);
Error information in XML format for the last method called.
const char *CkXml_tag(HCkXml handle);
The XML node's tag.
const char *CkXml_version(HCkXml handle);
The version of the XML component, such as "2.0.0".
const char *CkXml_xml(HCkXml handle);
Generate the XML text document for the XML tree rooted at this node.
|