Parse XML string in ADF

TC 1 Reputation point
2022-03-14T16:12:18.223+00:00

Hi,
Looking for help to parse an XML string in azure data factory.

the simple example provided here does not include how to extract element attributes
https://learn.microsoft.com/en-gb/azure/data-factory/data-flow-parse

What would the expression be to extract id, name and address from the below XML.

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,623 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. MarkKromer-MSFT 5,226 Reputation points Microsoft Employee Moderator
    2022-03-15T00:14:21.937+00:00

    When you go into the expression builder, say from a derived column, do you see the input schema like this?

    183045-image.png


  2. Chaithra Siddappa 20 Reputation points
    2023-02-09T09:08:28.65+00:00

    Hi,
    Would I be getting any inputs to parse a xml within a string ?
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

    soap:Body

    <ExtractDataResponse xmlns="https://www.rivosafeguard.com/ws">

    <ExtractDataResult><DocumentElement> <DataTable> <someID>12375637</someID> <someother>241309</someother>

    </DataTable> </DocumentElement></ExtractDataResult>

    </ExtractDataResponse>

    </soap:Body>

    </soap:Envelope>

    over here, the xml is encapsulated within a string !
    and the data in the landing is also a string !
    below is the output in my blob storage. is there a way I can parse this ?
    Thanks !

    "<DocumentElement>
      <DataTable>
        <someID>1237563</someID>
        <someother>24139</someother>
      </DataTable>
    </DocumentElement>"
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.