Share via


Form.XmlToHashtable Method (String)

Parses and converts an XML string such as Microsoft Office InfoPath workflow form data into a hash table.

Namespace:  Microsoft.Office.Workflow.Utility
Assembly:  Microsoft.Office.Workflow.Pages (in Microsoft.Office.Workflow.Pages.dll)

Syntax

'Declaration
Public Shared Function XmlToHashtable ( _
    xml As String _
) As Hashtable
'Usage
Dim xml As String
Dim returnValue As Hashtable

returnValue = Form.XmlToHashtable(xml)
public static Hashtable XmlToHashtable(
    string xml
)

Parameters

Return Value

Type: System.Collections.Hashtable
The hash table representation of the XML data that was passed in.

Remarks

Keys in the hash table are matched to the top-level schema nodes in the XML.

The XmlToHashtable method creates only one level of hash table. It converts tags as keys and values of type string. In the following code examples, the XML data (first code example), gives you the hash table (second code example). where the following is specified:

  • ht["a"] is the value "aaa" as string.

  • ht["b"] is the value "bbb" as string

  • ht["c"] is the value "<d>ddd</d>" as string.

<data>
  <a>aaa</a>
  <b>bbb</b>
  <c>
    <d>ddd</d>
  </c>
</data>
Hashtable ht = XmlToHashtable(data);

For an example of how to use the XmlToHashtable method, see the example in ContactExpandGroups() method.

See Also

Reference

Form Class

Form Members

XmlToHashtable Overload

Microsoft.Office.Workflow.Utility Namespace