Platforms to show: All Mac Windows Linux Cross-Platform
CFXMLNodeMBS class deprecated
Super class: CFObjectMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | CoreFoundation | MBS MacCF Plugin | 3.4 | ✅ 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 instructionTree as new CFTreeMBS
dim instructionInfo as new CFXMLProcessingInstructionInfoMBS
dim personInfo as new CFXMLElementInfoMBS
dim personNode as new CFXMLNodeMBS
dim personTree 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 person as CFStringMBS
const kCFStringEncodingUTF8=&h08000100
// create a document node
documentinfo.SourceURL=nil
documentinfo.CFStringEncoding=kCFStringEncodingUTF8
docnode.CreateDocument(documentinfo)
xmldocument.CreateWithXMLNode docNode
// Instruction Tag
instructionInfo.DataString=NewCFStringMBS("version=""1.0"" encoding=""utf-8"" ")
instructionNode.CreateProcessInstruction(NewCFStringMBS("xml"),instructionInfo)
instructionTree.CreateWithXMLNode(instructionNode)
// root element
personInfo.XMLAttributes=nil
personInfo.AttributeOrder=nil
personInfo.IsEmpty=false
person=NewCFStringMBS("person")
personNode.CreateElement person, personInfo
personTree.CreateWithXMLNode personNode
nameInfo.XMLAttributes=nil
nameInfo.AttributeOrder=nil
nameInfo.IsEmpty=false
namenode.CreateElement NewCFStringMBS("name"), nameInfo
nameTree.CreateWithXMLNode nameNode
personTree.AppendChild nameTree
nameTextNode.CreateText NewCFStringMBS("Apple")
nameTextTree.CreateWithXMLNode nameTextNode
nameTree.AppendChild nameTextTree
nameTextNode2.CreateText NewCFStringMBS("Orange")
nameTextTree2.CreateWithXMLNode nameTextNode2
nameTree.AppendChild nameTextTree2
CFShowMBS(xmldocument)
xmldocument.AppendChild instructionTree
xmldocument.AppendChild personTree
MsgBox xmldocument.XMLData.str
// shows "<?xml version="1.0" encoding="utf-8" ?><person><name>AppleOrange</name></person>"
This item is deprecated and should no longer be used.
You can use XML classes instead.
Notes:
An CFXMLNode describes an individual XML construct - like a tag, or a comment, or a string of character data. Each CFXMLNode contains 3 main pieces of information - the node's type, the data string, and a pointer to an additional data structure. The node's type ID is an enum value of type CFXMLNodeTypeCode. The data string is always a CFStringRef; the meaning of the string is dependent on the node's type ID. The format of the additional data is also dependent on the node's type; in general, there is a custom structure for each type that requires additional data. See below for the mapping from type ID to meaning of the data string and structure of the additional data.
Type codes for the different possible XML nodes; this list may grow:
Constant name | value | Meaning of Data string | Additional information |
kCFXMLNodeTypeDocument | 1 | <currently unused> | CFXMLDocumentInfoMBS |
kCFXMLNodeTypeElement | 2 | tag name | CFXMLElementInfoMBS |
kCFXMLNodeTypeAttribute | 3 | <currently unused> | <currently unused> |
kCFXMLNodeTypeProcessingInstruction | 4 | name of the target | CFXMLProcessingInstructionInfoMBS |
kCFXMLNodeTypeComment | 5 | text of the comment | nil |
kCFXMLNodeTypeText | 6 | the text's contents | nil |
kCFXMLNodeTypeCDATASection | 7 | text of the CDATA | nil |
kCFXMLNodeTypeDocumentFragment | 8 | <currently unused> | <currently unused> |
kCFXMLNodeTypeEntity | 9 | name of the entity | CFXMLEntityInfoMBS |
kCFXMLNodeTypeEntityReference | 10 | name of the referenced entity | CFXMLEntityReferenceInfoMBS |
kCFXMLNodeTypeDocumentType | 11 | name given as top-level element | CFXMLDocumentTypeInfoMBS |
kCFXMLNodeTypeWhitespace | 12 | text of the whitespace | nil |
kCFXMLNodeTypeNotation | 13 | notation name | CFXMLNotationInfoMBS |
kCFXMLNodeTypeElementTypeDeclaration | 14 | tag name | CFXMLElementTypeDeclarationInfoMBS |
kCFXMLNodeTypeAttributeListDeclaration | 15 | tag name | CFXMLAttributeListDeclarationInfoMBS |
- 27 methods
- method Copy as CFXMLNodeMBS
- method CreateAttribute
- method CreateAttributeListDeclaration(TagName as CFStringMBS, data as CFXMLAttributeListDeclarationInfoMBS)
- method CreateCDATASection(text as CFStringMBS)
- method CreateComment(comment as CFStringMBS)
- method CreateDocument(documentinfo as CFXMLDocumentInfoMBS)
- method CreateDocumentFragment
- method CreateDocumentType(Name as CFStringMBS, data as CFXMLDocumentTypeInfoMBS)
- method CreateElement(TagName as CFStringMBS, data as CFXMLElementInfoMBS)
- method CreateElementTypeDeclaration(TagName as CFStringMBS, data as CFXMLElementTypeDeclarationInfoMBS)
- method CreateEntity(EntityName as CFStringMBS, data as CFXMLEntityInfoMBS)
- method CreateEntityReference(EntityReferenceName as CFStringMBS, data as CFXMLEntityReferenceInfoMBS)
- method CreateNotation(NotationName as CFStringMBS, data as CFXMLNotationInfoMBS)
- method CreateProcessInstruction(Target as CFStringMBS, data as CFXMLProcessingInstructionInfoMBS)
- method CreateText(text as CFStringMBS)
- method CreateWhitespace(text as CFStringMBS)
- method Data as CFStringMBS
- method GetCFXMLAttributeListDeclarationInfo as CFXMLAttributeListDeclarationInfoMBS
- method GetCFXMLDocumentInfo as CFXMLDocumentInfoMBS
- method GetCFXMLDocumentTypeInfo as CFXMLDocumentTypeInfoMBS
- method GetCFXMLElementInfo as CFXMLElementInfoMBS
- method GetCFXMLElementTypeDeclarationInfo as CFXMLElementTypeDeclarationInfoMBS
- method GetCFXMLEntityInfo as CFXMLEntityInfoMBS
- method GetCFXMLEntityReferenceInfo as CFXMLEntityReferenceInfoMBS
- method GetCFXMLNotationInfo as CFXMLNotationInfoMBS
- method GetCFXMLProcessingInstructionInfo as CFXMLProcessingInstructionInfoMBS
- method TypeCode as Integer
Super class CFObjectMBS
- 5 properties
- property Handle as Integer
- property Hash as Integer
- property Lasterror as Integer
- property Type as Integer
- property TypeDescription as String
- 9 methods
- method close
- method DeepCopy as CFObjectMBS
- method EncodedData as MemoryBlock
- method Equal(o as CFObjectMBS) as boolean
- method ReleaseObject
- method RetainCount as Integer
- method RetainObject
- method XML as CFBinaryDataMBS
- method XMLdata as String
- shared method NewCFObject(handle as Integer) as CFObjectMBS
This class has no sub classes.
Some methods using this class:
- CFTreeMBS.CreateWithXMLNode(node as CFXMLNodeMBS)
- CFTreeMBS.XMLNode as CFXMLNodeMBS
Some events using this class:
- CFXMLParserMBS.CreateXMLStructure(node as CFXMLNodeMBS) as CFObjectMBS
Some examples using this class:
Blog Entries
The items on this page are in the following plugins: MBS MacCF Plugin.
CFXMLExternalIDMBS - CFXMLNotationInfoMBS
Feedback: Report problem or ask question.