Hello İpek,
David's original post was from 2018. My guess is his attachment may have been lost when we converted from one community platform to the current platform. Having said that, you can implement XML to Collection conversion fairly easily with a Code stage, but unless you XML is very simple I don't think the output is going to be what you're expecting.
The issue here is that most XML tends to be fairy complex in terms of elements within elements and attributes on elements. This doesn't actually map very well to a Collection unless you define the schema yourself upfront. If you leave it to .NET to infer the schema of the data what typically happens is you end up with multiple DataTables (i.e. BP Collections).
Within .NET there's the System.Data namespace which contains the DataSet and DataTable class definitions. Contrary to most examples you find on the internet, you will not be able to convert straight from XML to a DataTable - unless your XML is VERY simple (i.e. only single depth). Instead, you will need to make use of the DataSet class and then pull your specific DataTable out of the DataSet using the Tables attribute. Here's a brief example function in VB.Net:
Public Function ConvertXMLToDataTable(ByVal xmlData As String) As DataTable
Dim stream As StringReader = Nothing
Dim reader As XmlTextReader = Nothing
Try
Dim xmlDS As DataSet = New DataSet()
stream = New StringReader(xmlData)
reader = New XmlTextReader(stream)
xmlDS.ReadXml(reader)
Return xmlDS.Tables(0)
Catch
Return Nothing
Finally
If reader IsNot Nothing Then reader.Close()
End Try
End Function
NOTE: This is just one example of how to do it. There are various differences in coding this.
As I mentioned above, I don't think this will ultimately give you what you're expecting, but give it a try and see what you think. Alternatively, you can use the
Utility - XML VBO, from the Digital Exchange, the help you process any XML you have.
Cheers,
------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------