ExtractXMLArray()

Syntax

ExtractXMLArray(Node, Array() [, Flags])
Description
Extract elements from the given XML node into the specified Array(). The array will be resized to the number of elements contained in the node.

Parameters

Node The XML node containing the array data.
Array() The array to fill with the XML elements. The array will be resized to have the same size as the number of element nodes. Any previous content of the array will be lost.
Flags (optional) If this parameter is set to #PB_XML_NoCase then the comparison of XML node and attribute names is performed case insensitive. The default is to be case sensitive.

Return value

None.

Remarks

The extraction is performed recursively if the array has a structure type. The XML nodes must have the form described in the InsertXMLArray() function. Nodes with different names are ignored by the extraction. If the array has more than one dimension, each element is expected to have attributes indicating the coordinates of the element named "a", "b" and so forth.

Example

  Xml$ = "<array><element>1</element><element>10</element><element>100</element></array>"
  
  If ParseXML(0, Xml$) And XMLStatus(0) = #PB_XML_Success
    Dim MyArray(0) ; will be resized by the next call
    ExtractXMLArray(MainXMLNode(0), MyArray())
    
    For i = 0 To ArraySize(MyArray())
      Debug MyArray(i)
    Next i
  Else
    Debug XMLError(0)
  EndIf

See Also

InsertXMLArray(), ExtractXMLList(), ExtractXMLMap(), ExtractXMLStructure()

Supported OS

All

<- ExportXMLSize() - XML Index - ExtractXMLList() ->