<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Example attached, you'll… in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/How-to-convert-xml-data-to-collection/m-p/72342#M24947</link>
    <description>Example attached, you'll need to rename it to .bprelease (the forums don't allow that file extension to be attached)</description>
    <pubDate>Fri, 02 Mar 2018 16:01:00 GMT</pubDate>
    <dc:creator>DavidEdwards-Da</dc:creator>
    <dc:date>2018-03-02T16:01:00Z</dc:date>
    <item>
      <title>How to convert xml data to collection</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-convert-xml-data-to-collection/m-p/72338#M24943</link>
      <description>I want my entire xml data to be converted to collection.

Thanks in advance.</description>
      <pubDate>Thu, 01 Mar 2018 15:55:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-convert-xml-data-to-collection/m-p/72338#M24943</guid>
      <dc:creator>AmitPatnaik</dc:creator>
      <dc:date>2018-03-01T15:55:00Z</dc:date>
    </item>
    <item>
      <title>A very vague statement but…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-convert-xml-data-to-collection/m-p/72339#M24944</link>
      <description>A very vague statement but you're likely to need to&amp;nbsp;create a bespoke&amp;nbsp;code stage to parse the XML input&amp;nbsp;into a .Net&amp;nbsp;Datatable output.</description>
      <pubDate>Thu, 01 Mar 2018 17:02:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-convert-xml-data-to-collection/m-p/72339#M24944</guid>
      <dc:creator>John__Carter</dc:creator>
      <dc:date>2018-03-01T17:02:00Z</dc:date>
    </item>
    <item>
      <title>Sorry for the unclear…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-convert-xml-data-to-collection/m-p/72340#M24945</link>
      <description>Sorry for the unclear statement :
Here is the requirement---

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Matthew
&amp;nbsp; &amp;nbsp; &amp;nbsp; XML Developer's Guide
&amp;nbsp; &amp;nbsp; &amp;nbsp; Computer
&amp;nbsp; &amp;nbsp; &amp;nbsp; 44.95
&amp;nbsp; &amp;nbsp; &amp;nbsp; 2000-10-01
&amp;nbsp; &amp;nbsp; &amp;nbsp; An in-depth look at creating applications&amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; with XML.
&amp;nbsp; &amp;nbsp;

&amp;nbsp; &amp;nbsp; &amp;nbsp; Ralls, Kim
&amp;nbsp; &amp;nbsp; &amp;nbsp; Midnight Rain
&amp;nbsp; &amp;nbsp; &amp;nbsp; Fantasy
&amp;nbsp; &amp;nbsp; &amp;nbsp; 5.95
&amp;nbsp; &amp;nbsp; &amp;nbsp; 2000-12-16
&amp;nbsp; &amp;nbsp; &amp;nbsp; A former architect battles corporate zombies,&amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; an evil sorceress, and her own childhood to become queen&amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; of the world.
&amp;nbsp; &amp;nbsp;
---------------------------------
output :
author |&amp;nbsp;title |&amp;nbsp;&amp;nbsp;genre |&amp;nbsp;&amp;nbsp;price |&amp;nbsp;publish_date |&amp;nbsp;description
and the 2 corresponding values
Hope I gave proper explanation.
Is this can be done by existing VBO or the code stage is the only solution</description>
      <pubDate>Fri, 02 Mar 2018 10:49:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-convert-xml-data-to-collection/m-p/72340#M24945</guid>
      <dc:creator>AmitPatnaik</dc:creator>
      <dc:date>2018-03-02T10:49:00Z</dc:date>
    </item>
    <item>
      <title>You probably would need your…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-convert-xml-data-to-collection/m-p/72341#M24946</link>
      <description>You probably would need your own code stage - the nearest example is in the Utility String object, on the pages Get XML Element and Get XML Attribute. You also use standard text manipulation for this example - use the Split Text action of the Utility String object to make a collection with each row containing a book element text. Then loop through the collection, extract what you want from each row and add it to a second collection that has the author |&amp;nbsp;title |&amp;nbsp;&amp;nbsp;genre |&amp;nbsp;&amp;nbsp;price |&amp;nbsp;publish_date |&amp;nbsp;description fields.</description>
      <pubDate>Fri, 02 Mar 2018 14:28:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-convert-xml-data-to-collection/m-p/72341#M24946</guid>
      <dc:creator>John__Carter</dc:creator>
      <dc:date>2018-03-02T14:28:00Z</dc:date>
    </item>
    <item>
      <title>Example attached, you'll…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-convert-xml-data-to-collection/m-p/72342#M24947</link>
      <description>Example attached, you'll need to rename it to .bprelease (the forums don't allow that file extension to be attached)</description>
      <pubDate>Fri, 02 Mar 2018 16:01:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-convert-xml-data-to-collection/m-p/72342#M24947</guid>
      <dc:creator>DavidEdwards-Da</dc:creator>
      <dc:date>2018-03-02T16:01:00Z</dc:date>
    </item>
    <item>
      <title>Thanks David for the help…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-convert-xml-data-to-collection/m-p/72343#M24948</link>
      <description>Thanks David for the help
It worked great</description>
      <pubDate>Mon, 05 Mar 2018 11:28:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-convert-xml-data-to-collection/m-p/72343#M24948</guid>
      <dc:creator>AmitPatnaik</dc:creator>
      <dc:date>2018-03-05T11:28:00Z</dc:date>
    </item>
    <item>
      <title>Thank you for sharing, David…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-convert-xml-data-to-collection/m-p/72344#M24949</link>
      <description>Thank you for sharing, David. Great, simple and very helpful!</description>
      <pubDate>Mon, 23 Jul 2018 20:58:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-convert-xml-data-to-collection/m-p/72344#M24949</guid>
      <dc:creator>AlexanderBopp</dc:creator>
      <dc:date>2018-07-23T20:58:00Z</dc:date>
    </item>
    <item>
      <title>RE: Example attached, you'll…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-convert-xml-data-to-collection/m-p/72345#M24950</link>
      <description>Hi David,&lt;BR /&gt;Can you share with me the bprelease for this function. Thanks in advance .&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;JUN CHOU&lt;BR /&gt;Analyst&lt;BR /&gt;IBM BPSO&lt;BR /&gt;Asia/Shanghai&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Thu, 19 Nov 2020 02:37:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-convert-xml-data-to-collection/m-p/72345#M24950</guid>
      <dc:creator>JUNCHOU</dc:creator>
      <dc:date>2020-11-19T02:37:00Z</dc:date>
    </item>
    <item>
      <title>RE: Example attached, you'll…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-convert-xml-data-to-collection/m-p/72346#M24951</link>
      <description>Hi David,&lt;BR /&gt;&lt;BR /&gt;Can you please share with me the bp release?&lt;BR /&gt;I coulnd't see the attachment..&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;İpek Işıldak&lt;BR /&gt;RPA Developer&lt;BR /&gt;Aksigorta&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Fri, 15 Apr 2022 07:56:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-convert-xml-data-to-collection/m-p/72346#M24951</guid>
      <dc:creator>İpekIşıldak</dc:creator>
      <dc:date>2022-04-15T07:56:00Z</dc:date>
    </item>
    <item>
      <title>RE: Example attached, you'll…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-convert-xml-data-to-collection/m-p/72347#M24952</link>
      <description>​Hello İpek,&lt;BR /&gt;&lt;BR /&gt;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. &lt;BR /&gt;&lt;BR /&gt;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).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;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:&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE class="language-vbnet"&gt;&lt;CODE&gt;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
​&lt;/CODE&gt;&lt;/PRE&gt;
​&lt;BR /&gt;&lt;STRONG&gt;NOTE:&lt;/STRONG&gt; This is just one example of how to do it. There are various differences in coding this.​&lt;BR /&gt;&lt;BR /&gt;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 &lt;STRONG&gt;Utility - XML&lt;/STRONG&gt; VBO, from the Digital Exchange, the help you process any XML you have.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Eric Wilson&lt;BR /&gt;Director, Integrations and Enablement&lt;BR /&gt;Blue Prism Digital Exchange&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Sun, 17 Apr 2022 15:38:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-convert-xml-data-to-collection/m-p/72347#M24952</guid>
      <dc:creator>ewilson</dc:creator>
      <dc:date>2022-04-17T15:38:00Z</dc:date>
    </item>
  </channel>
</rss>

