<?xml version="1.0" encoding="UTF-8"?>
<Orders xmlns="www.test-inc.com">
<Order>
<Header>
<Address>
<AddressTypeCode>ST</AddressTypeCode>
<LocationCodeQualifier>51</LocationCodeQualifier>
<AddressName>Pepsi Distribution Center</AddressName>
<AddressAlternateName>ABC 123</AddressAlternateName>
<Address1>Safeway 7th Street</Address1>
<Address2>Suite 1</Address2>
<City>Detroit</City>
<State>MI</State>
<PostalCode>12345</PostalCode>
<Country>USA</Country>
</Address>
<Address>
<AddressTypeCode>BT</AddressTypeCode>
<LocationCodeQualifier>51</LocationCodeQualifier>
<AddressLocationNumber>15513432</AddressLocationNumber>
<AddressName>Main Headquarters</AddressName>
<AddressAlternateName>Attn: John</AddressAlternateName>
<Address1>147 Dupont Ave</Address1>
<Address2>Dock 123</Address2>
<City>Orlando</City>
<State>FL</State>
<PostalCode>12345</PostalCode>
<Country>USA</Country>
<Contact>
<ContactTypeCode>BD</ContactTypeCode>
<ContactName>Jane Doe</ContactName>
<PrimaryPhone>111-222-3333</PrimaryPhone>
<PrimaryFax>111-222-3333</PrimaryFax>
<PrimaryEmail>buyer@TEST.com</PrimaryEmail>
</Contact>
</Address>
</Header>
// Ship to Address
var addresses = xdoc.XPathSelectElements("//testinc:Address", nsmgr);//Get all the address childs : 2 in this case
List<string> listofAddresses = new List<string>();//List to store the addresses
foreach (XElement address in addresses)//For each line item
{
//something here?
}
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE