I'm working with the USPS API to verify addresses that are in an Excel file. API responses look like this:
<?xml version="1.0" encoding="UTF-8"?>
<AddressValidateResponse>
<Address ID="0">
<Address2>3131 SPRING GROVE AVE</Address2>
<City>CINCINNATI</City>
<State>OH</State>
<Zip5>45225</Zip5>
<Zip4>1862</Zip4>
<ReturnText>Default address: The address you entered was found but more information is needed (such as an apartment, suite, or box number) to match to a specific address.</ReturnText>
</Address>
</AddressValidateResponse>
=XPathOnUrl(A1,"addressvalidateresponse") returns all the fields under ID=0 concatenated into one cell. I'd like to have this return an array that puts each node in its own cell, and I haven't been able to figure it out. Here's what I've tried:
=XPathOnUrl($A$1,"/addressvalidateresponse[@address='0']")
An added challenge is that the API only responds with nodes that are used. If you submit an address with STE 10040 MAIN ST, the server may respond with no Address1 and 40 MAIN ST STE 100. I'd like to have results in the same column every time, if that's possible. Any ideas?