InsertXMLList()
语法
Result = InsertXMLList(ParentNode, List() [, PreviousNode])概要
Insert the specified List() as a new XML node into the given parent node.
参数
ParentNode The node into which to insert the new node. To insert the new node at the root of the tree, RootXMLNode() can be used here. List() The list to insert into the XML. PreviousNode (optional) A childnode of 'ParentNode' after which the new node should be inserted. If this value is 0 or not specified, the new node is inserted as the first child of its parent. If this value is -1, the node is inserted as the last child of its parent.
返回值
The new XML node if it was created successfully or zero if no node could be inserted at this point.
Remarks
The rules specified in the CreateXMLNode() for where a new node can be inserted also apply to this function.
The inserted node is named "list" and the contained element nodes are named "element". See below for an example of the created XML.
示例
; This example produces the following XML tree: ; ; <list> ; <element>square</element> ; <element>circle</element> ; <element>triangle</element> ; </list> ; NewList Shapes$() AddElement(Shapes$()): Shapes$() = "square" AddElement(Shapes$()): Shapes$() = "circle" AddElement(Shapes$()): Shapes$() = "triangle" If CreateXML(0) InsertXMLList(RootXMLNode(0), Shapes$()) FormatXML(0, #PB_XML_ReFormat) Debug ComposeXML(0) EndIf
示例
; This example produces the following XML tree: ; ; <list> ; <element> ; <x>100</x> ; <y>200</y> ; </element> ; <element> ; <x>200</x> ; <y>400</y> ; </element> ; </list> ; Structure Position x.l y.l EndStructure NewList Positions.Position() For i = 1 To 2 AddElement(Positions()) Positions()\x = 100 * i Positions()\y = 200 * i Next i If CreateXML(0) InsertXMLList(RootXMLNode(0), Positions()) FormatXML(0, #PB_XML_ReFormat) Debug ComposeXML(0) EndIf
参阅
ExtractXMLList(), InsertXMLArray(), InsertXMLMap(), InsertXMLStructure()
已支持操作系统
所有