I am having a bit of a problem trying to parse an XML file generated with Axis Java Web Service in C#. The file has the following format:
<ns:getAcctsDetailResponse xmlns:ns="http://paymentdata.com">
<ns:return xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ax21="http://paymentdata.com/xsd" xsi:type="ax21:AcctsDetail">
<ax21:Status>15</ax21:Status>
<ax21:Name>John James</ax21:Name>
</ns:return>
</ns:getCustomerAcctsDetailResponse>
I use the code below to try to access the element needed but get the following error:
The ':' character, hexadecimal value 0x3A, cannot be included in a name.
XDocument xDoc = XDocument.Load(xml);
string accountName= xDoc.Root.Element("ns:return").Element("ax21:Name").Value;
Your help will be greatly appreciated.