Xml Delphi DLL Reference Documentation

Xml

Current Version: 11.5.0

Chilkat.Xml

Load, navigate, search, edit, transform, and save in-memory XML trees.

Chilkat.Xml is the primary Chilkat class for in-memory XML tree manipulation. It supports loading and saving XML, navigating between elements, reading and writing text content, managing attributes, working with namespaces, adding and removing subtrees, searching by tag, content, or attribute, sorting child records, scrubbing XML, handling CDATA and XML declarations, storing binary data as Base64, and optionally compressing or encrypting element content.

Load and save XML

Load XML from strings, files, byte data, or other Chilkat objects, then save or emit formatted XML when processing is complete.

Navigate XML trees

Move through parent, child, sibling, and selected elements while working directly with the XML document structure.

Edit elements and attributes

Add, update, remove, or rename elements; set text content; and read, add, modify, or delete attributes.

Search and select

Locate elements by tag name, content, path, attribute value, or custom search patterns.

Namespaces and structure

Work with namespace-aware XML, declarations, CDATA, child ordering, sorting, and subtree insertion or removal.

Binary and protected content

Store binary data as Base64 and optionally compress or encrypt element content when XML carries encoded payloads.

Important usage distinction: Some methods return a new Xml object reference for the selected element, while methods ending in 2 update the caller's internal reference to point to a different element. This distinction is central when navigating and editing XML trees because it determines whether the current object stays where it is or moves to another element.
Common pattern: Load or create the XML document, navigate to the element of interest, read or modify content and attributes, add or remove child elements as needed, then save the updated XML. Use Chilkat.Xml for tree-oriented XML manipulation, and use Chilkat.XmlDSig, Chilkat.XmlDSigGen, or related classes when the task is XML digital signing or signature verification.

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;

Controls how this element's text content is emitted. When set to True, the element content is written inside a CDATA section instead of being emitted as ordinary character data with XML escaping.

CDATA and escaping: CDATA is useful when text contains many characters such as < or &. It does not change the logical text value of the element; it only changes how that text is represented in the serialized XML.

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;

Gets or sets the text content stored directly on this XML element. Child elements are not included in this value.

For example, both of the following elements have This is the content as their Content:

<tag1>This is the content</tag1>

<tag2><child1>abc</child1><child2>abc</child2>This is the content</tag2>
Content vs. children: Chilkat stores an element's direct text content separately from its child elements. Use the child-navigation methods when you need the nested elements themselves.

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;

Gets or sets this element's content as a 32-bit integer. Setting the property converts the integer to its decimal text representation; getting the property interprets the element's text content as an integer.

Numeric content: Use Content when the value may exceed the range of a 32-bit integer or when the exact lexical representation must be preserved.

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, this property logs the LastErrorText of each Chilkat method or property call to the specified file. This logging helps identify the context and history of Chilkat calls leading up to any crash or hang, aiding in debugging.

Enabling the VerboseLogging property provides more detailed information. This property is mainly used for debugging rare instances where a Chilkat method call causes a hang or crash, which should generally not happen.

Possible causes of hangs include:

  • A timeout property set to 0, indicating an infinite timeout.
  • A hang occurring within an event callback in the application code.
  • An internal bug in the Chilkat code causing 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;

Gets or sets the document type declaration associated with the XML document.

The value represents the document-level DOCTYPE declaration, for example <!DOCTYPE note SYSTEM "note.dtd">.

Document-level setting: Although this property may be accessed from any element reference in the tree, the DOCTYPE belongs to the XML document as a whole rather than to an individual element.

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

Controls whether a byte order mark (BOM, also called a preamble) is written when XML is saved to a file. The default is False.

This setting is relevant to encodings for which a BOM can be emitted, such as UTF-8 and UTF-16. It does not affect XML returned as a language string by methods such as GetXml.

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

Controls whether XML emitted by GetXml and GetXmlSb is compact. When True, unnecessary formatting whitespace and line breaks are omitted. The default is False for backward compatibility.

Formatting only: Compact output changes presentation, not the XML tree or its element content.

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

Controls whether the XML declaration is included when XML is emitted. The default is True. When set to False, output methods such as GetXml and SaveXml omit the declaration.

An XML declaration is the leading construct such as <?xml version="1.0" encoding="utf-8"?>.

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;

Gets or sets the encoding value used in the XML declaration. The default is utf-8. This is a document-level setting and may be accessed from any element in the tree.

When XML is loaded, Chilkat sets this property from the encoding declared by the input XML when one is present. If no encoding is declared, the property is reset to utf-8.

Important: Changing Encoding changes the declared/output encoding used when XML is serialized; it does not reinterpret or transcode the already-stored Unicode text inside the in-memory tree.

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

Provides a substitution value for [i] in Chilkat tag paths and ChilkatPath expressions. When a path contains [i], the current value of this property is substituted for I.

Loop-friendly paths: The I, J, and K properties make it convenient to reuse a path expression inside nested loops without constructing a new path string for every index.

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

Returns True if this element's content consists only of characters allowed in standard Base64 text, with whitespace ignored. Standard Base64 uses A-Z, a-z, 0-9, +, /, and optional trailing = padding.

Syntax check, not semantic validation: A value can contain only Base64 characters and still not represent the data your application expects. This property is useful as a quick content-format test.

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

Provides a substitution value for [j] in Chilkat tag paths and ChilkatPath expressions. When a path contains [j], the current value of this property is substituted for J.

Loop-friendly paths: The I, J, and K properties make it convenient to reuse a path expression inside nested loops without constructing a new path string for every index.

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

Provides a substitution value for [k] in Chilkat tag paths and ChilkatPath expressions. When a path contains [k], the current value of this property is substituted for K.

Loop-friendly paths: The I, J, and K properties make it convenient to reuse a path expression inside nested loops without constructing a new path string for every index.

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

Provides HTML-formatted information about the last called method or property. If a method call fails or behaves unexpectedly, check this property for details. Note that information is available regardless of the method call's success.

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 plain text information about the last called method or property. If a method call fails or behaves unexpectedly, check this property for details. Note that information is available regardless of the method call's success.

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 XML-formatted information about the last called method or property. If a method call fails or behaves unexpectedly, check this property for details. Note that information is available regardless of the method call's success.

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;

Indicates the success or failure of the most recent method call: True means success, False means failure. This property remains unchanged by property setters or getters. This method is present to address challenges in checking for null or Nothing returns in certain programming languages. Note: This property does not apply to methods that return integer values or to boolean-returning methods where the boolean does not indicate success or failure.

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

Returns the number of attributes on this element.

For example, <tag attr1="value1" attr2="value2">...</tag> has two attributes. Attribute indexes used by methods such as GetAttributeName and GetAttributeValue are zero-based.

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

Returns the number of direct child elements of this element. Descendants below those children are not included in the count.

Direct children only: Use traversal or search methods when you need to inspect the entire subtree rather than only the immediate children.

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

Controls case sensitivity for the XML sorting methods. Set to True for case-insensitive string comparisons or False for case-sensitive comparisons.

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

Controls the standalone pseudo-attribute in the XML declaration. This is a document-level setting and may be accessed from any element in the tree.

Setting this property to True causes the declaration to include standalone="yes".

XML declaration: The standalone declaration concerns whether the document relies on external markup declarations. It is metadata in the XML declaration; it does not by itself validate or alter the document.

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;

Gets or sets the element name for this element, including any namespace prefix. For example, the tag for <soapenv:Body> is soapenv:Body.

Use TagNsPrefix and TagUnprefixed when the prefix and local portion are needed separately.

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

Gets or sets the namespace prefix portion of this element's tag. For soapenv:Envelope, the namespace prefix is soapenv.

Prefix vs. namespace URI: This property deals with the lexical prefix in the tag name. A prefix is not itself the namespace URI; namespace bindings are expressed through xmlns attributes in the XML.

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 Chilkat tag path needed to reach this element from the document root. If this object currently references the root element, the returned path is the empty string.

Not XPath: A Chilkat tag path is Chilkat's own navigation syntax, typically using | between element names. It is not an XPath expression.

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

Gets or sets the unprefixed portion of this element's tag. For soapenv:Envelope, the unprefixed tag is Envelope.

Use TagNsPrefix to access the prefix separately.

See the notes about PWideChar memory ownership and validity.

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

Returns the identifier of the XML tree to which this element belongs. Elements in the same XML document have the same TreeId.

Useful for element references: Multiple Xml objects can reference different elements in the same underlying tree. Comparing TreeId values is a convenient way to determine whether two element references belong to that 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

Provides a catch-all string for uncommon XML behaviors. The default is the empty string, which is appropriate for normal use.

Leave this property empty unless Chilkat documentation or support identifies a specific option needed for a specialized interoperability case.

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

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;

Traverses the subtree rooted at the calling element and concatenates the text content of all elements whose tag equals tag.

skipTags is a vertical-bar-delimited list of tag names whose entire subtrees are excluded from the accumulation. For example, script|style skips elements rooted at either of those tags.

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 named name with the specified string value to the calling element.

Returns True on success and False on failure.

When an attribute may already exist: Use AddOrUpdateAttribute or UpdateAttribute when the desired behavior is to update an existing attribute value instead of requiring a new attribute.

Returns True for success, False for failure.

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

Adds an attribute named name whose value is the decimal representation of value.

Returns True on success and False on failure.

Returns True for success, False for failure.

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

Adds the entire XML subtree referenced by tree as a new direct child of the calling element.

If tree already belongs to another XML document, the subtree is transferred to the destination tree rather than copied as an unrelated duplicate.

Tree ownership: After moving a subtree between documents, its elements belong to the destination tree. TreeId can be used to determine which tree an element reference belongs to.

Returns True for success, False for failure.

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

Sets the string value of an attribute on the calling element. If an attribute named name already exists, its value is replaced; otherwise the attribute is added.

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

Sets an integer-valued attribute on the calling element. If an attribute named name already exists, its value is replaced with the decimal representation of value; otherwise the attribute is added.

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

Adds an XML stylesheet processing instruction to the document. Pass the complete processing-instruction text, for example:

<?xml-stylesheet href="mystyle.css" title="Compact" type="text/css"?>
Processing instruction: An XML stylesheet declaration associates stylesheet metadata with the XML document; it does not apply or execute the stylesheet.

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

Treats the named attribute value as an integer, adds amount, and stores the resulting integer back in the attribute.

If the attribute does not yet exist, this method behaves like AddOrUpdateAttributeI and creates it with amount as the value.

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

Finds the child identified by tag, interprets its content as an integer, adds amount, and stores the resulting integer as the child's new content.

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

Interprets this element's content as an integer, adds amount, and stores the resulting integer as the new content.

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

Appends str to the existing text content of the calling element without replacing its child elements.

Returns True on success and False on failure.

Returns True for success, False for failure.

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

Returns True if the child identified by tagPath has content matching pattern; otherwise returns False. caseSensitive controls whether letter case is significant.

The pattern may contain * wildcards, where each asterisk matches zero or more characters.

Tag paths: A tag path is Chilkat's |-separated child-navigation syntax, for example tagA|tagB|tagC. It is not XPath.

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

Evaluates a Chilkat-specific path command that can navigate from the current element, return element content or an attribute value, or move the caller's internal element reference.

This syntax is not XPath. Commands are separated by vertical bars and the expression ends with a return command:

command|command|command|...|returnCommand

Navigation commands include:

  • TagName — first direct child having that tag.
  • TagName[n] — the indexed direct child having that tag.
  • .. — parent.
  • ++ / -- — next / previous sibling.
  • TagName{Content} — first direct child with that tag and exact content.
  • /T/TagName — traverse the subtree and find the first element with that tag.
  • /C/TagName,ContentPattern — traverse for a tag whose content matches a wildcard pattern.
  • /C/ContentPattern — traverse for any tag whose content matches a wildcard pattern.
  • /A/TagName,AttrName,AttrValuePattern — traverse for a tag having a matching attribute value.

The final return command is:

  • * — return the current element's content.
  • (AttrName) — return an attribute value.
  • $ — move this Xml object to the selected element and return an empty string.
Index substitution: The I, J, and K properties can be used with [i], [j], and [k] in path expressions.

Returns True for success, False for failure.

See the notes about PWideChar memory ownership and validity.

top
Clear
procedure CkXml_Clear(objHandle: HCkXml) stdcall;

Clears the calling element by removing all child elements, attributes, and text content, and resets its tag name to unnamed.

The element itself remains in the tree; this method clears its contents rather than removing the element from its parent.

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

Returns True if this element's content matches pattern; otherwise returns False. caseSensitive controls whether letter case is significant.

The pattern may contain * wildcards, where each asterisk matches zero or more characters.

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

Copies the Tag, Content, and attributes from node to the calling element.

Not a subtree copy: This method does not copy the source element's children. Use a tree-oriented method such as AddChildTree or SwapTree when child structure is part of the operation.

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

Changes this Xml object so that it references the same underlying XML element as copyFromNode. The caller's previous element reference is discarded.

Reference operation: CopyRef does not copy XML data. After the call, both Xml objects refer to the same element, so edits through either reference affect the same tree element.

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

Decodes HTML character entities found in str and returns the decoded text. This is a utility operation; it does not modify the XML tree unless the returned string is assigned to an element.

For example, an HTML entity such as &amp; is decoded to &.

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 element content previously produced by EncryptContent, using the same password, and restores the original plaintext content.

Returns True on success and False on failure.

Compatibility-oriented encryption: This method is paired specifically with EncryptContent. It is not a general XML Encryption (XML-Enc) implementation.

Returns True for success, False for failure.

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

Encrypts the calling element's text content using Chilkat's password-based 128-bit AES-CBC format and replaces the plaintext content with Base64-encoded encrypted data.

Returns True on success and False on failure.

Scope: Only this element's content is encrypted. The tag, attributes, and child elements are not encrypted by this method. Use DecryptContent with the same password to restore the content.

Returns True for success, False for failure.

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

Removes the direct child at zero-based index from the calling element and returns an Xml object for the detached child subtree.

Extract vs. remove: Unlike RemoveChildByIndex, extraction gives the caller a reference to the removed subtree so it can be retained, inspected, or attached elsewhere.

Returns nil on failure

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

Finds, removes, and returns the first child selected by tagPath and the optional attribute criteria.

If attrName and attrValue are empty, the first child matching the tag/path is extracted. If attrName is provided, the child must have that attribute. If attrValue is also provided, the attribute value must match exactly.

Tag paths: A tag path is Chilkat's |-separated child-navigation syntax, for example tagA|tagB|tagC. It is not XPath.

Returns nil on failure

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

Returns an Xml object referencing the child selected by tagPath. The calling object remains positioned on its current element.

Tag paths: A tag path is Chilkat's |-separated child-navigation syntax, for example tagA|tagB|tagC. It is not XPath.
Element-reference behavior: Methods that return an Xml object return another object referencing an element in the same underlying tree. Methods whose names end in 2 instead move the caller's internal reference.

Returns nil on failure

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

Moves the calling Xml object's internal reference to the child selected by tagPath. Returns True when the child is found and the move succeeds; otherwise returns False.

Tag paths: A tag path is Chilkat's |-separated child-navigation syntax, for example tagA|tagB|tagC. It is not XPath.
Element-reference behavior: Methods that return an Xml object return another object referencing an element in the same underlying tree. Methods whose names end in 2 instead move the caller's internal reference.

Returns True for success, False for failure.

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

Finds the next direct child record for which the descendant identified by tagPath has content matching contentPattern. This is intended for iterating record-like child elements.

The content pattern may contain * wildcards.

Tag paths: A tag path is Chilkat's |-separated child-navigation syntax, for example tagA|tagB|tagC. It is not XPath.

Returns nil on failure

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

Returns the child selected by tagPath if it already exists. If it does not exist, creates the required child path with empty content and returns the resulting child element.

Tag paths: A tag path is Chilkat's |-separated child-navigation syntax, for example tagA|tagB|tagC. It is not XPath. Use NewChild instead when duplicate children with the same tag are intentional.

Returns nil on failure

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

Returns an Xml object referencing the first direct child of the calling element.

A common forward-iteration pattern is FirstChild followed by repeated calls to NextSibling.

Element-reference behavior: Methods that return an Xml object return another object referencing an element in the same underlying tree. Methods whose names end in 2 instead move the caller's internal reference.

Returns nil on failure

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

Moves the calling Xml object's internal reference to its first direct child. Returns True if a first child exists; otherwise returns False.

Element-reference behavior: Methods that return an Xml object return another object referencing an element in the same underlying tree. Methods whose names end in 2 instead move the caller's internal reference.

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 attribute at zero-based index. Use NumAttributes to determine the valid index range.

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 attribute at zero-based index. Use NumAttributes to determine the valid index range.

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 the value of the attribute at zero-based index, interpreted as a 32-bit integer.

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

Returns the value of the attribute named name on the calling element.

Use HasAttribute when the application must distinguish a missing attribute from an attribute whose value is empty.

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 the value of the attribute named name interpreted as a 32-bit integer. Returns 0 if the attribute does not exist.

Ambiguous zero: Because a missing attribute and an attribute containing zero can both yield 0, call HasAttribute first when that distinction matters.

More Information and Examples
top
GetChild
function CkXml_GetChild(objHandle: HCkXml;
    index: Integer): HCkXml; stdcall;

Returns an Xml object referencing the direct child at zero-based index. The calling object remains positioned on its current element.

Use NumChildren to determine the valid child range.

Element-reference behavior: Methods that return an Xml object return another object referencing an element in the same underlying tree. Methods whose names end in 2 instead move the caller's internal reference.

Returns nil on failure

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

Moves the calling Xml object's internal reference to the direct child at zero-based index. Returns True on success and False if the child cannot be selected.

Element-reference behavior: Methods that return an Xml object return another object referencing an element in the same underlying tree. Methods whose names end in 2 instead move the caller's internal reference.

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 value of attribute attrName on the descendant element selected by tagPath.

Tag paths: A tag path is Chilkat's |-separated child-navigation syntax, for example tagA|tagB|tagC. It is not XPath.

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 the integer content of the child selected by tagPath as a Boolean value: content equal to 0 yields False; a non-zero integer yields True.

Tag paths: A tag path is Chilkat's |-separated child-navigation syntax, for example tagA|tagB|tagC. It is not XPath.

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 text content of the child selected by tagPath.

Tag paths: A tag path is Chilkat's |-separated child-navigation syntax, for example tagA|tagB|tagC. It is not XPath.
Content only: The returned value is the child element's direct Content; nested child elements are not serialized into this string.

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 text content of the direct child at zero-based index. Use NumChildren to determine the valid range.

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

Finds the element selected by tagPath and appends that element's text content to sb.

The existing contents of the StringBuilder are preserved.

Tag paths: A tag path is Chilkat's |-separated child-navigation syntax, for example tagA|tagB|tagC. It is not XPath.

Returns True on success and False on failure.

Returns True for success, False for failure.

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

Returns the first direct child whose tag equals tag and whose text content exactly equals content.

The calling object remains positioned on its current element.

Returns nil on failure

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

Returns the content of the child selected by tagPath, interpreted as a 32-bit integer.

Tag paths: A tag path is Chilkat's |-separated child-navigation syntax, for example tagA|tagB|tagC. It is not XPath.
Integer range: Use GetChildContent and parse the returned text separately when values may exceed the range of a 32-bit integer.

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 direct child at zero-based index. Use NumChildren to determine the valid index range.

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 direct child at zero-based index. Use NumChildren to determine the valid index range.

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;

Returns the child selected by tagPath that also has an attribute named attrName whose value exactly equals attrValue.

Tag paths: A tag path is Chilkat's |-separated child-navigation syntax, for example tagA|tagB|tagC. It is not XPath.

Returns nil on failure

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

Returns the first direct child whose text content exactly equals content. The child tag may be any value.

Returns nil on failure

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

Returns an Xml object referencing the child selected by tagPath. The calling object remains positioned on its current element.

Tag paths: A tag path is Chilkat's |-separated child-navigation syntax, for example tagA|tagB|tagC. It is not XPath.
Element-reference behavior: Methods that return an Xml object return another object referencing an element in the same underlying tree. Methods whose names end in 2 instead move the caller's internal reference.

Returns nil on failure

top
GetChildWithTag2
function CkXml_GetChildWithTag2(objHandle: HCkXml;
    tagPath: PWideChar): wordbool; stdcall;
Introduced in version 11.1.0

Moves the calling Xml object's internal reference to the child selected by tagPath. Returns True when the child is found and the move succeeds; otherwise returns False.

Tag paths: A tag path is Chilkat's |-separated child-navigation syntax, for example tagA|tagB|tagC. It is not XPath.
Element-reference behavior: Methods that return an Xml object return another object referencing an element in the same underlying tree. Methods whose names end in 2 instead move the caller's internal reference.

Returns True for success, False for failure.

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

Returns the zero-based nth direct child whose tag exactly equals tag. Children with other tag names are ignored when counting matches.

Use NumChildrenHavingTag to determine how many matching children are available.

Returns nil on failure

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

Moves the calling Xml object's internal reference to the zero-based nth direct child whose tag equals tag. Returns True on success and False when no such child exists.

Element-reference behavior: Methods that return an Xml object return another object referencing an element in the same underlying tree. Methods whose names end in 2 instead move the caller's internal reference.

Returns True for success, False for failure.

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

Returns an Xml object referencing this element's parent. Returns no parent when the current element is the document root.

Element-reference behavior: Methods that return an Xml object return another object referencing an element in the same underlying tree. Methods whose names end in 2 instead move the caller's internal reference.

Returns nil on failure

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

Moves the calling Xml object's internal reference to its parent. Returns True if a parent exists; otherwise returns False when already at the root.

Element-reference behavior: Methods that return an Xml object return another object referencing an element in the same underlying tree. Methods whose names end in 2 instead move the caller's internal reference.

Returns True for success, False for failure.

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

Returns an Xml object referencing the root element of the XML tree that contains the current element. The calling object remains positioned on its current element.

Element-reference behavior: Methods that return an Xml object return another object referencing an element in the same underlying tree. Methods whose names end in 2 instead move the caller's internal reference.

Returns nil on failure

top
GetRoot2
procedure CkXml_GetRoot2(objHandle: HCkXml) stdcall;

Moves the calling Xml object's internal reference to the root element of its XML tree.

Element-reference behavior: Methods that return an Xml object return another object referencing an element in the same underlying tree. Methods whose names end in 2 instead move the caller's internal reference.

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

Returns a new Xml object that references the same underlying XML element as the calling object.

Shared element reference: This is not a deep copy. Both objects reference the same element, so changes made through either object are changes to the same XML tree.

Returns nil on failure

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

Serializes the XML tree or subtree rooted at the current element and returns the XML text.

When called while positioned on the document root, the XML declaration is included if EmitXmlDecl is True. When called on a non-root element, only that subtree is emitted and the document declaration is not included.

EmitCompact, Encoding, Standalone, and related document/output properties affect serialization as applicable.

String vs. bytes: A language string is Unicode text. The Encoding declaration describes serialized XML encoding, while actual byte encoding matters when XML is written to a file or byte-oriented destination.

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

Serializes the XML tree or subtree rooted at the current element and appends the encoded XML bytes to bd.

The existing contents of the BinData object are preserved. The XML output encoding is governed by the XML document's output settings, including Encoding.

Returns True on success and False on failure.

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

Serializes the XML tree or subtree rooted at the current element and appends the resulting XML text to sb.

The existing contents of sb are preserved. Output properties such as EmitCompact and EmitXmlDecl apply as appropriate.

Returns True on success and False on failure.

Returns True for success, False for failure.

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

Returns True if the calling element has an attribute named name; otherwise returns False.

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

Returns True if the calling element has an attribute named name whose value exactly equals value; otherwise returns False.

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

Returns True if any direct child has text content exactly equal to content; otherwise returns False.

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

Returns True if the child selected by tagPath exists; otherwise returns False.

Tag paths: A tag path is Chilkat's |-separated child-navigation syntax, for example tagA|tagB|tagC. It is not XPath.

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

Returns True if the child selected by tagPath exists and its text content exactly equals content; otherwise returns False.

Tag paths: A tag path is Chilkat's |-separated child-navigation syntax, for example tagA|tagB|tagC. It is not XPath.

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

Inserts the entire subtree referenced by tree as a direct child immediately after the existing child at zero-based index.

If tree belongs to another XML document, the subtree is transferred to the destination tree.

Structural move: The operation preserves the subtree structure. The supplied tree is not flattened into text content.

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

Inserts the entire subtree referenced by tree as a direct child immediately before the existing child at zero-based index.

If tree belongs to another XML document, the subtree is transferred to the destination tree.

Structural move: The operation preserves the subtree structure. The supplied tree is not flattened into text content.

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

Returns an Xml object referencing the last direct child of the calling element.

A common reverse-iteration pattern is LastChild followed by repeated calls to PreviousSibling.

Element-reference behavior: Methods that return an Xml object return another object referencing an element in the same underlying tree. Methods whose names end in 2 instead move the caller's internal reference.

Returns nil on failure

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

Moves the calling Xml object's internal reference to its last direct child. Returns True if a last child exists; otherwise returns False.

Element-reference behavior: Methods that return an Xml object return another object referencing an element in the same underlying tree. Methods whose names end in 2 instead move the caller's internal reference.

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

Parses XML from the bytes contained in bd and replaces the calling object's current XML tree with the loaded document.

If autoTrim is True, leading and trailing whitespace is removed from each leaf element's text content during loading.

Returns True on success and False on failure.

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

Parses XML from the current contents of sb and replaces the calling object's current XML tree with the loaded document.

If autoTrim is True, leading and trailing whitespace is removed from each leaf element's text content while loading.

Returns True on success and False on failure.

Returns True for success, False for failure.

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

Parses the XML text in xmlData and replaces the calling object's current XML tree content with the loaded document root. Returns True if parsing succeeds.

Replacement operation: A successful load replaces the current document/tree state represented by this object; it does not append the loaded XML beneath the current element.

Returns True for success, False for failure.

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

Parses the XML text in xmlData and replaces the current XML tree, like LoadXml. The autoTrim argument additionally controls whether leading and trailing whitespace is removed from each leaf element's text content while loading.

Whitespace significance: Set autoTrim to False when leading or trailing text whitespace is significant to the application.

Returns True for success, False for failure.

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

Reads and parses an XML document from fileName, replacing the calling object's current XML tree with the loaded document root. Returns True on success.

The file's XML declaration and byte encoding are used as part of normal XML parsing.

Returns True for success, False for failure.

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

Reads and parses an XML document from fileName, replacing the current XML tree. The autoTrim argument controls whether leading and trailing whitespace is removed from each leaf element's text content.

Whitespace significance: Set autoTrim to False when leading or trailing text whitespace must be preserved exactly.

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 and returns a new child at tagPath with the specified text content. A new child is created even when a child with the same tag already exists.

Tag paths: A tag path is Chilkat's |-separated child-navigation syntax, for example tagA|tagB|tagC. It is not XPath. Intermediate elements in a multi-part path are created as needed. Use FindOrAddNewChild when duplicate final children should be avoided.

Returns nil on failure

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

Creates a new child at tagPath with the specified text content, but does not return a separate Xml object for the new element.

Tag paths: A tag path is Chilkat's |-separated child-navigation syntax, for example tagA|tagB|tagC. It is not XPath. Intermediate elements in a multi-part path are created as needed.

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

Creates a new direct child with the specified tag and content, inserts it immediately after the child at zero-based index, and returns the new child element.

Returns nil on failure

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

Creates a new direct child with the specified tag and content, inserts it immediately before the child at zero-based index, and returns the new child element.

Returns nil on failure

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

Creates a new child at tagPath whose content is the decimal representation of value. No separate child object is returned.

Tag paths: A tag path is Chilkat's |-separated child-navigation syntax, for example tagA|tagB|tagC. It is not XPath. Intermediate elements in a multi-part path are created as needed.

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

Moves the calling Xml object to the next element in a depth-first traversal of the tree and updates sbState with the traversal state.

Pass an empty StringBuilder when beginning a traversal, then reuse the same sbState for each subsequent call.

Why the name ends in 2: This method changes the caller's internal element reference. There is no separate NextInTraversal method that returns another Xml object.

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

Returns an Xml object referencing the current element's next sibling, or no object when there is no next sibling.

Element-reference behavior: Methods that return an Xml object return another object referencing an element in the same underlying tree. Methods whose names end in 2 instead move the caller's internal reference.

Returns nil on failure

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

Moves the calling Xml object's internal reference to its next sibling. Returns True if one exists; otherwise returns False.

Element-reference behavior: Methods that return an Xml object return another object referencing an element in the same underlying tree. Methods whose names end in 2 instead move the caller's internal reference.

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 direct children of the element selected by tagPath. Returns -1 if the path does not identify an existing element.

Tag paths: A tag path is Chilkat's |-separated child-navigation syntax, for example tagA|tagB|tagC. It is not XPath.

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

Returns the number of direct children whose tag exactly equals tag. Descendants below those children are not included.

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

Returns an Xml object referencing the current element's previous sibling, or no object when there is no previous sibling.

Element-reference behavior: Methods that return an Xml object return another object referencing an element in the same underlying tree. Methods whose names end in 2 instead move the caller's internal reference.

Returns nil on failure

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

Moves the calling Xml object's internal reference to its previous sibling. Returns True if one exists; otherwise returns False.

Element-reference behavior: Methods that return an Xml object return another object referencing an element in the same underlying tree. Methods whose names end in 2 instead move the caller's internal reference.

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 traverses the subtree rooted at the calling element and removes every occurrence of the attribute named attrName.

Returns the number of attributes removed.

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

Recursively traverses the subtree rooted at the calling element and removes every element whose tag equals tag. Each removed element's entire descendant subtree is removed with it.

Returns the number of matching tag occurrences removed.

Subtree pruning: When a matching parent is removed, its descendants disappear as part of that subtree; this method is intended for structural cleanup rather than text-only removal.

More Information and Examples
top
RemoveAllAttributes
function CkXml_RemoveAllAttributes(objHandle: HCkXml): wordbool; stdcall;

Removes every attribute from the calling element. Returns True on success.

Returns True for success, False for failure.

top
RemoveAllChildren
procedure CkXml_RemoveAllChildren(objHandle: HCkXml) stdcall;

Removes all direct child elements and their subtrees from the calling element. The calling element's own tag, attributes, and text content are retained.

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

Removes the attribute named name from the calling element. Returns True when the operation succeeds.

Returns True for success, False for failure.

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

Removes all child elements selected by tagPath beneath the calling element.

Tag paths: A tag path is Chilkat's |-separated child-navigation syntax, for example tagA|tagB|tagC. It is not XPath.
All matches: This method removes matching children rather than returning a removed subtree. Use an ExtractChild... method when the removed element must be retained.

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

Removes the direct child at zero-based index, including that child's entire subtree.

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

Removes all direct children whose text content exactly equals content, including each removed child's subtree.

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

Detaches the calling element and its entire subtree from its parent. The detached element becomes the root of its own independent XML tree.

Object remains usable: This method removes the subtree from its former document but keeps the calling Xml object referencing the detached subtree.

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 XML stylesheet processing instructions whose attribute named attrName has the value attrValue.

Returns the number of matching stylesheet declarations removed, or -1 if an error occurs.

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

Decodes the binary content stored in this element and writes the resulting bytes to filename. Set unzipFlag and decryptFlag to reverse the transformations originally applied, and supply the corresponding password when decrypting.

Returns True on success and False on failure.

Returns True for success, False for failure.

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

Serializes the XML tree or subtree rooted at the current element and writes it to fileName.

Document/output properties such as Encoding, EmitBom, EmitXmlDecl, and EmitCompact affect the generated output as applicable.

Returns True on success and False on failure.

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 normalizes the XML subtree rooted at the calling element according to the comma-separated keywords in directives.

Supported directives are:

  • AttrTrimEnds — remove leading and trailing whitespace from attribute values.
  • AttrTrimInside — replace tabs, CR, and LF with spaces and collapse repeated spaces inside attribute values.
  • ContentTrimEnds — remove leading and trailing whitespace from element content.
  • ContentTrimInside — normalize internal tabs/line breaks/spaces in element content.
  • LowercaseAttrs — convert attribute names to lowercase.
  • LowercaseTags — convert tag names to lowercase.
  • RemoveCtrl — remove US-ASCII control characters with values 0-31 except TAB, CR, and LF.
Destructive normalization: Scrubbing modifies the tree. Use these options only when the corresponding whitespace, letter case, or control characters are not semantically significant to the application.

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

Returns the first element whose text content matches contentPattern, regardless of tag name.

The search is breadth-first within the subtree rooted at the caller. The afterPtr argument identifies the element after which matching should begin, allowing repeated calls to continue an iteration. To begin at the first candidate, use nil where the language binding permits it; ActiveX callers should pass a reference to the caller's element instead.

Wildcard patterns are case-sensitive and may contain *, where each asterisk matches zero or more characters.

Iteration: Pass the element returned by one call as afterPtr on the next call to continue to the next match. Continue until no further element is returned.

Returns nil on failure

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

Performs the same breadth-first content search as SearchAllForContent, but moves the calling Xml object's internal reference to the matching element instead of returning a separate element object.

The search is breadth-first within the subtree rooted at the caller. The afterPtr argument identifies the element after which matching should begin, allowing repeated calls to continue an iteration. To begin at the first candidate, use nil where the language binding permits it; ActiveX callers should pass a reference to the caller's element instead.

Wildcard patterns are case-sensitive and may contain *, where each asterisk matches zero or more characters.

Element-reference behavior: Methods that return an Xml object return another object referencing an element in the same underlying tree. Methods whose names end in 2 instead move the caller's internal reference.

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 element whose tag equals tag, that has an attribute named attr, and whose attribute value matches valuePattern.

The search is breadth-first within the subtree rooted at the caller. The afterPtr argument identifies the element after which matching should begin, allowing repeated calls to continue an iteration. To begin at the first candidate, use nil where the language binding permits it; ActiveX callers should pass a reference to the caller's element instead.

Wildcard patterns are case-sensitive and may contain *, where each asterisk matches zero or more characters.

Iteration: Pass the previous match as afterPtr to continue searching after that element.

Returns nil on failure

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

Performs the same breadth-first tag/attribute search as SearchForAttribute, but moves the calling Xml object's internal reference to the matching element instead of returning a separate object.

The search is breadth-first within the subtree rooted at the caller. The afterPtr argument identifies the element after which matching should begin, allowing repeated calls to continue an iteration. To begin at the first candidate, use nil where the language binding permits it; ActiveX callers should pass a reference to the caller's element instead.

Wildcard patterns are case-sensitive and may contain *, where each asterisk matches zero or more characters.

Element-reference behavior: Methods that return an Xml object return another object referencing an element in the same underlying tree. Methods whose names end in 2 instead move the caller's internal reference.

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 element whose tag equals tag and whose text content matches contentPattern.

The search is breadth-first within the subtree rooted at the caller. The afterPtr argument identifies the element after which matching should begin, allowing repeated calls to continue an iteration. To begin at the first candidate, use nil where the language binding permits it; ActiveX callers should pass a reference to the caller's element instead.

Wildcard patterns are case-sensitive and may contain *, where each asterisk matches zero or more characters.

Iteration: Pass the previous match as afterPtr to continue searching after that element.

Returns nil on failure

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

Performs the same breadth-first tag/content search as SearchForContent, but moves the calling Xml object's internal reference to the matching element.

The search is breadth-first within the subtree rooted at the caller. The afterPtr argument identifies the element after which matching should begin, allowing repeated calls to continue an iteration. To begin at the first candidate, use nil where the language binding permits it; ActiveX callers should pass a reference to the caller's element instead.

Wildcard patterns are case-sensitive and may contain *, where each asterisk matches zero or more characters.

Element-reference behavior: Methods that return an Xml object return another object referencing an element in the same underlying tree. Methods whose names end in 2 instead move the caller's internal reference.

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 element whose tag exactly equals tag.

The search is breadth-first within the subtree rooted at the caller. afterPtr identifies the element after which searching begins. To begin at the first candidate, use nil where the language binding permits it; ActiveX callers should pass a reference to the caller's element.

Iteration: Pass the previous match as afterPtr to find the next matching tag. Continue until no further element is returned.

Returns nil on failure

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

Performs the same breadth-first tag search as SearchForTag, but moves the calling Xml object's internal reference to the matching element instead of returning a separate object.

Use afterPtr in the same way as with SearchForTag to begin or continue the search.

Element-reference behavior: Methods that return an Xml object return another object referencing an element in the same underlying tree. Methods whose names end in 2 instead move the caller's internal reference.

Returns True for success, False for failure.

More Information and Examples
top
SetBinaryContentBd
function CkXml_SetBinaryContentBd(objHandle: HCkXml;
    data: HCkBinData;
    zipFlag: wordbool;
    encryptFlag: wordbool;
    password: PWideChar): wordbool; stdcall;
Introduced in version 11.0.0

Stores the bytes in data as binary content on this element, with optional ZIP compression and optional password-based AES encryption. The stored binary representation is emitted as Base64 text when XML is serialized.

If zipFlag is True, the bytes are compressed first. If encryptFlag is True, the data is encrypted using Chilkat's 128-bit Rijndael/AES format and password.

Returns True on success and False on failure.

Round trip: Use the corresponding binary-content retrieval methods with matching decompression/decryption options to recover the original bytes.

Returns True for success, False for failure.

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

Reads the bytes from filename and stores them as this element's binary content, with optional ZIP compression and optional password-based encryption. The resulting stored data is represented as Base64 when XML text is generated.

Returns True on success and False on failure.

Returns True for success, False for failure.

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

Sorts the calling element's direct children by the string value of attribute attrName. Set ascending to True for ascending order or False for descending order.

SortCaseInsensitive controls case sensitivity for string sorting.

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

Sorts the calling element's direct children numerically by the value of attribute attrName, interpreting each sort value as an integer rather than comparing the text lexicographically.

Set ascending to True for ascending order or False for descending order.

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

Sorts the calling element's direct children by their text content. Set ascending to True for ascending order or False for descending order.

SortCaseInsensitive controls case sensitivity for the string comparison.

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

Sorts the calling element's direct children by tag name. Set ascending to True for ascending order or False for descending order.

SortCaseInsensitive controls case sensitivity for the tag-name comparison.

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

Treats each direct child as a record and sorts those records by the value of attribute attrName on the record's child identified by sortTag.

Set ascending to True for ascending order or False for descending order. String comparisons honor SortCaseInsensitive.

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

Treats each direct child as a record and sorts those records by the text content of the record's child named sortTag.

Set ascending to True for ascending order or False for descending order. String comparisons honor SortCaseInsensitive.

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

Treats each direct child as a record and sorts those records numerically by the integer content of the record's child named sortTag.

Numeric comparison is used instead of lexicographic string comparison. Set ascending to True for ascending order or False for descending order.

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

Swaps the calling element's tag, text content, and attributes with those of node.

Returns True on success and False on failure.

Children are not swapped: Use SwapTree when child subtrees should also be exchanged.

Returns True for success, False for failure.

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

Swaps the calling element's complete tree state with tree, including tag, text content, attributes, and children.

Returns True on success and False on failure.

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;

Searches the subtree rooted at the calling element for the first element whose tag equals tagName and returns that element's text content.

Recursive search: Unlike direct-child getters, this search is not limited to the caller's immediate children.

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 calling element's complete tag name, including any namespace prefix, exactly equals tag; otherwise returns False.

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

Returns the zero-based child index of the element selected by tagPath. Returns -1 when no matching element is found at that path.

Tag paths: A tag path is Chilkat's |-separated child-navigation syntax, for example tagA|tagB|tagC. It is not XPath.
Index meaning: The returned index is the element's position among its parent's direct children, which is the index accepted by methods such as GetChild, RemoveChildByIndex, and the insertion methods.

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 this element's namespace-prefix portion exactly equals ns; otherwise returns False.

For example, the namespace prefix of soapenv:Body is soapenv.

Prefix comparison: This compares the lexical prefix, not the namespace URI bound to that prefix.

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 this element's unprefixed tag exactly equals unprefixedTag; otherwise returns False.

For example, the unprefixed tag of soapenv:Body is Body.

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

Reverses ZipContent: decodes and decompresses the calling element's compressed content and replaces the stored Base64-compressed representation with the original content.

Returns True on success and False on failure.

Returns True for success, False for failure.

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

Reverses ZipTree: decompresses the stored representation and reconstructs the calling element's previously compressed subtree.

The element's tag and attributes, which are not replaced by ZipTree, remain associated with the restored tree.

Returns True on success and False on failure.

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

Sets the text content of the element selected by tagPath to value.

If autoCreate is True, missing elements along the path are created as needed. If it is False, the update requires the target path to already exist.

Tag paths: A tag path is Chilkat's |-separated child-navigation syntax, for example tagA|tagB|tagC. It is not XPath.

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

Sets attribute attrName to attrValue on the element selected by tagPath. The attribute is added when it does not already exist.

If autoCreate is True, missing elements along the path are created as needed. If it is False, the target path must already exist.

Tag paths: A tag path is Chilkat's |-separated child-navigation syntax, for example tagA|tagB|tagC. It is not XPath.

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

Sets attribute attrName to attrValue. If the attribute already exists its value is replaced; otherwise the attribute is added.

Returns True on success and False on failure.

Returns True for success, False for failure.

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

Sets attribute attrName to the decimal representation of integer value. Use UpdateAttribute for string values.

Returns True on success and False on failure.

Returns True for success, False for failure.

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

Sets the text content of the child selected by tagPath to value. Missing elements along the path are automatically created as needed.

Tag paths: A tag path is Chilkat's |-separated child-navigation syntax, for example tagA|tagB|tagC. It is not XPath.

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

Sets the content of the child selected by tagPath to the decimal representation of integer value.

Tag paths: A tag path is Chilkat's |-separated child-navigation syntax, for example tagA|tagB|tagC. It is not XPath.

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

ZIP-compresses this element's text content and replaces the original content with Base64-encoded compressed data.

Returns True on success and False on failure.

Reversible transformation: Call UnzipContent to restore the original content.

Returns True for success, False for failure.

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

ZIP-compresses the calling element's content together with its entire child subtree and replaces that structure with Base64-encoded compressed data.

The calling element's tag and attributes are not changed. Call UnzipTree to reconstruct the compressed subtree.

Returns True on success and False on failure.

Returns True for success, False for failure.

More Information and Examples
top

Deprecated

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

Sets this element's content to an RFC 2047-style encoded-word using Base64 (the B encoding). inData contains bytes in the character encoding named by charset.

For example, using Big5 can produce content similar to =?Big5?B?pHCtsw==?=. The encoded payload is Base64 text inside the encoded-word syntax.

Use DecodeContent to recover the encoded bytes.

Purpose: B-encoding here is MIME encoded-word syntax for representing non-ASCII text as 7-bit text. It is not XML Base64 storage and it is not encryption.

Returns True for success, False for failure.

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

Decodes this element's RFC 2047-style Q- or B-encoded content and returns the decoded bytes.

This is the inverse of QEncodeContent and BEncodeContent.

Returns True for success, False for failure.

top
GetBinaryContent Deprecated
function CkXml_GetBinaryContent(objHandle: HCkXml;
    unzipFlag: wordbool;
    decryptFlag: wordbool;
    password: PWideChar;
    outData: HCkByteData): wordbool; stdcall;

Decodes this element's Base64-stored binary content and returns the resulting bytes. Set unzipFlag and decryptFlag to match the transformations that were applied when the content was stored; supply the same password when decryption is requested.

Reverse the storage pipeline: When binary content was compressed and/or encrypted by SetBinaryContent, retrieval must request the corresponding decompression/decryption steps so the original bytes are recovered.

Returns True for success, False for failure.

top
QEncodeContent Deprecated
function CkXml_QEncodeContent(objHandle: HCkXml;
    charset: PWideChar;
    inData: HCkByteData): wordbool; stdcall;

Sets this element's content to an RFC 2047-style encoded-word using the Q encoding. inData contains bytes in the character encoding named by charset.

Bytes that cannot be represented directly as 7-bit text are emitted as =XX, where XX is the hexadecimal byte value. For example, using gb2312 may produce content similar to =?gb2312?Q?=C5=B5=BB=F9?=.

Use DecodeContent to recover the encoded bytes.

Purpose: Q-encoding here is MIME encoded-word syntax. It is not XML escaping and it is not encryption.

Returns True for success, False for failure.

top
SetBinaryContent Deprecated
function CkXml_SetBinaryContent(objHandle: HCkXml;
    inData: HCkByteData;
    zipFlag: wordbool;
    encryptFlag: wordbool;
    password: PWideChar): wordbool; stdcall;

Stores inData as binary content on this element, with optional ZIP compression and optional password-based AES encryption. The stored binary representation is emitted as Base64 text when the XML is serialized.

If zipFlag is True, the data is compressed before storage. If encryptFlag is True, the data is encrypted using Chilkat's 128-bit Rijndael/AES format and password.

Returns True on success and False on failure.

Round trip: Use GetBinaryContent or SaveBinaryContent with matching unzip/decrypt options to recover the original bytes.

Returns True for success, False for failure.

top