Platforms to show: All Mac Windows Linux Cross-Platform
CFTreeMBS.AppendChild(tree as CFTreeMBS)
Function:
Appends a tree as a child.
Example:
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | CoreFoundation | MBS MacCF Plugin | 4.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Example:
dim documentinfo as new CFXMLDocumentInfoMBS
dim docnode as new CFXMLNodeMBS
dim instructionNode as new CFXMLNodeMBS
dim xmldocument as new CFTreeMBS
dim rootInfo as new CFXMLElementInfoMBS
dim rootNode as new CFXMLNodeMBS
dim rootTree as new CFTreeMBS
dim nameInfo as new CFXMLElementInfoMBS
dim nameNode as new CFXMLNodeMBS
dim nameTree as new CFTreeMBS
dim nameTextNode as new CFXMLNodeMBS
dim nameTextTree as new CFTreeMBS
dim nameTextNode2 as new CFXMLNodeMBS
dim nameTextTree2 as new CFTreeMBS
dim root as CFStringMBS
const kCFStringEncodingUTF8=&h08000100
// create a document node
documentinfo.SourceURL=nil
documentinfo.CFStringEncoding=kCFStringEncodingUTF8
docnode.CreateDocument(documentinfo)
xmldocument.CreateWithXMLNode docNode
// root element
rootInfo.XMLAttributes=nil
rootInfo.AttributeOrder=nil
rootInfo.IsEmpty=false
root=NewCFStringMBS("root")
rootNode.CreateElement root, rootInfo
rootTree.CreateWithXMLNode rootNode
nameInfo.XMLAttributes=nil
nameInfo.AttributeOrder=nil
nameInfo.IsEmpty=false
namenode.CreateElement NewCFStringMBS("FirstName"), nameInfo
nameTree.CreateWithXMLNode nameNode
rootTree.AppendChild nameTree
nameTextNode.CreateText NewCFStringMBS("Dean")
nameTextTree.CreateWithXMLNode nameTextNode
nameTree.AppendChild nameTextTree
nameInfo.XMLAttributes=nil
nameInfo.AttributeOrder=nil
nameInfo.IsEmpty=false
namenode.CreateElement NewCFStringMBS("LastName"), nameInfo
nameTree.CreateWithXMLNode nameNode
rootTree.AppendChild nameTree
nameTextNode2.CreateText NewCFStringMBS("Davis")
nameTextTree2.CreateWithXMLNode nameTextNode2
nameTree.AppendChild nameTextTree2
CFShowMBS(xmldocument)
xmldocument.AppendChild rootTree
MsgBox xmldocument.XMLData.str
// shows "<root><FirstName>Dean</FirstName><LastName>Davis</LastName></root>"
CFTreeMBS.ChildAtIndex(index as Integer) as CFTreeMBS
Function:
Returns the child with the given index.
Notes: nil on any error.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | CoreFoundation | MBS MacCF Plugin | 4.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Notes: nil on any error.
CFTreeMBS.ChildCount as Integer
Function:
Returns the number of child nodes.
Notes: 0 on any error.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | CoreFoundation | MBS MacCF Plugin | 4.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Notes: 0 on any error.
CFTreeMBS.Children as CFTreeMBS
Function:
Returns the child tree node.
Notes: nil on any error.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | CoreFoundation | MBS MacCF Plugin | 4.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Notes: nil on any error.
CFTreeMBS.Create
Function:
Creates a new empty tree and stores the handle in this object.
Notes: Handle is 0 on failure.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | CoreFoundation | MBS MacCF Plugin | 4.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Notes: Handle is 0 on failure.
CFTreeMBS.CreateFromXMLData(data as CFBinaryDataMBS, url as CFURLMBS, ParseOptions as Integer)
Function:
Creates a new XMLTree from the given data.
Notes:
URL is needed to resolve external references.
These are the various options you can configure the parser with. These are chosen such that an option flag of 0 (kCFXMLParserNoOptions) leaves the XML as "intact" as possible (reports all structures; performs no replacements).
Hence, to make the parser do the most work, returning only the pure element tree, set the option flag to kCFXMLParserAllOptions:
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | CoreFoundation | MBS MacCF Plugin | 4.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Notes:
URL is needed to resolve external references.
These are the various options you can configure the parser with. These are chosen such that an option flag of 0 (kCFXMLParserNoOptions) leaves the XML as "intact" as possible (reports all structures; performs no replacements).
Hence, to make the parser do the most work, returning only the pure element tree, set the option flag to kCFXMLParserAllOptions:
kCFXMLParserValidateDocument | 1 | validate the document against its grammar from the DTD, reporting any errors. Currently not supported. |
kCFXMLParserSkipMetaData | 2 | silently skip over metadata constructs (the DTD and comments) |
kCFXMLParserReplacePhysicalEntities | 4 | replace declared entities like <. Note that other than the 5 predefined entities (lt, gt, quot, amp, apos), these must be defined in the DTD. Currently not supported. |
kCFXMLParserSkipWhitespace | 8 | skip over all whitespace that does not abut non-whitespace character data. In other words, given <foo> <bar> blah </bar></foo>, the whitespace between foo's open tag and bar's open tag would be suppressed, but the whitespace around blah would be preserved. |
kCFXMLParserResolveExternalEntities | 16 | |
kCFXMLParserAddImpliedAttributes | 32 | where the DTD specifies implied attribute-value pairs for a particular element, add those pairs to any occurances of the element in the element tree. Currently not supported. |
kCFXMLParserAllOptions | &hFFFFFF | |
kCFXMLParserNoOptions | 0 |
CFTreeMBS.CreateWithXMLDataFromURL(URL as CFURLMBS, ParseOptions as Integer)
Function:
Creates a new XMLTree from the given data at the URL.
Notes:
The handle property is set if the function is successfull.
These are the various options you can configure the parser with. These are chosen such that an option flag of 0 (kCFXMLParserNoOptions) leaves the XML as "intact" as possible (reports all structures; performs no replacements).
Hence, to make the parser do the most work, returning only the pure element tree, set the option flag to kCFXMLParserAllOptions:
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | CoreFoundation | MBS MacCF Plugin | 4.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Notes:
The handle property is set if the function is successfull.
These are the various options you can configure the parser with. These are chosen such that an option flag of 0 (kCFXMLParserNoOptions) leaves the XML as "intact" as possible (reports all structures; performs no replacements).
Hence, to make the parser do the most work, returning only the pure element tree, set the option flag to kCFXMLParserAllOptions:
kCFXMLParserValidateDocument | 1 | validate the document against its grammar from the DTD, reporting any errors. Currently not supported. |
kCFXMLParserSkipMetaData | 2 | silently skip over metadata constructs (the DTD and comments) |
kCFXMLParserReplacePhysicalEntities | 4 | replace declared entities like <. Note that other than the 5 predefined entities (lt, gt, quot, amp, apos), these must be defined in the DTD. Currently not supported. |
kCFXMLParserSkipWhitespace | 8 | skip over all whitespace that does not abut non-whitespace character data. In other words, given <foo> <bar> blah </bar></foo>, the whitespace between foo's open tag and bar's open tag would be suppressed, but the whitespace around blah would be preserved. |
kCFXMLParserResolveExternalEntities | 16 | |
kCFXMLParserAddImpliedAttributes | 32 | where the DTD specifies implied attribute-value pairs for a particular element, add those pairs to any occurances of the element in the element tree. Currently not supported. |
kCFXMLParserAllOptions | &hFFFFFF | |
kCFXMLParserNoOptions | 0 |
Some examples using this method:
CFTreeMBS.CreateWithXMLNode(node as CFXMLNodeMBS)
Function:
Creates a XML tree based on the given node.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | CoreFoundation | MBS MacCF Plugin | 4.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
CFTreeMBS.FindRoot as CFTreeMBS
Function:
Returns the tree root node.
Notes: nil on any error.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | CoreFoundation | MBS MacCF Plugin | 4.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Notes: nil on any error.
CFTreeMBS.FirstChild as CFTreeMBS
Function:
Returns the first child node.
Notes: nil on any error.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | CoreFoundation | MBS MacCF Plugin | 4.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Notes: nil on any error.
CFTreeMBS.InsertSibling(tree as CFTreeMBS)
Function:
Inserts a new tree as the sibling of this tree.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | CoreFoundation | MBS MacCF Plugin | 4.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
CFTreeMBS.NextSibling as CFTreeMBS
Function:
Returns the next sibiling.
Notes: nil on any error.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | CoreFoundation | MBS MacCF Plugin | 4.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Notes: nil on any error.
CFTreeMBS.Parent as CFTreeMBS
Function:
Returns the parent of the tree.
Notes: nil on any error.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | CoreFoundation | MBS MacCF Plugin | 4.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Notes: nil on any error.
CFTreeMBS.PrependChild(tree as CFTreeMBS)
Function:
Inserts a new tree as the first child.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | CoreFoundation | MBS MacCF Plugin | 4.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
CFTreeMBS.Remove
Function:
Removes this tree from its parent.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | CoreFoundation | MBS MacCF Plugin | 4.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
CFTreeMBS.RemoveAllChildren
Function:
Removes all child nodes.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | CoreFoundation | MBS MacCF Plugin | 4.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
CFTreeMBS.XMLBinaryData as CFBinaryDataMBS
Function:
Creates XML Data from the tree.
Notes:
Generate the XMLData (ready to be written to whatever permanent storage is to be used) from an CFXMLTree. Will NOT regenerate entity references (except those required for syntactic correctness) if they were replaced at the parse time; clients that wish this should walk the tree and re-insert any entity references that should appear in the final output file.
Returns nil on any error.
Renamed from XMLData to XMLBinaryData for version 19.0.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | CoreFoundation | MBS MacCF Plugin | 4.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Notes:
Generate the XMLData (ready to be written to whatever permanent storage is to be used) from an CFXMLTree. Will NOT regenerate entity references (except those required for syntactic correctness) if they were replaced at the parse time; clients that wish this should walk the tree and re-insert any entity references that should appear in the final output file.
Returns nil on any error.
Renamed from XMLData to XMLBinaryData for version 19.0.
CFTreeMBS.XMLNode as CFXMLNodeMBS
Function:
Returns the xml node for this tree node.
Notes: nil on any error.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | CoreFoundation | MBS MacCF Plugin | 4.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Notes: nil on any error.
Some examples using this method:
The items on this page are in the following plugins: MBS MacCF Plugin.
Feedback: Report problem or ask question.