Retrieve data from complex XML file

Hi

I am new to XML and was wondering if you could assist in advising how to retrieve data such as account number, carrier name and pricing from the following webservice response XML structure to populate a Business Central table.


123456TEST CARRIER1ZONE 11/04/202120210401ZONE 1NDozOjEwOi0xOjMy65.9013.18NEXT DAY


789456TEST CARRIER2ZONE 11/04/202120210401ZONE 1NTozOjEzOi0xOjMy69.0013.80NEXT DAY
565656TEST CARRIER3ZONE 11/04/202120210401ZONE 1NjozOjc6LTE6MzI=72.5014.50NEXT DAY


False
cost
<_nonratingzonesdone>-196865584</_nonratingzonesdone>


I am struggling to get my head around XMLNode Lists, XML Nodes and XML Elements. Any advice on how to loop through this structure would be much appreciated.

Regards

Gurnek

No idea if this helps, but I saw this link in the related section below. https://dynamicsuser.net/nav/f/developers/95054/import-of-complex-xml-file If it doesn’t help, @ erik ernst and maybe he can give you some additional info [emoticon:c4563cd7d5574777a71c318021cbbcc8]

Thank you Jake. I think the issue with the file i am receiving is that all the required data is in a CDATA section. (following output is from the api call documentation)

<GetDeliveryOptionsResult>
				<![CDATA[
				<deliveryoptionresults>
					<recommended>
						<DeliveryOption>
							<accno>123456</accno>
							<carriername>TEST CARRIER1</carriername>
							<carrzone>ZONE 1</carrzone>
							<condate>22/07/2020</condate>
							<datelong>20200722</datelong>
							<fromzone>ZONE 1</fromzone>
							<optionid>NDowOjA6LTE6MzIsMzI=</optionid>
							<primarypricing>13.18</primarypricing>
							<secondarypricing>2.64</secondarypricing>
							<service>NEXT DAY</service>
						</DeliveryOption>
					</recommended>
					<otheroptions>
						<DeliveryOption>
							<accno>789456</accno>
							<carriername>TEST CARRIER2</carriername>
							<carrzone>ZONE 1</carrzone>
							<condate>22/07/2020</condate>
							<datelong>20200722</datelong>
							<fromzone>ZONE 1</fromzone>
							<optionid>NTowOjA6LTE6MzIsMzI=</optionid>
							<primarypricing>13.80</primarypricing>
							<secondarypricing>2.76</secondarypricing>
							<service>NEXT DAY</service>
						</DeliveryOption>
						<DeliveryOption>
							<accno>565656</accno>
							<carriername>TEST CARRIER3</carriername>
							<carrzone>ZONE 1</carrzone>
							<condate>22/07/2020</condate>
							<datelong>20200722</datelong>
							<fromzone>ZONE 1</fromzone>
							<optionid>NjowOjA6LTE6MzIsMzI=</optionid>
							<primarypricing>14.50</primarypricing>
							<secondarypricing>2.90</secondarypricing>
							<service>NEXT DAY</service>
						</DeliveryOption>
					</otheroptions>
					<distance></distance>
					<istopobox>False</istopobox>
					<selectedtype>cost</selectedtype>
				</deliveryoptionresults>]]>
			</GetDeliveryOptionsResult>

Would you know how to extract the data from this kind of section?

Regards
Gurnek