ChilkatXml ActiveX Reference
ChilkatXml
A free non-validating XML parser component with encryption and compression features.
Object Creation
(Visual Basic 6.0)
Dim obj As New ChilkatXml
(ASP)
set obj = Server.CreateObject("Chilkat.Xml")
(VBScript)
set obj = CreateObject("Chilkat.Xml")
(Delphi)
obj := TChilkatXml.Create(Self);
(FoxPro)
loObject = CreateObject('Chilkat.Xml')
(SQL Server)
EXEC @hr = sp_OACreate 'Chilkat.Xml', @obj OUT
(Javascript)
var obj = new ActiveXObject("Chilkat.Xml");
Properties
Cdata As Long
When True, causes an XML node's content to be encapsulated in a CDATA section. (ASP) Using CDATA in XML (VB6) Using CDATA in XML (Delphi) Using CDATA in XML (FoxPro) Using CDATA in XML (PHP using ActiveX) Using CDATA in XML (VBScript) Using CDATA in XML
Content As String
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".Content vs. Children: A common misconception explained. (ASP) Setting XML Tag and Content (VB6) Setting XML Tag and Content (Delphi) Setting XML Tag and Content (FoxPro) Setting XML Tag and Content (PHP using ActiveX) Setting XML Tag and Content (VBScript) Setting XML Tag and Content
ContentInt As Long
Set/get the content as an integer.
DocType As String
The DOCTYPE declaration (if any) for the XML document. (ASP) Setting the XML DOCTYPE (VB6) Setting the XML DOCTYPE (Delphi) Setting the XML DOCTYPE (FoxPro) Setting the XML DOCTYPE (PHP using ActiveX) Setting the XML DOCTYPE (VBScript) Setting the XML DOCTYPE
Encoding As String
This is the encoding attribute in the XML declaration, such as "utf-8" or "iso-8859-1". If not present, this property returns an empty string. This property can be set from any node in the XML document and when set, causes the encoding property to be added to the XML declaration. Setting this property does not cause the document to be converted to a different encoding.
LastErrorHtml As String (read-only)
Error information in HTML format for the last method called.
LastErrorText As String (read-only)
Error information in plain-text format for the last method called.
LastErrorXml As String (read-only)
Error information in XML format for the last method called.
NumAttributes As Long (read-only)
The number of attributes. For example, the following node has 2 attributes:
<tag attr1="value1" attr2="value2"> This is the content</tag>
(ASP) Methods for Getting Attributes (VB6) Methods for Getting Attributes (Delphi) Methods for Getting Attributes (FoxPro) Methods for Getting Attributes (PHP using ActiveX) Methods for Getting Attributes (VBScript) Methods for Getting Attributes
NumChildren As Long (read-only)
The number of direct child nodes contained under this XML node.
SortCaseInsensitive As Long
If true (or 1 for ActiveX), then all Sort* methods use case insensitive sorting.
Standalone As Long
This is the standalone attribute in the XML declaration. This property can be set from any node in the XML document. A value of 1 adds a standalone="yes" to the XML declaration:
<?xml ... standalone="yes">
Tag As String
The XML node's tag. (ASP) Setting XML Tag and Content (VB6) Setting XML Tag and Content (Delphi) Setting XML Tag and Content (FoxPro) Setting XML Tag and Content (PHP using ActiveX) Setting XML Tag and Content (VBScript) Setting XML Tag and Content
TreeId As Long (read-only)
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.
Version As String (read-only)
The version of the XML component, such as "2.0.0".
Methods
AccumulateTagContent(tag As String, skipTags As String) As String
Accumulates the content of all nodes having a specific tag into a single result string. SkipTags specifies a set of tags whose are to be avoided. The skipTags are formatted as a string of tags delimited by vertical bar characters. All nodes in sub-trees rooted with a tag appearing in skipTags are not included in the result. Returns a null on failure
AddAttribute(name As String, value As String) As Long
Adds an attribute to the calling node in the XML document. Returns True for success, and False for failure. (ASP) Adding Attributes to an XML Node (VB6) Adding Attributes to an XML Node (Delphi) Adding Attributes to an XML Node (FoxPro) Adding Attributes to an XML Node (PHP using ActiveX) Adding Attributes to an XML Node (VBScript) Adding Attributes to an XML Node (ASP) AddAttribute - Insert New Attribute in XML Node (VB6) AddAttribute - Insert New Attribute in XML Node (Delphi) AddAttribute - Insert New Attribute in XML Node (FoxPro) AddAttribute - Insert New Attribute in XML Node (PHP using ActiveX) AddAttribute - Insert New Attribute in XML Node (VBScript) AddAttribute - Insert New Attribute in XML Node
AddAttributeInt(name As String, value As Long) As Long
Adds an integer attribute to a node.
AddChildTree(tree As ChilkatXml) As Long
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.
AddOrUpdateAttribute(name As String, value As String)
Adds an attribute to an XML node. If an attribute having the specified name already exists, the value is updated. (ASP) Update an XML Attribute (VB6) Update an XML Attribute (Delphi) Update an XML Attribute (FoxPro) Update an XML Attribute (PHP using ActiveX) Update an XML Attribute (VBScript) Update an XML Attribute
AddOrUpdateAttributeI(name As String, value As Long)
Adds an integer attribute to an XML node. If an attribute having the specified name already exists, the value is updated.
AddStyleSheet(styleSheet As String)
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"?>
AddToAttribute(name As String, amount As Long)
Adds an integer amount to an integer attribute's value. If the attribute does not yet exist, this method behaves the same as AddOrUpdateAttributeI. (ASP) Update an XML Attribute (VB6) Update an XML Attribute (Delphi) Update an XML Attribute (FoxPro) Update an XML Attribute (PHP using ActiveX) Update an XML Attribute (VBScript) Update an XML Attribute
AddToChildContent(tag As String, amount As Long)
Adds an integer value to the content of a child node.
AddToContent(amount As Long)
Adds an integer amount to the node's content.
AppendToContent(str As String) As Long
Appends text to the content of an XML node
BEncodeContent(charset As String, inData As Variant) As Long
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.
ChildContentMatches(tag As String, pattern As String, caseSensitive As Long) As Long
Return true if a child having a specific tag contains content that matches a wildcarded pattern.
ChilkatPath(pathCmd As String) As String
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:
- TagName -- Navigate to the 1st direct child with the given tag.
- TagName[n] -- Navigate to the Nth direct child with the given tag.
- .. -- Navigate up to the parent
- TagName{Content} -- Navigate to the 1st direct child with the given tag having the exact content.
- /T/TagName -- Traverse the XML DOM tree (rooted at the caller) and navigate to the 1st node having the given tag.
- /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.
- /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.
- /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:
- * -- Return the Content of the node.
- (AttrName) -- Return the value of the given attribute.
- $ -- Update the caller's internal reference to be the node (arrived at by following the series of commands). Returns an empty string.
Returns a null on failure (ASP) ChilkatPath Sample Code (VB6) ChilkatPath Sample Code (Delphi) ChilkatPath Sample Code (FoxPro) ChilkatPath Sample Code (PHP using ActiveX) ChilkatPath Sample Code (VBScript) ChilkatPath Sample Code
Clear()
Removes all children, attributes, and content from the XML node. Resets the tag name to "unnamed".
CompressNode() As Long
Applies Zip compression to the content of an XML node and replaces the content with base64-encoded compressed data.
CompressSubtree() As Long
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.
ContentMatches(pattern As String, caseSensitive As Long) As Long
Return true if the node's content matches a wildcarded pattern.
Copy(node As ChilkatXml)
Copies the tag, content, and attributes to the calling node.
CopyRef(copyFromNode As ChilkatXml)
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.
DecodeContent() As Variant
Decodes a node's Q or B-encoded content string and returns the byte data. Returns a zero-length byte array (as a Variant) on failure. An empty array will have a UBound of -1 meaning 0 elements.
DecodeEntities(str As String) As String
Utility method to decode HTML entities. It accepts a string containing (potentially) HTML entities and returns a string with the entities decoded. Returns a null on failure
DecompressNode() As Long
Unzip the content of the XML node replacing it's content with the decompressed data.
DecompressSubtree() As Long
Unzips and recreates the XML node and the entire subtree, restoring it to the state before it was zip compressed.
DecryptContent(password As String) As Long
Decrypts the content of an XML node that was previously 128-bit AES encrypted with the EncryptContent method. (ASP) Encrypting and Decrypting Content (VB6) Encrypting and Decrypting Content (Delphi) Encrypting and Decrypting Content (FoxPro) Encrypting and Decrypting Content (PHP using ActiveX) Encrypting and Decrypting Content (VBScript) Encrypting and Decrypting Content
DecryptNode(password As String) As Long
Decrypts the content of an XML node that was previously 128-bit AES encrypted with the EncryptContent method.
EncryptContent(password As String) As Long
Encrypts the content of the calling XML node using 128-bit CBC AES encryption. The base64-encoded encrypted content replaces the original content. (ASP) Encrypting and Decrypting Content (VB6) Encrypting and Decrypting Content (Delphi) Encrypting and Decrypting Content (FoxPro) Encrypting and Decrypting Content (PHP using ActiveX) Encrypting and Decrypting Content (VBScript) Encrypting and Decrypting Content
EncryptNode(password As String) As Long
Encrypts the content of the calling XML node using 128-bit CBC AES encryption.
ExtractChildByIndex(index As Long) As ChilkatXml
Removes and returns the Nth child of an XML node. The first child is at index 0.
ExtractChildByName(tag As String, attrName As String, attrValue As String) As ChilkatXml
Removes and returns the first child node having a tag equal to the tagName. The attributeName and attrValue may be empty or NULL, in which case the first child matching the tag is removed and returned. If attributeName is specified, then the first child having a tag equal to tagName, and an attribute with attributeName is returned. If attrValue is also specified, then only a child having a tag equal to tagName, and an attribute named attributeName, with a value equal to attrValue is returned.
FindChild(tag As String) As ChilkatXml
Returns the child having a specified tag. (ASP) Find Direct Child with Specific Tag (VB6) Find Direct Child with Specific Tag (Delphi) Find Direct Child with Specific Tag (FoxPro) Find Direct Child with Specific Tag (PHP using ActiveX) Find Direct Child with Specific Tag (VBScript) Find Direct Child with Specific Tag
FindChild2(tag As String) As Long
Updates the Xml object's internal reference to point to a child with a specified tag. (ASP) Find Direct Child with Specific Tag (VB6) Find Direct Child with Specific Tag (Delphi) Find Direct Child with Specific Tag (FoxPro) Find Direct Child with Specific Tag (PHP using ActiveX) Find Direct Child with Specific Tag (VBScript) Find Direct Child with Specific Tag
FindNextRecord(tag As String, contentPattern As String) As ChilkatXml
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.
FindOrAddNewChild(tag As String) As ChilkatXml
First searches for a child having a tag equal to tagName, and if found, returns it. Otherwise creates a new child, sets the tag equal to tagName, and initializes the Content to empty.
FirstChild() As ChilkatXml
Returns the first child. A program can step through the children by calling FirstChild, and then NextSibling repeatedly. (ASP) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (VB6) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (Delphi) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (FoxPro) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (PHP using ActiveX) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (VBScript) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling
FirstChild2() As Long
Updates the internal reference of the caller to point to its first child. More information about XML methods ending in "2" (ASP) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (VB6) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (Delphi) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (FoxPro) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (PHP using ActiveX) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (VBScript) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling
GetAttrValue(name As String) As String
Find and return the value of an attribute having a specified name. Returns a null on failure (ASP) Methods for Getting Attributes (VB6) Methods for Getting Attributes (Delphi) Methods for Getting Attributes (FoxPro) Methods for Getting Attributes (PHP using ActiveX) Methods for Getting Attributes (VBScript) Methods for Getting Attributes
GetAttrValueInt(name As String) As Long
Returns an attribute as an integer. (ASP) Methods for Getting Attributes (VB6) Methods for Getting Attributes (Delphi) Methods for Getting Attributes (FoxPro) Methods for Getting Attributes (PHP using ActiveX) Methods for Getting Attributes (VBScript) Methods for Getting Attributes
GetAttributeName(index As Long) As String
Returns the name of the Nth attribute of an XML node. The first attribute is at index 0. Returns a null on failure (ASP) Methods for Getting Attributes (VB6) Methods for Getting Attributes (Delphi) Methods for Getting Attributes (FoxPro) Methods for Getting Attributes (PHP using ActiveX) Methods for Getting Attributes (VBScript) Methods for Getting Attributes
GetAttributeValue(index As Long) As String
Returns the value of the Nth attribute of an XML node. The first attribute is at index 0. Returns a null on failure (ASP) Methods for Getting Attributes (VB6) Methods for Getting Attributes (Delphi) Methods for Getting Attributes (FoxPro) Methods for Getting Attributes (PHP using ActiveX) Methods for Getting Attributes (VBScript) Methods for Getting Attributes
GetAttributeValueInt(index As Long) As Long
Returns an attribute as an integer.
GetBinaryContent(unzipFlag As Long, decryptFlag As Long, password As String) As Variant
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 a zero-length byte array (as a Variant) on failure. An empty array will have a UBound of -1 meaning 0 elements.
GetChild(index As Long) As ChilkatXml
Returns the Nth child of an XML node (ASP) Iterate over Direct Child Nodes by Index (VB6) Iterate over Direct Child Nodes by Index (Delphi) Iterate over Direct Child Nodes by Index (FoxPro) Iterate over Direct Child Nodes by Index (PHP using ActiveX) Iterate over Direct Child Nodes by Index (VBScript) Iterate over Direct Child Nodes by Index
GetChild2(index As Long) As Long
Updates the calling object's internal reference to the Nth child node. Returns 1 for success, 0 for failure. More information about XML methods ending in "2" (ASP) Iterate over Direct Child Nodes by Index (VB6) Iterate over Direct Child Nodes by Index (Delphi) Iterate over Direct Child Nodes by Index (FoxPro) Iterate over Direct Child Nodes by Index (PHP using ActiveX) Iterate over Direct Child Nodes by Index (VBScript) Iterate over Direct Child Nodes by Index
GetChildBoolValue(tag As String) As Long
Returns 0 if the node's content is "0", otherwise returns 1 if the node contains a non-zero integer.
GetChildContent(tag As String) As String
Returns the content of a child having a specified tag. Returns a null on failure
GetChildContentByIndex(index As Long) As String
Returns the content of the Nth child node. Returns a null on failure (ASP) Iterate over Direct Child Nodes by Index (VB6) Iterate over Direct Child Nodes by Index (Delphi) Iterate over Direct Child Nodes by Index (FoxPro) Iterate over Direct Child Nodes by Index (PHP using ActiveX) Iterate over Direct Child Nodes by Index (VBScript) Iterate over Direct Child Nodes by Index
GetChildExact(tag As String, content As String) As ChilkatXml
Returns the child having the exact tag and content.
GetChildIntValue(tag As String) As Long
Returns the child integer content for a given tag.
GetChildTag(index As Long) As String
Returns the tag name of the Nth child node. Returns a null on failure
GetChildTagByIndex(index As Long) As String
Returns the tag name of the Nth child node. Returns a null on failure (ASP) Iterate over Direct Child Nodes by Index (VB6) Iterate over Direct Child Nodes by Index (Delphi) Iterate over Direct Child Nodes by Index (FoxPro) Iterate over Direct Child Nodes by Index (PHP using ActiveX) Iterate over Direct Child Nodes by Index (VBScript) Iterate over Direct Child Nodes by Index
GetChildWithAttr(tag As String, attrName As String, attrValue As String) As ChilkatXml
To be documented soon.
GetChildWithContent(content As String) As ChilkatXml
Returns the first child found having the exact content specified.
GetChildWithTag(tag As String) As ChilkatXml
Returns the Xml child object having a tag matching tagName.
GetNthChildWithTag(tag As String, n As Long) As ChilkatXml
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. (ASP) Iterate over Direct Children with a Specific Tag (VB6) Iterate over Direct Children with a Specific Tag (Delphi) Iterate over Direct Children with a Specific Tag (FoxPro) Iterate over Direct Children with a Specific Tag (PHP using ActiveX) Iterate over Direct Children with a Specific Tag (VBScript) Iterate over Direct Children with a Specific Tag
GetNthChildWithTag2(tag As String, n As Long) As Long
Updates the calling object's internal reference to the Nth child node having a specific tag. Returns 1 for success, 0 for failure. (ASP) Iterate over Direct Children with a Specific Tag (VB6) Iterate over Direct Children with a Specific Tag (Delphi) Iterate over Direct Children with a Specific Tag (FoxPro) Iterate over Direct Children with a Specific Tag (PHP using ActiveX) Iterate over Direct Children with a Specific Tag (VBScript) Iterate over Direct Children with a Specific Tag
GetParent() As ChilkatXml
Returns the parent of this XML node, or NULL if the node is the root of the tree.
GetParent2() As Long
Updates the internal reference of the caller to its parent. More information about XML methods ending in "2"
GetRoot() As ChilkatXml
Returns the root node of the XML document
GetRoot2()
Updates the internal reference of the caller to the document root. More information about XML methods ending in "2"
GetSelf() As ChilkatXml
To be documented soon...
GetXml() As String
Generate the XML text document for the XML tree rooted at this node. Returns a null on failure
HasAttrWithValue(name As String, value As String) As Long
Returns true if the node contains attribute with the name and value.
HasAttribute(name As String) As Long
Returns true if the node contains an attribute with the specified name.
HasChildWithContent(content As String) As Long
Returns true if the node has a direct child node containing the exact content string specified.
HasChildWithTag(tag As String) As Long
Returns true (1 for ActiveX) if the node has a direct child with a given tag.
HasChildWithTagAndContent(tag As String, content As String) As Long
Returns true if the node contains a direct child having the exact tag and content specified.
InsertChildTreeAfter(index As Long, tree As ChilkatXml)
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).
InsertChildTreeBefore(index As Long, tree As ChilkatXml)
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).
LastChild() As ChilkatXml
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. (ASP) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (VB6) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (Delphi) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (FoxPro) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (PHP using ActiveX) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (VBScript) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling
LastChild2() As Long
Updates the internal reference of the caller to its last child. (ASP) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (VB6) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (Delphi) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (FoxPro) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (PHP using ActiveX) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (VBScript) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling
LoadXml(xmlData As String) As Long
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.
LoadXml2(xmlData As String, autoTrim As Long) As Long
Same as LoadXml, but an additional argument controls whether or not leading/trailing whitespace is auto-trimmed from each node's content. Returns 1 for success, 0 for failure.
LoadXmlFile(fileName As String) As Long
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.
LoadXmlFile2(fileName As String, autoTrim As Long) As Long
Same as LoadXmlFile, but an additional argument controls whether or not leading/trailing whitespace is auto-trimmed from each node's content. Returns 1 for success, 0 for failure.
LoadXmlV(xmlDoc As Variant) As Long
Loads XML from a byte array containing the XML document.
NewChild(tag As String, content As String) As ChilkatXml
Creates a new child having tag and content. The new child is created even if a child with a tag equal to tagName already exists. (Use FindOrAddNewChild to prevent creating children having the same tags.) (ASP) Creating a New Child Node (VB6) Creating a New Child Node (Delphi) Creating a New Child Node (FoxPro) Creating a New Child Node (PHP using ActiveX) Creating a New Child Node (VBScript) Creating a New Child Node
NewChild2(tag As String, content As String)
Creates a new child but does not return the node that is created. (ASP) Creating a New Child Node (VB6) Creating a New Child Node (Delphi) Creating a New Child Node (FoxPro) Creating a New Child Node (PHP using ActiveX) Creating a New Child Node (VBScript) Creating a New Child Node
NewChildAfter(index As Long, tag As String, content As String) As ChilkatXml
Inserts a new child in a position after the Nth child node.
NewChildBefore(index As Long, tag As String, content As String) As ChilkatXml
Inserts a new child in a position before the Nth child node.
NewChildInt2(tag As String, value As Long)
Inserts a new child having an integer for content.
NextSibling() As ChilkatXml
Returns the nodes next sibling, or NULL if there are no more. (ASP) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (VB6) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (Delphi) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (FoxPro) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (PHP using ActiveX) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (VBScript) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling
NextSibling2() As Long
Updates the internal reference of the caller to its next sibling. More information about XML methods ending in "2" (ASP) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (VB6) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (Delphi) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (FoxPro) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (PHP using ActiveX) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (VBScript) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling
NumChildrenHavingTag(tag As String) As Long
Returns the number of children having a specific tag name. (ASP) Iterate over Direct Children with a Specific Tag (VB6) Iterate over Direct Children with a Specific Tag (Delphi) Iterate over Direct Children with a Specific Tag (FoxPro) Iterate over Direct Children with a Specific Tag (PHP using ActiveX) Iterate over Direct Children with a Specific Tag (VBScript) Iterate over Direct Children with a Specific Tag
PreviousSibling() As ChilkatXml
Returns the Xml object that is the node's previous sibling, or NULL if there are no more. (ASP) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (VB6) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (Delphi) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (FoxPro) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (PHP using ActiveX) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (VBScript) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling
PreviousSibling2() As Long
Updates the internal reference of the caller to its previous sibling. More information about XML methods ending in "2" (ASP) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (VB6) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (Delphi) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (FoxPro) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (PHP using ActiveX) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling (VBScript) Traverse Direct Children via FirstChild / NextSibling, or LastChild / PreviousSibling
QEncodeContent(charset As String, inData As Variant) As Long
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.
RemoveAllAttributes() As Long
Removes all attributes from an XML node. Should always return True.
RemoveAllChildren()
Removes all children from the calling node.
RemoveAttribute(name As String) As Long
Removes an attribute by name from and XML node.
RemoveChild(tag As String)
Removes all direct children with a given tag. (ASP) Removing / Deleting Child Nodes from XML (VB6) Removing / Deleting Child Nodes from XML (Delphi) Removing / Deleting Child Nodes from XML (FoxPro) Removing / Deleting Child Nodes from XML (PHP using ActiveX) Removing / Deleting Child Nodes from XML (VBScript) Removing / Deleting Child Nodes from XML
RemoveChildByIndex(index As Long)
Removes the Nth child from the calling node. (ASP) Removing / Deleting Child Nodes from XML (VB6) Removing / Deleting Child Nodes from XML (Delphi) Removing / Deleting Child Nodes from XML (FoxPro) Removing / Deleting Child Nodes from XML (PHP using ActiveX) Removing / Deleting Child Nodes from XML (VBScript) Removing / Deleting Child Nodes from XML
RemoveChildWithContent(content As String)
Removes all children having the exact content specified. (ASP) Removing / Deleting Child Nodes from XML (VB6) Removing / Deleting Child Nodes from XML (Delphi) Removing / Deleting Child Nodes from XML (FoxPro) Removing / Deleting Child Nodes from XML (PHP using ActiveX) Removing / Deleting Child Nodes from XML (VBScript) Removing / Deleting Child Nodes from XML
RemoveFromTree()
Removes the calling object and its sub-tree from the XML document making it the root of its own tree. (ASP) Removing / Deleting Child Nodes from XML (VB6) Removing / Deleting Child Nodes from XML (Delphi) Removing / Deleting Child Nodes from XML (FoxPro) Removing / Deleting Child Nodes from XML (PHP using ActiveX) Removing / Deleting Child Nodes from XML (VBScript) Removing / Deleting Child Nodes from XML
SaveBinaryContent(filename As String, unzipFlag As Long, decryptFlag As Long, password As String) As Long
Saves a node's binary content to a file.
SaveLastError(filename As String) As Long
Saves the last error information to an XML formatted file.
SaveXml(fileName As String) As Long
Generates XML representing the tree or subtree rooted at this node and writes it to a file.
SearchAllForContent(after As ChilkatXml, contentPattern As String) As ChilkatXml
Returns the first node whose content matches the contentPattern, which is a case-sensitive string that can use any number of '*'s to represent 0 or more occurances of any character. The search is breadth-first over the sub-tree rooted at the caller, and the previous node returned can be passed to the next call as afterNode to continue the search after that node. (ASP) XML Tree Traversal Order for Search* Methods (VB6) XML Tree Traversal Order for Search* Methods (Delphi) XML Tree Traversal Order for Search* Methods (FoxPro) XML Tree Traversal Order for Search* Methods (PHP using ActiveX) XML Tree Traversal Order for Search* Methods (VBScript) XML Tree Traversal Order for Search* Methods
SearchAllForContent2(after As ChilkatXml, contentPattern As String) As Long
Same as SearchAllForContent except the internal reference of the caller is updated to point to the search result (instead of returning a new object). (ASP) XML Tree Traversal Order for Search* Methods (VB6) XML Tree Traversal Order for Search* Methods (Delphi) XML Tree Traversal Order for Search* Methods (FoxPro) XML Tree Traversal Order for Search* Methods (PHP using ActiveX) XML Tree Traversal Order for Search* Methods (VBScript) XML Tree Traversal Order for Search* Methods
SearchForAttribute(after As ChilkatXml, tag As String, attr As String, valuePattern As String) As ChilkatXml
Returns the first node having a tag equal to tagName, and an attribute named attrName whose value matches valuePattern, which is a case-sensitive string that can use any number of '*'s to represent 0 or more occurances of any character. The search is breadth-first over the sub-tree rooted at the caller, and the previous node returned can be passed to the next call as afterNode to continue the search after that node. (ASP) XML SearchForAttribute Method (VB6) XML SearchForAttribute Method (Delphi) XML SearchForAttribute Method (FoxPro) XML SearchForAttribute Method (PHP using ActiveX) XML SearchForAttribute Method (VBScript) XML SearchForAttribute Method (ASP) XML Tree Traversal Order for Search* Methods (VB6) XML Tree Traversal Order for Search* Methods (Delphi) XML Tree Traversal Order for Search* Methods (FoxPro) XML Tree Traversal Order for Search* Methods (PHP using ActiveX) XML Tree Traversal Order for Search* Methods (VBScript) XML Tree Traversal Order for Search* Methods
SearchForAttribute2(after As ChilkatXml, tag As String, attr As String, valuePattern As String) As Long
Same as SearchForAttribute except the internal reference of the caller is updated to point to the search result (instead of returning a new object). (ASP) XML SearchForAttribute Method (VB6) XML SearchForAttribute Method (Delphi) XML SearchForAttribute Method (FoxPro) XML SearchForAttribute Method (PHP using ActiveX) XML SearchForAttribute Method (VBScript) XML SearchForAttribute Method (ASP) XML Tree Traversal Order for Search* Methods (VB6) XML Tree Traversal Order for Search* Methods (Delphi) XML Tree Traversal Order for Search* Methods (FoxPro) XML Tree Traversal Order for Search* Methods (PHP using ActiveX) XML Tree Traversal Order for Search* Methods (VBScript) XML Tree Traversal Order for Search* Methods
SearchForContent(after As ChilkatXml, tag As String, contentPattern As String) As ChilkatXml
Returns the first node having a tag equal to tagName whose content matches contentPattern, which is a case-sensitive string that can use any number of '*'s to represent 0 or more occurances of any character. The search is breadth-first over the sub-tree rooted at the caller, and the previous node returned can be passed to the next call as afterNode to continue the search after that node. (ASP) XML Tree Traversal Order for Search* Methods (VB6) XML Tree Traversal Order for Search* Methods (Delphi) XML Tree Traversal Order for Search* Methods (FoxPro) XML Tree Traversal Order for Search* Methods (PHP using ActiveX) XML Tree Traversal Order for Search* Methods (VBScript) XML Tree Traversal Order for Search* Methods
SearchForContent2(after As ChilkatXml, tag As String, contentPattern As String) As Long
Same as SearchForContent except the internal reference of the caller is updated to point to the search result (instead of returning a new object). (ASP) XML Tree Traversal Order for Search* Methods (VB6) XML Tree Traversal Order for Search* Methods (Delphi) XML Tree Traversal Order for Search* Methods (FoxPro) XML Tree Traversal Order for Search* Methods (PHP using ActiveX) XML Tree Traversal Order for Search* Methods (VBScript) XML Tree Traversal Order for Search* Methods
SearchForTag(after As ChilkatXml, tag As String) As ChilkatXml
Returns the first node having a tag equal to tagName. The search is breadth-first over the sub-tree rooted at the caller, and the previous node returned can be passed to the next call as afterNode to continue the search after that node. (ASP) XML SearchForTag Method (VB6) XML SearchForTag Method (Delphi) XML SearchForTag Method (FoxPro) XML SearchForTag Method (PHP using ActiveX) XML SearchForTag Method (VBScript) XML SearchForTag Method (ASP) XML Tree Traversal Order for Search* Methods (VB6) XML Tree Traversal Order for Search* Methods (Delphi) XML Tree Traversal Order for Search* Methods (FoxPro) XML Tree Traversal Order for Search* Methods (PHP using ActiveX) XML Tree Traversal Order for Search* Methods (VBScript) XML Tree Traversal Order for Search* Methods
SearchForTag2(after As ChilkatXml, tag As String) As Long
Same as SearchForTag except the internal reference of the caller is updated to point to the search result (instead of returning a new object). (ASP) XML SearchForTag Method (VB6) XML SearchForTag Method (Delphi) XML SearchForTag Method (FoxPro) XML SearchForTag Method (PHP using ActiveX) XML SearchForTag Method (VBScript) XML SearchForTag Method (ASP) XML Tree Traversal Order for Search* Methods (VB6) XML Tree Traversal Order for Search* Methods (Delphi) XML Tree Traversal Order for Search* Methods (FoxPro) XML Tree Traversal Order for Search* Methods (PHP using ActiveX) XML Tree Traversal Order for Search* Methods (VBScript) XML Tree Traversal Order for Search* Methods
SetBinaryContent(inData As Variant, zipFlag As Long, encryptFlag As Long, password As String) As Long
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.
SetBinaryContentFromFile(filename As String, zipFlag As Long, encryptFlag As Long, password As String) As Long
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.
SortByAttribute(attrName As String, ascending As Long)
Sorts the direct child nodes by the value of a specified attribute.
SortByAttributeInt(attrName As String, ascending As Long)
Sorts the direct child nodes by the value of a specified attribute interpreted as an integer (not lexicographically as strings).
SortByContent(ascending As Long)
Sorts the direct child nodes by content. (ASP) XML Sort by Content (VB6) XML Sort by Content (Delphi) XML Sort by Content (FoxPro) XML Sort by Content (PHP using ActiveX) XML Sort by Content (VBScript) XML Sort by Content
SortByTag(ascending As Long)
Sorts the direct child nodes by tag. (ASP) XML Sort by Tag (VB6) XML Sort by Tag (Delphi) XML Sort by Tag (FoxPro) XML Sort by Tag (PHP using ActiveX) XML Sort by Tag (VBScript) XML Sort by Tag
SortRecordsByAttribute(sortTag As String, attrName As String, ascending As Long)
Sorts the direct child nodes by the content of an attribute in the grandchild nodes.
SortRecordsByContent(sortTag As String, ascending As Long)
Sorts the direct child nodes by the content of the grandchild nodes. (ASP) XML Sort Records by Content (VB6) XML Sort Records by Content (Delphi) XML Sort Records by Content (FoxPro) XML Sort Records by Content (PHP using ActiveX) XML Sort Records by Content (VBScript) XML Sort Records by Content
SortRecordsByContentInt(sortTag As String, ascending As Long)
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).
SwapNode(node As ChilkatXml) As Long
Swaps another node's tag, content, and attributes with this one.
SwapTree(tree As ChilkatXml) As Long
Swaps another node's tag, content, attributes, and children with this one.
TagContent(tag As String) As String
To be documented soon...
TagEquals(tag As String) As Long
Returns 1 if the node's tag equals the specified string.
UnzipContent() As Long
Unzip the content of the XML node replacing it's content with the decompressed data. (ASP) Compress XML Content (VB6) Compress XML Content (Delphi) Compress XML Content (FoxPro) Compress XML Content (PHP using ActiveX) Compress XML Content (VBScript) Compress XML Content
UnzipTree() As Long
Unzips and recreates the XML node and the entire subtree, restoring it to the state before it was zip compressed. (ASP) Compress XML Tree (VB6) Compress XML Tree (Delphi) Compress XML Tree (FoxPro) Compress XML Tree (PHP using ActiveX) Compress XML Tree (VBScript) Compress XML Tree
UpdateAttribute(attrName As String, attrValue As String) As Long
Adds an attribute to the node if it doesn't already exist. Otherwise it updates the existing attribute with the new value. (ASP) Update an XML Attribute (VB6) Update an XML Attribute (Delphi) Update an XML Attribute (FoxPro) Update an XML Attribute (PHP using ActiveX) Update an XML Attribute (VBScript) Update an XML Attribute
UpdateAttributeInt(attrName As String, value As Long) As Long
Updates an attribute value. (Call UpdateAttribute if the attribute value is a string.)
UpdateChildContent(tag As String, value As String)
Replaces the content of a child node.
UpdateChildContentInt(tag As String, value As Long)
Replaces the content of a child node where the content is an integer.
ZipContent() As Long
Applies Zip compression to the content of an XML node and replaces the content with base64-encoded compressed data. (ASP) Compress XML Content (VB6) Compress XML Content (Delphi) Compress XML Content (FoxPro) Compress XML Content (PHP using ActiveX) Compress XML Content (VBScript) Compress XML Content
ZipTree() As Long
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. (ASP) Compress XML Tree (VB6) Compress XML Tree (Delphi) Compress XML Tree (FoxPro) Compress XML Tree (PHP using ActiveX) Compress XML Tree (VBScript) Compress XML Tree
|