CreateXML()
语法
Result = CreateXML(#XML [, Encoding])概要
Creates a new empty XML tree identified by the #XML number.
参数
#XML A number to identify the new XML. #PB_Any can be used to auto-generate this number. Encoding (optional) The encoding to use for the XML tree. Valid values are: #PB_UTF8 (default) #PB_Ascii #PB_Unicode
返回值
Nonzero if the XML tree was created successfully, zero otherwise. If #PB_Any was used for the #XML parameter then the generated number is returned on success.
Remarks
The new XML tree will only have a root node which can be accessed with RootXMLNode(). To add new nodes, CreateXMLNode() can be used.
示例
; Create xml tree xml = CreateXML(#PB_Any) mainNode = CreateXMLNode(RootXMLNode(xml), "Zoo") ; Create first xml node (in main node) item = CreateXMLNode(mainNode, "Animal") SetXMLAttribute(item, "id", "1") SetXMLNodeText(item, "Elephant") ; Create second xml node (in main node) item = CreateXMLNode(mainNode, "Animal") SetXMLAttribute(item, "id", "2") SetXMLNodeText(item, "Tiger") ; Save the xml tree into a xml file SaveXML(xml, "demo.xml")
参阅
FreeXML(), CreateXMLNode(), RootXMLNode()
已支持操作系统
所有