I would go for Python instead. ADF doesn't have direct XML processing capabilities, but you can integrate it with Azure Functions or Data Lake Analytics to process XML files.
Star using an XML parser like ElementTree
in Python to parse the XML file. You'll want to navigate through the XML tree and find the first 'Cube' element with a 'time' attribute (which represents the latest day).
Once you have the first 'Cube' element, you can extract its child elements and their attributes (currencies and rates).
import xml.etree.ElementTree as ET
import json
xml_data = '''<gesmes:Envelope xmlns:gesmes="http://www.gesmes.org/xml/2002-08-01" ... </gesmes:Envelope>'''
root = ET.fromstring(xml_data)
for cube in root.findall('.//{http://www.ecb.int/vocabulary/2002-08-01/eurofxref}Cube[@time]'):
latest_cube = cube
break
currencies = []
for currency in latest_cube:
currency_data = {
'currency': currency.get('currency'),
'rate': currency.get('rate')
}
currencies.append(currency_data)
json_data = json.dumps(currencies, indent=4)
print(json_data)