Xml Delphi DLL Reference Documentation

Xml

Current Version: 10.1.0

A free non-validating XML parser component with encryption and compression features.

Create/Dispose

var
myObject: HCkXml;

begin
myObject := CkXml_Create();

// ...

CkXml_Dispose(myObject);
end;
function CkXml_Create: HCkXml; stdcall;

Creates an instance of the HCkXml object and returns a handle (i.e. a Pointer). The handle is passed in the 1st argument for the functions listed on this page.

procedure CkXml_Dispose(handle: HCkXml); stdcall;

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.

Properties

Cdata
function CkXml_getCdata(objHandle: HCkXml): wordbool; stdcall;
procedure CkXml_putCdata(objHandle: HCkXml; newPropVal: wordbool); stdcall;

When True, causes an XML node's content to be encapsulated in a CDATA section.

More Information and Examples
top
Content
procedure CkXml_getContent(objHandle: HCkXml; outPropVal: HCkString); stdcall;
procedure CkXml_putContent(objHandle: HCkXml; newPropVal: PWideChar); stdcall;
function CkXml__content(objHandle: HCkXml): PWideChar; stdcall;

The content of the XML node. It is the text between the open and close tags, not including child nodes. For example:

<tag1>This is the content</tag1>

<tag2><child1>abc</child1><child2>abc</child2>This is the content</tag2>
Because the child nodes are not included, the content of "tag1" and "tag2" are both equal to "This is the content".

See the notes about PWideChar memory ownership and validity.

top
ContentInt
function CkXml_getContentInt(objHandle: HCkXml): Integer; stdcall;
procedure CkXml_putContentInt(objHandle: HCkXml; newPropVal: Integer); stdcall;

Set/get the content as an integer.

top
DebugLogFilePath
procedure CkXml_getDebugLogFilePath(objHandle: HCkXml; outPropVal: HCkString); stdcall;
procedure CkXml_putDebugLogFilePath(objHandle: HCkXml; newPropVal: PWideChar); stdcall;
function CkXml__debugLogFilePath(objHandle: HCkXml): PWideChar; stdcall;

If set to a file path, causes each Chilkat method or property call to automatically append it's LastErrorText to the specified log file. The information is appended such that if a hang or crash occurs, it is possible to see the context in which the problem occurred, as well as a history of all Chilkat calls up to the point of the problem. The VerboseLogging property can be set to provide more detailed information.

This property is typically used for debugging the rare cases where a Chilkat method call hangs or generates an exception that halts program execution (i.e. crashes). A hang or crash should generally never happen. The typical causes of a hang are:

  1. a timeout related property was set to 0 to explicitly indicate that an infinite timeout is desired,
  2. the hang is actually a hang within an event callback (i.e. it is a hang within the application code), or
  3. there is an internal problem (bug) in the Chilkat code that causes the hang.

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top
DocType
procedure CkXml_getDocType(objHandle: HCkXml; outPropVal: HCkString); stdcall;
procedure CkXml_putDocType(objHandle: HCkXml; newPropVal: PWideChar); stdcall;
function CkXml__docType(objHandle: HCkXml): PWideChar; stdcall;

The DOCTYPE declaration (if any) for the XML document.

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top
EmitBom
function CkXml_getEmitBom(objHandle: HCkXml): wordbool; stdcall;
procedure CkXml_putEmitBom(objHandle: HCkXml; newPropVal: wordbool); stdcall;
Introduced in version 9.5.0.44

If True, then emit the BOM (byte order mark, also known as a preamble) for encodings such as utf-8, utf-16, etc. The defautl value is False. This only applies when writing XML files. It does not apply when getting the XML as a string via the GetXml method.

top
EmitCompact
function CkXml_getEmitCompact(objHandle: HCkXml): wordbool; stdcall;
procedure CkXml_putEmitCompact(objHandle: HCkXml; newPropVal: wordbool); stdcall;
Introduced in version 9.5.0.64

If True, then GetXml and GetXmlSb emit compact XML. The XML emitted has no unnecessary whitespace, incuding no end-of-lines (CR's and/or LF's). The default value is False, which maintains backward compatibility.

More Information and Examples
top
EmitXmlDecl
function CkXml_getEmitXmlDecl(objHandle: HCkXml): wordbool; stdcall;
procedure CkXml_putEmitXmlDecl(objHandle: HCkXml; newPropVal: wordbool); stdcall;

If True, then the XML declaration is emitted for methods (such as GetXml or SaveXml) where the XML is written to a file or string. The default value of this property is True. If set to False, the XML declaration is not emitted. (The XML declaration is the 1st line of an XML document starting with "<?xml ...".

top
Encoding
procedure CkXml_getEncoding(objHandle: HCkXml; outPropVal: HCkString); stdcall;
procedure CkXml_putEncoding(objHandle: HCkXml; newPropVal: PWideChar); stdcall;
function CkXml__encoding(objHandle: HCkXml): PWideChar; stdcall;

This is the encoding attribute in the XML declaration, such as "utf-8" or "iso-8859-1". The default is "utf-8". 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.

Calling any of the LoadXml* methods causes this property to be set to the charset found within the XML, if any. If no charset is specified within the loaded XML, then the LoadXml method resets this property to its default value of "utf-8".

See the notes about PWideChar memory ownership and validity.

top
I
function CkXml_getI(objHandle: HCkXml): Integer; stdcall;
procedure CkXml_putI(objHandle: HCkXml; newPropVal: Integer); stdcall;
Introduced in version 9.5.0.64

Used in tagPaths (and ChilkatPath). The value of this property is substituted for "i" in "[i]". See the example below..

top
IsBase64
function CkXml_getIsBase64(objHandle: HCkXml): wordbool; stdcall;
Introduced in version 9.5.0.76

Returns True if the content contains only those characters allowed in the base64 encoding. A base64 string is composed of characters 'A'..'Z', 'a'..'z', '0'..'9', '+', '/' and it is often padded at the end with up to two '=', to make the length a multiple of 4. Whitespace is ignored.

top
J
function CkXml_getJ(objHandle: HCkXml): Integer; stdcall;
procedure CkXml_putJ(objHandle: HCkXml; newPropVal: Integer); stdcall;
Introduced in version 9.5.0.64

Used in tagPaths (and ChilkatPath). The value of this property is substituted for "j" in "[j]". See the example below..

More Information and Examples
top
K
function CkXml_getK(objHandle: HCkXml): Integer; stdcall;
procedure CkXml_putK(objHandle: HCkXml; newPropVal: Integer); stdcall;
Introduced in version 9.5.0.64

Used in tagPaths (and ChilkatPath). The value of this property is substituted for "k" in "[k]". See the example below..

top
LastErrorHtml
procedure CkXml_getLastErrorHtml(objHandle: HCkXml; outPropVal: HCkString); stdcall;
function CkXml__lastErrorHtml(objHandle: HCkXml): PWideChar; stdcall;

Provides information in HTML format about the last method/property called. If a method call returns a value indicating failure, or behaves unexpectedly, examine this property to get more information.

See the notes about PWideChar memory ownership and validity.

top
LastErrorText
procedure CkXml_getLastErrorText(objHandle: HCkXml; outPropVal: HCkString); stdcall;
function CkXml__lastErrorText(objHandle: HCkXml): PWideChar; stdcall;

Provides information in plain-text format about the last method/property called. If a method call returns a value indicating failure, or behaves unexpectedly, examine this property to get more information.

See the notes about PWideChar memory ownership and validity.

top
LastErrorXml
procedure CkXml_getLastErrorXml(objHandle: HCkXml; outPropVal: HCkString); stdcall;
function CkXml__lastErrorXml(objHandle: HCkXml): PWideChar; stdcall;

Provides information in XML format about the last method/property called. If a method call returns a value indicating failure, or behaves unexpectedly, examine this property to get more information.

See the notes about PWideChar memory ownership and validity.

top
LastMethodSuccess
function CkXml_getLastMethodSuccess(objHandle: HCkXml): wordbool; stdcall;
procedure CkXml_putLastMethodSuccess(objHandle: HCkXml; newPropVal: wordbool); stdcall;

Indicate whether the last method call succeeded or failed. A value of True indicates success, a value of False indicates failure. This property is automatically set for method calls. It is not modified by property accesses. The property is automatically set to indicate success for the following types of method calls:

  • Any method that returns a string.
  • Any method returning a Chilkat object, binary bytes, or a date/time.
  • Any method returning a standard boolean status value where success = True and failure = False.
  • Any method returning an integer where failure is defined by a return value less than zero.

Note: Methods that do not fit the above requirements will always set this property equal to True. For example, a method that returns no value (such as a "void" in C++) will technically always succeed.

top
NumAttributes
function CkXml_getNumAttributes(objHandle: HCkXml): Integer; stdcall;

The number of attributes. For example, the following node has 2 attributes:

<tag attr1="value1" attr2="value2"> This is the content</tag>

More Information and Examples
top
NumChildren
function CkXml_getNumChildren(objHandle: HCkXml): Integer; stdcall;

The number of direct child nodes contained under this XML node.

top
SortCaseInsensitive
function CkXml_getSortCaseInsensitive(objHandle: HCkXml): wordbool; stdcall;
procedure CkXml_putSortCaseInsensitive(objHandle: HCkXml; newPropVal: wordbool); stdcall;

If true (or 1 for ActiveX), then all Sort* methods use case insensitive sorting.

top
Standalone
function CkXml_getStandalone(objHandle: HCkXml): wordbool; stdcall;
procedure CkXml_putStandalone(objHandle: HCkXml; newPropVal: wordbool); stdcall;

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">

top
Tag
procedure CkXml_getTag(objHandle: HCkXml; outPropVal: HCkString); stdcall;
procedure CkXml_putTag(objHandle: HCkXml; newPropVal: PWideChar); stdcall;
function CkXml__tag(objHandle: HCkXml): PWideChar; stdcall;

The XML node's tag, including the namespace prefix.

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top
TagNsPrefix
procedure CkXml_getTagNsPrefix(objHandle: HCkXml; outPropVal: HCkString); stdcall;
procedure CkXml_putTagNsPrefix(objHandle: HCkXml; newPropVal: PWideChar); stdcall;
function CkXml__tagNsPrefix(objHandle: HCkXml): PWideChar; stdcall;
Introduced in version 9.5.0.77

The node's namespace prefix, if present. For example, if the tag is "soapenv:Envelope", then this property will return "soapenv".

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top
TagPath
procedure CkXml_getTagPath(objHandle: HCkXml; outPropVal: HCkString); stdcall;
function CkXml__tagPath(objHandle: HCkXml): PWideChar; stdcall;
Introduced in version 9.5.0.77

Returns the path to reach this element from the XML document root. If the caller is the document root, then the empty string is returned.

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top
TagUnprefixed
procedure CkXml_getTagUnprefixed(objHandle: HCkXml; outPropVal: HCkString); stdcall;
procedure CkXml_putTagUnprefixed(objHandle: HCkXml; newPropVal: PWideChar); stdcall;
function CkXml__tagUnprefixed(objHandle: HCkXml): PWideChar; stdcall;
Introduced in version 9.5.0.77

The node's tag without the namespace prefix. For example, if the tag is "soapenv:Envelope", then this property will return "Envelope".

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top
TreeId
function CkXml_getTreeId(objHandle: HCkXml): Integer; stdcall;

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.

top
UncommonOptions
procedure CkXml_getUncommonOptions(objHandle: HCkXml; outPropVal: HCkString); stdcall;
procedure CkXml_putUncommonOptions(objHandle: HCkXml; newPropVal: PWideChar); stdcall;
function CkXml__uncommonOptions(objHandle: HCkXml): PWideChar; stdcall;
Introduced in version 9.5.0.90

This is a catch-all property to be used for uncommon needs. This property defaults to the empty string and should typically remain empty.

See the notes about PWideChar memory ownership and validity.

top
VerboseLogging
function CkXml_getVerboseLogging(objHandle: HCkXml): wordbool; stdcall;
procedure CkXml_putVerboseLogging(objHandle: HCkXml; newPropVal: wordbool); stdcall;

If set to True, then the contents of LastErrorText (or LastErrorXml, or LastErrorHtml) may contain more verbose information. The default value is False. Verbose logging should only be used for debugging. The potentially large quantity of logged information may adversely affect peformance.

top
Version
procedure CkXml_getVersion(objHandle: HCkXml; outPropVal: HCkString); stdcall;
function CkXml__version(objHandle: HCkXml): PWideChar; stdcall;

Version of the component/library, such as "9.5.0.94"

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top

Methods

AccumulateTagContent
function CkXml_AccumulateTagContent(objHandle: HCkXml;
    tag: PWideChar;
    skipTags: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkXml__accumulateTagContent(objHandle: HCkXml;
    tag: PWideChar;
    skipTags: PWideChar): PWideChar; stdcall;

Accumulates the content of all nodes having a specific tag into a single result string. SkipTags specifies a set of subtrees 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.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top
AddAttribute
function CkXml_AddAttribute(objHandle: HCkXml;
    name: PWideChar;
    value: PWideChar): wordbool; stdcall;

Adds an attribute to the calling node in the XML document. Returns True for success, and False for failure.

Returns True for success, False for failure.

top
AddAttributeInt
function CkXml_AddAttributeInt(objHandle: HCkXml;
    name: PWideChar;
    value: Integer): wordbool; stdcall;

Adds an integer attribute to a node.

Returns True for success, False for failure.

top
AddChildTree
function CkXml_AddChildTree(objHandle: HCkXml;
    tree: HCkXml): wordbool; stdcall;

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.

Returns True for success, False for failure.

More Information and Examples
top
AddOrUpdateAttribute
procedure CkXml_AddOrUpdateAttribute(objHandle: HCkXml;
    name: PWideChar;
    value: PWideChar) stdcall;

Adds an attribute to an XML node. If an attribute having the specified name already exists, the value is updated.

More Information and Examples
top
AddOrUpdateAttributeI
procedure CkXml_AddOrUpdateAttributeI(objHandle: HCkXml;
    name: PWideChar;
    value: Integer) stdcall;

Adds an integer attribute to an XML node. If an attribute having the specified name already exists, the value is updated.

top
AddStyleSheet
procedure CkXml_AddStyleSheet(objHandle: HCkXml;
    styleSheet: PWideChar) stdcall;

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"?>

top
AddToAttribute
procedure CkXml_AddToAttribute(objHandle: HCkXml;
    name: PWideChar;
    amount: Integer) stdcall;

Adds an integer amount to an integer attribute's value. If the attribute does not yet exist, this method behaves the same as AddOrUpdateAttributeI.

More Information and Examples
top
AddToChildContent
procedure CkXml_AddToChildContent(objHandle: HCkXml;
    tag: PWideChar;
    amount: Integer) stdcall;

Adds an integer value to the content of a child node.

top
AddToContent
procedure CkXml_AddToContent(objHandle: HCkXml;
    amount: Integer) stdcall;

Adds an integer amount to the node's content.

top
AppendToContent
function CkXml_AppendToContent(objHandle: HCkXml;
    str: PWideChar): wordbool; stdcall;

Appends text to the content of an XML node

Returns True for success, False for failure.

top
BEncodeContent
function CkXml_BEncodeContent(objHandle: HCkXml;
    charset: PWideChar;
    inData: HCkByteData): wordbool; stdcall;

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.

Returns True for success, False for failure.

top
ChildContentMatches
function CkXml_ChildContentMatches(objHandle: HCkXml;
    tagPath: PWideChar;
    pattern: PWideChar;
    caseSensitive: wordbool): wordbool; stdcall;

Return True if a child at the specified tagPath contains content that matches a wildcarded pattern. Otherwise returns False.

Beginning in version 9.5.0.64, the tagPath can be a tag path. A tag path is a series of tags separated by vertical bar characters. For example: "tagA|tagB|tagC".

top
ChilkatPath
function CkXml_ChilkatPath(objHandle: HCkXml;
    pathCmd: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkXml__chilkatPath(objHandle: HCkXml;
    pathCmd: PWideChar): PWideChar; stdcall;

Follows a series of commands to navigate through an XML document to return a piece of data or update the caller's reference to a new XML document node.

Note: This method not related to the XPath (XML Path) standard in any way.

The pathCmd is formatted as a series of commands separated by vertical bar characters, and terminated with a return-command:

    command|command|command|...|returnCommand

A command can be any of the following:

  1. TagName -- Navigate to the 1st direct child with the given tag.
  2. TagName[n] -- Navigate to the Nth direct child with the given tag.
  3. ".." -- Navigate up to the parent.
  4. "++" -- Navigate to the next sibling. (next/previous sibling feature added in v9.5.0.76)
  5. "--" -- Navigate to the previous sibling.
  6. TagName{Content} -- Navigate to the 1st direct child with the given tag having the exact content.
  7. /T/TagName -- Traverse the XML DOM tree (rooted at the caller) and navigate to the 1st node having the given tag.
  8. /C/TagName,ContentPattern -- Traverse the XML DOM tree (rooted at the caller) and navigate to the 1st node having the given tag with content that matches the ContentPattern. ContentPattern may use one or more asterisk ('*") characters to represent 0 or more of any character.
  9. /C/ContentPattern -- Traverse the XML DOM tree (rooted at the caller) and navigate to the 1st node having any tag with content that matches the ContentPattern. ContentPattern may use one or more asterisk ('*") characters to represent 0 or more of any character.
  10. /A/TagName,AttrName,AttrValuePattern -- Traverse the XML DOM tree (rooted at the caller) and navigate to the 1st node having the given tag, and attribute, with the attribute value that matches the AttrValuePattern. AttrValuePattern may use one or more asterisk ('*") characters to represent 0 or more of any character.
The returnCommand can be any of the following:
  1. * -- Return the Content of the node.
  2. (AttrName) -- Return the value of the given attribute.
  3. $ -- Update the caller's internal reference to be the node (arrived at by following the series of commands). Returns an empty string.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

top
Clear
procedure CkXml_Clear(objHandle: HCkXml) stdcall;

Removes all children, attributes, and content from the XML node. Resets the tag name to "unnamed".

top
ContentMatches
function CkXml_ContentMatches(objHandle: HCkXml;
    pattern: PWideChar;
    caseSensitive: wordbool): wordbool; stdcall;

Return true if the node's content matches a wildcarded pattern.

top
Copy
procedure CkXml_Copy(objHandle: HCkXml;
    node: HCkXml) stdcall;

Copies the tag, content, and attributes to the calling node.

top
CopyRef
procedure CkXml_CopyRef(objHandle: HCkXml;
    copyFromNode: HCkXml) stdcall;

Discards the caller's current internal reference and copies the internal reference from copyFromNode. Effectively updates the caller node to point to the same node in the XML document as copyFromNode.

top
DecodeContent
function CkXml_DecodeContent(objHandle: HCkXml;
    outData: HCkByteData): wordbool; stdcall;

Decodes a node's Q or B-encoded content string and returns the byte data.

Returns True for success, False for failure.

top
DecodeEntities
function CkXml_DecodeEntities(objHandle: HCkXml;
    str: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkXml__decodeEntities(objHandle: HCkXml;
    str: PWideChar): PWideChar; stdcall;

Utility method to decode HTML entities. It accepts a string containing (potentially) HTML entities and returns a string with the entities decoded.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top
DecryptContent
function CkXml_DecryptContent(objHandle: HCkXml;
    password: PWideChar): wordbool; stdcall;

Decrypts the content of an XML node that was previously 128-bit AES encrypted with the EncryptContent method.

Returns True for success, False for failure.

More Information and Examples
top
EncryptContent
function CkXml_EncryptContent(objHandle: HCkXml;
    password: PWideChar): wordbool; stdcall;

Encrypts the content of the calling XML node using 128-bit CBC AES encryption. The base64-encoded encrypted content replaces the original content.

Returns True for success, False for failure.

More Information and Examples
top
ExtractChildByIndex
function CkXml_ExtractChildByIndex(objHandle: HCkXml;
    index: Integer): HCkXml; stdcall;

Removes and returns the Nth child of an XML node. The first child is at index 0.

Returns nil on failure

top
ExtractChildByName
function CkXml_ExtractChildByName(objHandle: HCkXml;
    tagPath: PWideChar;
    attrName: PWideChar;
    attrValue: PWideChar): HCkXml; stdcall;

Removes and returns the first child node at the specified tag or tag path. The attrName and attrValue may be empty, in which case the first child matching the tag is removed and returned. If attrName is specified, then the first child having a tag equal to tagPath, and an attribute with attrName is returned. If attrValue is also specified, then only a child having a tag equal to tagPath, and an attribute named attrName, with a value equal to attrValue is returned.

Beginning in version 9.5.0.64, the tagPath can be a tag path. A tag path is a series of tags separated by vertical bar characters. For example: "tagA|tagB|tagC".

Returns nil on failure

More Information and Examples
top
FindChild
function CkXml_FindChild(objHandle: HCkXml;
    tagPath: PWideChar): HCkXml; stdcall;

Returns the child with the given tag or at the specified tag path.

Beginning in version 9.5.0.64, the tagPath can be a tag path. A tag path is a series of tags separated by vertical bar characters. For example: "tagA|tagB|tagC".

Returns nil on failure

top
FindChild2
function CkXml_FindChild2(objHandle: HCkXml;
    tagPath: PWideChar): wordbool; stdcall;

Updates the Xml object's internal reference to point to a child at the specified tag or tagPath.

Beginning in version 9.5.0.64, the tagPath can be a tag path. A tag path is a series of tags separated by vertical bar characters. For example: "tagA|tagB|tagC".

Returns True for success, False for failure.

top
FindNextRecord
function CkXml_FindNextRecord(objHandle: HCkXml;
    tagPath: PWideChar;
    contentPattern: PWideChar): HCkXml; stdcall;

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.

Beginning in version 9.5.0.64, the tagPath can be a tag path. A tag path is a series of tags separated by vertical bar characters. For example: "tagA|tagB|tagC".

Returns nil on failure

More Information and Examples
top
FindOrAddNewChild
function CkXml_FindOrAddNewChild(objHandle: HCkXml;
    tagPath: PWideChar): HCkXml; stdcall;

First checks for a child at tagPath, and if found, returns it. Otherwise creates a new child with empty content.

Beginning in version 9.5.0.64, the tagPath can be a tag path. A tag path is a series of tags separated by vertical bar characters. For example: "tagA|tagB|tagC".

Returns nil on failure

top
FirstChild
function CkXml_FirstChild(objHandle: HCkXml): HCkXml; stdcall;

Returns the first child. A program can step through the children by calling FirstChild, and then NextSibling repeatedly.

Returns nil on failure

top
FirstChild2
function CkXml_FirstChild2(objHandle: HCkXml): wordbool; stdcall;

Updates the internal reference of the caller to point to its first child.

Returns True for success, False for failure.

top
GetAttributeName
function CkXml_GetAttributeName(objHandle: HCkXml;
    index: Integer;
    outStr: HCkString): wordbool; stdcall;
function CkXml__getAttributeName(objHandle: HCkXml;
    index: Integer): PWideChar; stdcall;

Returns the name of the Nth attribute of an XML node. The first attribute is at index 0.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top
GetAttributeValue
function CkXml_GetAttributeValue(objHandle: HCkXml;
    index: Integer;
    outStr: HCkString): wordbool; stdcall;
function CkXml__getAttributeValue(objHandle: HCkXml;
    index: Integer): PWideChar; stdcall;

Returns the value of the Nth attribute of an XML node. The first attribute is at index 0.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top
GetAttributeValueInt
function CkXml_GetAttributeValueInt(objHandle: HCkXml;
    index: Integer): Integer; stdcall;

Returns an attribute as an integer. Returns 0 if the attribute does not exist.

top
GetAttrValue
function CkXml_GetAttrValue(objHandle: HCkXml;
    name: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkXml__getAttrValue(objHandle: HCkXml;
    name: PWideChar): PWideChar; stdcall;

Find and return the value of an attribute having a specified name.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top
GetAttrValueInt
function CkXml_GetAttrValueInt(objHandle: HCkXml;
    name: PWideChar): Integer; stdcall;

Returns an attribute as an integer. Returns 0 if the attribute does not exist.

More Information and Examples
top
GetBinaryContent
function CkXml_GetBinaryContent(objHandle: HCkXml;
    unzipFlag: wordbool;
    decryptFlag: wordbool;
    password: PWideChar;
    outData: HCkByteData): wordbool; stdcall;

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.

Returns True for success, False for failure.

top
GetChild
function CkXml_GetChild(objHandle: HCkXml;
    index: Integer): HCkXml; stdcall;

Returns the Nth child of an XML node

Returns nil on failure

More Information and Examples
top
GetChild2
function CkXml_GetChild2(objHandle: HCkXml;
    index: Integer): wordbool; stdcall;

Updates the calling object's internal reference to the Nth child node.

Returns True for success, False for failure.

top
GetChildAttrValue
function CkXml_GetChildAttrValue(objHandle: HCkXml;
    tagPath: PWideChar;
    attrName: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkXml__getChildAttrValue(objHandle: HCkXml;
    tagPath: PWideChar;
    attrName: PWideChar): PWideChar; stdcall;
Introduced in version 9.5.0.77

Returns the content of a descendant child having a specified attribute. The tagPath can be a tag or a tag path.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

top
GetChildBoolValue
function CkXml_GetChildBoolValue(objHandle: HCkXml;
    tagPath: PWideChar): wordbool; stdcall;

Returns False if the node's content is "0", otherwise returns True if the node contains a non-zero integer. The tagPath can be a tag or a tag path.

Beginning in version 9.5.0.64, the tagPath can be a tag path. A tag path is a series of tags separated by vertical bar characters. For example: "colors|primary|red".

More Information and Examples
top
GetChildContent
function CkXml_GetChildContent(objHandle: HCkXml;
    tagPath: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkXml__getChildContent(objHandle: HCkXml;
    tagPath: PWideChar): PWideChar; stdcall;

Returns the content of a child having a specified tag. The tagPath can be a tag or a tag path.

Beginning in version 9.5.0.64, the tagPath can be a tag path. A tag path is a series of tags separated by vertical bar characters. For example: "colors|primary|red".

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top
GetChildContentByIndex
function CkXml_GetChildContentByIndex(objHandle: HCkXml;
    index: Integer;
    outStr: HCkString): wordbool; stdcall;
function CkXml__getChildContentByIndex(objHandle: HCkXml;
    index: Integer): PWideChar; stdcall;

Returns the content of the Nth child node.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

top
GetChildContentSb
function CkXml_GetChildContentSb(objHandle: HCkXml;
    tagPath: PWideChar;
    sb: HCkStringBuilder): wordbool; stdcall;
Introduced in version 9.5.0.76

Returns the content of the XML element at the tagPath. The XML element's content is appended to the sb.

Returns True for success, False for failure.

top
GetChildExact
function CkXml_GetChildExact(objHandle: HCkXml;
    tag: PWideChar;
    content: PWideChar): HCkXml; stdcall;

Returns the child having the exact tag and content.

Returns nil on failure

top
GetChildIntValue
function CkXml_GetChildIntValue(objHandle: HCkXml;
    tagPath: PWideChar): Integer; stdcall;

Returns the child integer content for a given tag. The tagPath can be a tag or a tag path.

Beginning in version 9.5.0.64, the tagPath can be a tag path. A tag path is a series of tags separated by vertical bar characters. For example: "colors|primary|red".

More Information and Examples
top
GetChildTag
function CkXml_GetChildTag(objHandle: HCkXml;
    index: Integer;
    outStr: HCkString): wordbool; stdcall;
function CkXml__getChildTag(objHandle: HCkXml;
    index: Integer): PWideChar; stdcall;

Returns the tag name of the Nth child node.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

top
GetChildTagByIndex
function CkXml_GetChildTagByIndex(objHandle: HCkXml;
    index: Integer;
    outStr: HCkString): wordbool; stdcall;
function CkXml__getChildTagByIndex(objHandle: HCkXml;
    index: Integer): PWideChar; stdcall;

Returns the tag name of the Nth child node.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

More Information and Examples
top
GetChildWithAttr
function CkXml_GetChildWithAttr(objHandle: HCkXml;
    tagPath: PWideChar;
    attrName: PWideChar;
    attrValue: PWideChar): HCkXml; stdcall;

Finds and returns the XML child node having both a given tag and an attribute with a given name and value.

Beginning in version 9.5.0.64, the tagPath can be a tag path. A tag path is a series of tags separated by vertical bar characters. For example: "tagA|tagB|tagC".

Returns nil on failure

More Information and Examples
top
GetChildWithContent
function CkXml_GetChildWithContent(objHandle: HCkXml;
    content: PWideChar): HCkXml; stdcall;

Returns the first child found having the exact content specified.

Returns nil on failure

top
GetChildWithTag
function CkXml_GetChildWithTag(objHandle: HCkXml;
    tagPath: PWideChar): HCkXml; stdcall;

Returns the child at the specified tag or tag path.

Beginning in version 9.5.0.64, the tagPath can be a tag path. A tag path is a series of tags separated by vertical bar characters. For example: "tagA|tagB|tagC".

Returns nil on failure

top
GetNthChildWithTag
function CkXml_GetNthChildWithTag(objHandle: HCkXml;
    tag: PWideChar;
    n: Integer): HCkXml; stdcall;

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.

Returns nil on failure

top
GetNthChildWithTag2
function CkXml_GetNthChildWithTag2(objHandle: HCkXml;
    tag: PWideChar;
    n: Integer): wordbool; stdcall;

Updates the calling object's internal reference to the Nth child node having a specific tag.

Returns True for success, False for failure.

top
GetParent
function CkXml_GetParent(objHandle: HCkXml): HCkXml; stdcall;

Returns the parent of this XML node, or NULL if the node is the root of the tree.

Returns nil on failure

top
GetParent2
function CkXml_GetParent2(objHandle: HCkXml): wordbool; stdcall;

Updates the internal reference of the caller to its parent.

Returns True for success, False for failure.

top
GetRoot
function CkXml_GetRoot(objHandle: HCkXml): HCkXml; stdcall;

Returns the root node of the XML document

Returns nil on failure

top
GetRoot2
procedure CkXml_GetRoot2(objHandle: HCkXml) stdcall;

Updates the internal reference of the caller to the document root.

top
GetSelf
function CkXml_GetSelf(objHandle: HCkXml): HCkXml; stdcall;

Returns a new XML object instance that references the same XML node.

Returns nil on failure

top
GetXml
function CkXml_GetXml(objHandle: HCkXml;
    outStr: HCkString): wordbool; stdcall;
function CkXml__getXml(objHandle: HCkXml): PWideChar; stdcall;

Generate the XML text document for the XML tree rooted at this node. If called from the root node of the XML document, then the XML declarator ("<?xml version="1.0" encoding="utf-8" ?>") is included at the beginning of the XML. Otherwise, it is not included.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

top
GetXmlBd
function CkXml_GetXmlBd(objHandle: HCkXml;
    bd: HCkBinData): wordbool; stdcall;
Introduced in version 9.5.0.77

Emits (appends) the XML to the contents of bd.

Returns True for success, False for failure.

top
GetXmlSb
function CkXml_GetXmlSb(objHandle: HCkXml;
    sb: HCkStringBuilder): wordbool; stdcall;
Introduced in version 9.5.0.62

Emits the XML to a StringBuilder object. (Appends to the existing contents of sb.)

Returns True for success, False for failure.

top
HasAttribute
function CkXml_HasAttribute(objHandle: HCkXml;
    name: PWideChar): wordbool; stdcall;

Returns true if the node contains an attribute with the specified name.

top
HasAttrWithValue
function CkXml_HasAttrWithValue(objHandle: HCkXml;
    name: PWideChar;
    value: PWideChar): wordbool; stdcall;

Returns true if the node contains attribute with the name and value.

top
HasChildWithContent
function CkXml_HasChildWithContent(objHandle: HCkXml;
    content: PWideChar): wordbool; stdcall;

Returns true if the node has a direct child node containing the exact content string specified.

top
HasChildWithTag
function CkXml_HasChildWithTag(objHandle: HCkXml;
    tagPath: PWideChar): wordbool; stdcall;

Returns True if the node has a child with the given tag (or tag path). Otherwise returns False.

Beginning in version 9.5.0.64, the tagPath can be a tag path. A tag path is a series of tags separated by vertical bar characters. For example: "tagA|tagB|tagC".

More Information and Examples
top
HasChildWithTagAndContent
function CkXml_HasChildWithTagAndContent(objHandle: HCkXml;
    tagPath: PWideChar;
    content: PWideChar): wordbool; stdcall;

Returns True if the node contains child with the given tag (or tag path) and content specified.

Beginning in version 9.5.0.64, the tagPath can be a tag path. A tag path is a series of tags separated by vertical bar characters. For example: "tagA|tagB|tagC".

top
InsertChildTreeAfter
procedure CkXml_InsertChildTreeAfter(objHandle: HCkXml;
    index: Integer;
    tree: HCkXml) stdcall;

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).

top
InsertChildTreeBefore
procedure CkXml_InsertChildTreeBefore(objHandle: HCkXml;
    index: Integer;
    tree: HCkXml) stdcall;

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).

More Information and Examples
top
LastChild
function CkXml_LastChild(objHandle: HCkXml): HCkXml; stdcall;

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.

Returns nil on failure

top
LastChild2
function CkXml_LastChild2(objHandle: HCkXml): wordbool; stdcall;

Updates the internal reference of the caller to its last child.

Returns True for success, False for failure.

top
LoadBd
function CkXml_LoadBd(objHandle: HCkXml;
    bd: HCkBinData;
    autoTrim: wordbool): wordbool; stdcall;
Introduced in version 9.5.0.77

Loads XML from the contents of bd. If autoTrim is True, then each element's text content is trimmed of leading and trailing whitespace.

Returns True for success, False for failure.

top
LoadSb
function CkXml_LoadSb(objHandle: HCkXml;
    sb: HCkStringBuilder;
    autoTrim: wordbool): wordbool; stdcall;
Introduced in version 9.5.0.62

Loads XML from the contents of a StringBuilder object.

Returns True for success, False for failure.

More Information and Examples
top
LoadXml
function CkXml_LoadXml(objHandle: HCkXml;
    xmlData: PWideChar): wordbool; stdcall;

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.

Returns True for success, False for failure.

top
LoadXml2
function CkXml_LoadXml2(objHandle: HCkXml;
    xmlData: PWideChar;
    autoTrim: wordbool): wordbool; stdcall;

Same as LoadXml, but an additional argument controls whether or not leading/trailing whitespace is auto-trimmed from each leaf node's content.

Returns True for success, False for failure.

More Information and Examples
top
LoadXmlFile
function CkXml_LoadXmlFile(objHandle: HCkXml;
    fileName: PWideChar): wordbool; stdcall;

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.

Returns True for success, False for failure.

top
LoadXmlFile2
function CkXml_LoadXmlFile2(objHandle: HCkXml;
    fileName: PWideChar;
    autoTrim: wordbool): wordbool; stdcall;

Same as LoadXmlFile, but an additional argument controls whether or not leading/trailing whitespace is auto-trimmed from each leaf node's content.

Returns True for success, False for failure.

More Information and Examples
top
NewChild
function CkXml_NewChild(objHandle: HCkXml;
    tagPath: PWideChar;
    content: PWideChar): HCkXml; stdcall;

Creates a new child having tag and content. The new child is created even if a child with a tag equal to tagPath already exists. (Use FindOrAddNewChild to prevent creating children having the same tags.)

Beginning in version 9.5.0.64, the tagPath can be a tag path. A tag path is a series of tags separated by vertical bar characters. For example: "colors|primary|red". See the example below for details.

Returns nil on failure

top
NewChild2
procedure CkXml_NewChild2(objHandle: HCkXml;
    tagPath: PWideChar;
    content: PWideChar) stdcall;

Creates a new child node, but does not return the node that is created. The tagPath can be a tag or a tag path.

Beginning in version 9.5.0.64, the tagPath can be a tag path. A tag path is a series of tags separated by vertical bar characters. For example: "colors|primary|red". See the example below for details.

top
NewChildAfter
function CkXml_NewChildAfter(objHandle: HCkXml;
    index: Integer;
    tag: PWideChar;
    content: PWideChar): HCkXml; stdcall;

Inserts a new child in a position after the Nth child node.

Returns nil on failure

More Information and Examples
top
NewChildBefore
function CkXml_NewChildBefore(objHandle: HCkXml;
    index: Integer;
    tag: PWideChar;
    content: PWideChar): HCkXml; stdcall;

Inserts a new child in a position before the Nth child node.

Returns nil on failure

More Information and Examples
top
NewChildInt2
procedure CkXml_NewChildInt2(objHandle: HCkXml;
    tagPath: PWideChar;
    value: Integer) stdcall;

Inserts a new child having an integer for content. The tagPath can be a tag or a tag path.

Beginning in version 9.5.0.64, the tagPath can be a tag path. A tag path is a series of tags separated by vertical bar characters. For example: "colors|primary|red". See the example below for details.

More Information and Examples
top
NextInTraversal2
function CkXml_NextInTraversal2(objHandle: HCkXml;
    sbState: HCkStringBuilder): wordbool; stdcall;
Introduced in version 9.5.0.77

Updates to Xml object's internal reference to the next node in a depth-first traversal. (This method name, NextInTraversal2, ends with "2" to signify that the internal reference is updated. There is no "NextInTraversal" method.)

The sbState contains the current state of the traversal. sbState should be empty when beginning a traversal.

More Information and Examples
top
NextSibling
function CkXml_NextSibling(objHandle: HCkXml): HCkXml; stdcall;

Returns the nodes next sibling, or NULL if there are no more.

Returns nil on failure

top
NextSibling2
function CkXml_NextSibling2(objHandle: HCkXml): wordbool; stdcall;

Updates the internal reference of the caller to its next sibling.

Returns True for success, False for failure.

top
NumChildrenAt
function CkXml_NumChildrenAt(objHandle: HCkXml;
    tagPath: PWideChar): Integer; stdcall;
Introduced in version 9.5.0.64

Returns the number of children for the node indicated by tagPath. Returns -1 if the node at tagPath does not exist.

top
NumChildrenHavingTag
function CkXml_NumChildrenHavingTag(objHandle: HCkXml;
    tag: PWideChar): Integer; stdcall;

Returns the number of children having a specific tag name.

top
PreviousSibling
function CkXml_PreviousSibling(objHandle: HCkXml): HCkXml; stdcall;

Returns the Xml object that is the node's previous sibling, or NULL if there are no more.

Returns nil on failure

top
PreviousSibling2
function CkXml_PreviousSibling2(objHandle: HCkXml): wordbool; stdcall;

Updates the internal reference of the caller to its previous sibling.

Returns True for success, False for failure.

top
PruneAttribute
function CkXml_PruneAttribute(objHandle: HCkXml;
    attrName: PWideChar): Integer; stdcall;
Introduced in version 9.5.0.77

Recursively descends the XML from this node and removes all occurrences of the specified attribute. Returns the number of attribute occurrences removed.

top
PruneTag
function CkXml_PruneTag(objHandle: HCkXml;
    tag: PWideChar): Integer; stdcall;
Introduced in version 9.5.0.77

Recursively descends the XML from this node and removes all occurrences of the specified tag, including all descendents of each removed node. Returns the number of tag occurrences removed.

More Information and Examples
top
QEncodeContent
function CkXml_QEncodeContent(objHandle: HCkXml;
    charset: PWideChar;
    inData: HCkByteData): wordbool; stdcall;

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.

Returns True for success, False for failure.

top
RemoveAllAttributes
function CkXml_RemoveAllAttributes(objHandle: HCkXml): wordbool; stdcall;

Removes all attributes from an XML node. Should always return True.

Returns True for success, False for failure.

top
RemoveAllChildren
procedure CkXml_RemoveAllChildren(objHandle: HCkXml) stdcall;

Removes all children from the calling node.

top
RemoveAttribute
function CkXml_RemoveAttribute(objHandle: HCkXml;
    name: PWideChar): wordbool; stdcall;

Removes an attribute by name from and XML node.

Returns True for success, False for failure.

top
RemoveChild
procedure CkXml_RemoveChild(objHandle: HCkXml;
    tagPath: PWideChar) stdcall;

Removes all children with a given tag or tag path.

Beginning in version 9.5.0.64, the tagPath can be a tag path. A tag path is a series of tags separated by vertical bar characters. For example: "tagA|tagB|tagC".

top
RemoveChildByIndex
procedure CkXml_RemoveChildByIndex(objHandle: HCkXml;
    index: Integer) stdcall;

Removes the Nth child from the calling node.

More Information and Examples
top
RemoveChildWithContent
procedure CkXml_RemoveChildWithContent(objHandle: HCkXml;
    content: PWideChar) stdcall;

Removes all children having the exact content specified.

More Information and Examples
top
RemoveFromTree
procedure CkXml_RemoveFromTree(objHandle: HCkXml) stdcall;

Removes the calling object and its sub-tree from the XML document making it the root of its own tree.

More Information and Examples
top
RemoveStyleSheet
function CkXml_RemoveStyleSheet(objHandle: HCkXml;
    attrName: PWideChar;
    attrValue: PWideChar): Integer; stdcall;
Introduced in version 9.5.0.77

Removes all XML stylesheets having an attribute with attrName equal to attrValue. Returns the number of stylesheets removed, or -1 if there was an error.

top
SaveBinaryContent
function CkXml_SaveBinaryContent(objHandle: HCkXml;
    filename: PWideChar;
    unzipFlag: wordbool;
    decryptFlag: wordbool;
    password: PWideChar): wordbool; stdcall;

Saves a node's binary content to a file.

Returns True for success, False for failure.

top
SaveXml
function CkXml_SaveXml(objHandle: HCkXml;
    fileName: PWideChar): wordbool; stdcall;

Generates XML representing the tree or subtree rooted at this node and writes it to a file.

Returns True for success, False for failure.

top
Scrub
procedure CkXml_Scrub(objHandle: HCkXml;
    directives: PWideChar) stdcall;
Introduced in version 9.5.0.77

Recursively traverses the XML rooted at the caller and scrubs according to the instructions in the comma separated directives. The currently defined directives are:

  • "AttrTrimEnds" - Leading and trailing whitespace removed from attribute values.
  • "AttrTrimInside" - Replace all tabs, CR's, and LF's with SPACE chars, and removes extra SPACE chars so that no more than one SPACE char in a row exists.
  • "ContentTrimEnds" - Same as AttrTrimEnds but for content.
  • "ContentTrimInside" - Same as AttrTrimInside but for content.
  • "LowercaseAttrs" - Convert all attribute names to lowercase.
  • "LowercaseTags" - Convert all tags to lowercase.
  • "RemoveCtrl" - Remove non-printable us-ascii control chars (us-ascii values <= 31 except for TAB,CR, and LF are removed)

If you have other ideas for useful XML scrubbing directives, send email to support@chilkatsoft.com. It must be general enough such that many developers will find it useful.

More Information and Examples
top
SearchAllForContent
function CkXml_SearchAllForContent(objHandle: HCkXml;
    afterPtr: HCkXml;
    contentPattern: PWideChar): HCkXml; stdcall;

Returns the first node having content matching the contentPattern. The contentPattern is a case-sensitive string that may contain any number of '*'s, each representing 0 or more occurrences of any character. The search is breadth-first over the sub-tree rooted at the caller. A match is returned only after the search has traversed past the node indicated by afterPtr. To find the 1st occurrence, set afterPtr equal to nil. (For the ActiveX implementation, the afterPtr should never be nil. A reference to the caller's node should be passed instead.)

To iterate over matching nodes, the returned node can be passed in afterPtr for the next call to SearchAllForContent, until the method returns nil.

Returns nil on failure

More Information and Examples
top
SearchAllForContent2
function CkXml_SearchAllForContent2(objHandle: HCkXml;
    afterPtr: HCkXml;
    contentPattern: PWideChar): wordbool; stdcall;

Same as SearchAllForContent except the internal reference of the caller is updated to point to the search result (instead of returning a new object).

Returns True for success, False for failure.

top
SearchForAttribute
function CkXml_SearchForAttribute(objHandle: HCkXml;
    afterPtr: HCkXml;
    tag: PWideChar;
    attr: PWideChar;
    valuePattern: PWideChar): HCkXml; stdcall;

Returns the first node having a tag equal to tag, an attribute named attr, whose value matches valuePattern. The valuePattern is a case-sensitive string that may contain any number of '*'s, each representing 0 or more occurrences of any character. The search is breadth-first over the sub-tree rooted at the caller. A match is returned only after the search has traversed past the node indicated by afterPtr. To find the 1st occurrence, set afterPtr equal to nil. (For the ActiveX implementation, the afterPtr should never be nil. A reference to the caller's node should be passed instead.)

To iterate over matching nodes, the returned node can be passed in afterPtr for the next call to SearchForAttribute, until the method returns nil.

Returns nil on failure

top
SearchForAttribute2
function CkXml_SearchForAttribute2(objHandle: HCkXml;
    afterPtr: HCkXml;
    tag: PWideChar;
    attr: PWideChar;
    valuePattern: PWideChar): wordbool; stdcall;

Same as SearchForAttribute except the internal reference of the caller is updated to point to the search result (instead of returning a new object).

Returns True for success, False for failure.

top
SearchForContent
function CkXml_SearchForContent(objHandle: HCkXml;
    afterPtr: HCkXml;
    tag: PWideChar;
    contentPattern: PWideChar): HCkXml; stdcall;

Returns the first node having a tag equal to tag, whose content matches contentPattern. The contentPattern is a case-sensitive string that may contain any number of '*'s, each representing 0 or more occurrences of any character. The search is breadth-first over the sub-tree rooted at the caller. A match is returned only after the search has traversed past the node indicated by afterPtr. To find the 1st occurrence, set afterPtr equal to nil. (For the ActiveX implementation, the afterPtr should never be nil. A reference to the caller's node should be passed instead.)

To iterate over matching nodes, the returned node can be passed in afterPtr for the next call to SearchForContent, until the method returns nil.

Returns nil on failure

More Information and Examples
top
SearchForContent2
function CkXml_SearchForContent2(objHandle: HCkXml;
    afterPtr: HCkXml;
    tag: PWideChar;
    contentPattern: PWideChar): wordbool; stdcall;

Same as SearchForContent except the internal reference of the caller is updated to point to the search result (instead of returning a new object).

Returns True for success, False for failure.

More Information and Examples
top
SearchForTag
function CkXml_SearchForTag(objHandle: HCkXml;
    afterPtr: HCkXml;
    tag: PWideChar): HCkXml; stdcall;

Returns the first node having a tag equal to tag. The search is breadth-first over the sub-tree rooted at the caller. A match is returned only after the search has traversed past the node indicated by afterPtr. To find the 1st occurrence, set afterPtr equal to nil. (For the ActiveX implementation, the afterPtr should never be nil. A reference to the caller's node should be passed instead.)

To iterate over matching nodes, the returned node can be passed in afterPtr for the next call to SearchForTag, until the method returns nil.

Returns nil on failure

top
SearchForTag2
function CkXml_SearchForTag2(objHandle: HCkXml;
    afterPtr: HCkXml;
    tag: PWideChar): wordbool; stdcall;

Same as SearchForTag except the internal reference of the caller is updated to point to the search result (instead of returning a new object).

Returns True for success, False for failure.

More Information and Examples
top
SetBinaryContent
function CkXml_SetBinaryContent(objHandle: HCkXml;
    inData: HCkByteData;
    zipFlag: wordbool;
    encryptFlag: wordbool;
    password: PWideChar): wordbool; stdcall;

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.

Returns True for success, False for failure.

top
SetBinaryContent2
function CkXml_SetBinaryContent2(objHandle: HCkXml;
    pByteData: pbyte;
    szByteData: LongWord;
    zipFlag: wordbool;
    encryptFlag: wordbool;
    password: PWideChar): wordbool; stdcall;

The same as SetBinaryContent but the data is provided via a pointer and byte count.

top
SetBinaryContentFromFile
function CkXml_SetBinaryContentFromFile(objHandle: HCkXml;
    filename: PWideChar;
    zipFlag: wordbool;
    encryptFlag: wordbool;
    password: PWideChar): wordbool; stdcall;

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.

Returns True for success, False for failure.

top
SortByAttribute
procedure CkXml_SortByAttribute(objHandle: HCkXml;
    attrName: PWideChar;
    ascending: wordbool) stdcall;

Sorts the direct child nodes by the value of a specified attribute.

top
SortByAttributeInt
procedure CkXml_SortByAttributeInt(objHandle: HCkXml;
    attrName: PWideChar;
    ascending: wordbool) stdcall;

Sorts the direct child nodes by the value of a specified attribute interpreted as an integer (not lexicographically as strings).

top
SortByContent
procedure CkXml_SortByContent(objHandle: HCkXml;
    ascending: wordbool) stdcall;

Sorts the direct child nodes by content.

More Information and Examples
top
SortByTag
procedure CkXml_SortByTag(objHandle: HCkXml;
    ascending: wordbool) stdcall;

Sorts the direct child nodes by tag.

More Information and Examples
top
SortRecordsByAttribute
procedure CkXml_SortRecordsByAttribute(objHandle: HCkXml;
    sortTag: PWideChar;
    attrName: PWideChar;
    ascending: wordbool) stdcall;

Sorts the direct child nodes by the content of an attribute in the grandchild nodes.

top
SortRecordsByContent
procedure CkXml_SortRecordsByContent(objHandle: HCkXml;
    sortTag: PWideChar;
    ascending: wordbool) stdcall;

Sorts the direct child nodes by the content of the grandchild nodes.

More Information and Examples
top
SortRecordsByContentInt
procedure CkXml_SortRecordsByContentInt(objHandle: HCkXml;
    sortTag: PWideChar;
    ascending: wordbool) stdcall;

Sorts the direct child nodes by the content of the grandchild nodes. For sorting purposes, the content is interpreted as an integer (not lexicographically as for strings).

top
SwapNode
function CkXml_SwapNode(objHandle: HCkXml;
    node: HCkXml): wordbool; stdcall;

Swaps another node's tag, content, and attributes with this one.

Returns True for success, False for failure.

top
SwapTree
function CkXml_SwapTree(objHandle: HCkXml;
    tree: HCkXml): wordbool; stdcall;

Swaps another node's tag, content, attributes, and children with this one.

Returns True for success, False for failure.

top
TagContent
function CkXml_TagContent(objHandle: HCkXml;
    tagName: PWideChar;
    outStr: HCkString): wordbool; stdcall;
function CkXml__tagContent(objHandle: HCkXml;
    tagName: PWideChar): PWideChar; stdcall;

Returns the content of the 1st node found in the sub-tree rooted at the caller that has a given tag. (Note: The search for the node having tag ARG is not limited to the direct children of the caller.)

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

top
TagEquals
function CkXml_TagEquals(objHandle: HCkXml;
    tag: PWideChar): wordbool; stdcall;

Returns True if the node's tag equals the specified string.

top
TagIndex
function CkXml_TagIndex(objHandle: HCkXml;
    tagPath: PWideChar): Integer; stdcall;
Introduced in version 9.5.0.76

Returns the index of the XML node with the given tag. Returns -1 if no node having the specified tag is found at the tagPath.

More Information and Examples
top
TagNsEquals
function CkXml_TagNsEquals(objHandle: HCkXml;
    ns: PWideChar): wordbool; stdcall;
Introduced in version 9.5.0.77

Returns True if the node's tag namespace prefix equals the specified ns.

More Information and Examples
top
TagUnpEquals
function CkXml_TagUnpEquals(objHandle: HCkXml;
    unprefixedTag: PWideChar): wordbool; stdcall;
Introduced in version 9.5.0.77

Returns True if the node's unprefixed tag equals the specified string. For example, if the tag is "soapenv:Body", the unprefixed tag is "Body".

More Information and Examples
top
UnzipContent
function CkXml_UnzipContent(objHandle: HCkXml): wordbool; stdcall;

Unzip the content of the XML node replacing it's content with the decompressed data.

Returns True for success, False for failure.

More Information and Examples
top
UnzipTree
function CkXml_UnzipTree(objHandle: HCkXml): wordbool; stdcall;

Unzips and recreates the XML node and the entire subtree, restoring it to the state before it was zip compressed.

Returns True for success, False for failure.

More Information and Examples
top
UpdateAt
function CkXml_UpdateAt(objHandle: HCkXml;
    tagPath: PWideChar;
    autoCreate: wordbool;
    value: PWideChar): wordbool; stdcall;
Introduced in version 9.5.0.64

Updates the content for the node indicated by tagPath. If autoCreate is True, then nodes along tagPath are auto-created as needed.

More Information and Examples
top
UpdateAttrAt
function CkXml_UpdateAttrAt(objHandle: HCkXml;
    tagPath: PWideChar;
    autoCreate: wordbool;
    attrName: PWideChar;
    attrValue: PWideChar): wordbool; stdcall;
Introduced in version 9.5.0.64

Updates or adds the attribute value for the node indicated by tagPath. If autoCreate is True, then nodes along tagPath are auto-created as needed.

top
UpdateAttribute
function CkXml_UpdateAttribute(objHandle: HCkXml;
    attrName: PWideChar;
    attrValue: PWideChar): wordbool; stdcall;

Adds an attribute to the node if it doesn't already exist. Otherwise it updates the existing attribute with the new value.

Returns True for success, False for failure.

More Information and Examples
top
UpdateAttributeInt
function CkXml_UpdateAttributeInt(objHandle: HCkXml;
    attrName: PWideChar;
    value: Integer): wordbool; stdcall;

Updates an attribute value. (Call UpdateAttribute if the attribute value is a string.)

Returns True for success, False for failure.

top
UpdateChildContent
procedure CkXml_UpdateChildContent(objHandle: HCkXml;
    tagPath: PWideChar;
    value: PWideChar) stdcall;

Replaces the content of a child node. The tagPath can be a tag or tag path.

Beginning in version 9.5.0.64, the tagPath can be a tag path. A tag path is a series of tags separated by vertical bar characters. For example: "tagA|tagB|tagC". The nodes in the tagPath are automatically created as needed.

top
UpdateChildContentInt
procedure CkXml_UpdateChildContentInt(objHandle: HCkXml;
    tagPath: PWideChar;
    value: Integer) stdcall;

Replaces the content of a child node where the content is an integer. The tagPath can be a tag or tag path.

Beginning in version 9.5.0.64, the tagPath can be a tag path. A tag path is a series of tags separated by vertical bar characters. For example: "tagA|tagB|tagC".

top
ZipContent
function CkXml_ZipContent(objHandle: HCkXml): wordbool; stdcall;

Applies Zip compression to the content of an XML node and replaces the content with base64-encoded compressed data.

Returns True for success, False for failure.

More Information and Examples
top
ZipTree
function CkXml_ZipTree(objHandle: HCkXml): wordbool; stdcall;

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.

Returns True for success, False for failure.

More Information and Examples
top