cancel
Showing results for 
Search instead for 
Did you mean: 

Converting RAWXML inc. HTML to Collection

UsamaZubair
Level 2

Hi,

I am trying to convert RAWXML data contained in a Data item to extract all elements into a Collection. The data contains html elements as well as well XML data that needs to be converted. I was wondering if there is any pre-built object in DX or custom code that can be ran to resolve this. I have already used Utility - XML by passing in the elements however that has not returned anything back.

Any help would be appreciated. Thanks

1 REPLY 1

faheemsd
Level 6

Dear Usama,

I would suggest the following steps.

1. Parse the RAW XML data:

Use a "Utility - XML" action or a custom code stage to parse the RAW XML data into a structured format. For example, you can use the XmlDocument class in .NET to load and parse the XML data.
Extract the elements you need from the XML data. You can navigate the XML structure using XPath expressions to locate specific elements.

2. Extract elements into a Collection:

Create a Collection to store the extracted elements.
Iterate over the parsed XML data and extract the desired elements.
Add each extracted element to the Collection using Blue Prism's Collection manipulation actions such as "Utility - Collection Manipulation" or custom code stages.