ExtractXMLMap()

Syntax

ExtractXMLMap(Node, Map() [, Flags])
Description
Extract elements from the given XML node into the specified Map(). The map will be cleared before extracting the elements.

Parameters

Node The XML node containing the map data.
Map() The map to fill with the XML elements. Any previous content of the map 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 map has a structure type. The XML nodes must have the form described in the InsertXMLMap() function. Nodes with different names are ignored by the extraction.

Example

  Xml$ = "<map><element key=" + Chr(34) + "theKey" + Chr(34) + ">the value</element></map>"
  
  If ParseXML(0, Xml$) And XMLStatus(0) = #PB_XML_Success
    NewMap Test.s()
    ExtractXMLMap(MainXMLNode(0), Test())
    
    ForEach Test()
      Debug MapKey(Test()) + " -> " + Test()
    Next
  Else
    Debug XMLError(0)
  EndIf

See Also

InsertXMLMap(), ExtractXMLArray(), ExtractXMLList(), ExtractXMLStructure()

Supported OS

All

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