ExtractXMLMap()

语法

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

参数

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.

返回值

无.

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.

示例

  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

参阅

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

已支持操作系统

所有

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