Hi i'm trying to read in an XML File that is like the following
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfSYMBOL xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SYMBOL Code="AA.P" Name="Alcoa Inc Pf 3.75" />
<SYMBOL Code="AADR" Name="Wcm Bny Focused Growth Adr ETF" />
<SYMBOL Code="AAU" Name="Almaden Minerals" />
<SYMBOL Code="AAVX" Name="Etracs Daily Short 1 Month S&P" />
</ArrayOfSYMBOL>
And Im trying to get a message box to show the Code Values one by one
XmlDocument xml = new XmlDocument();
xml.LoadXml(filePath);
XmlNodeList xnList = xml.SelectNodes("SYMBOL");
foreach (XmlNode xn in xnList)
{
MessageBox.Show(xn["Code"].InnerText);
}
But I keep get the error Data at the root level is invalid. Line 1,postion 1.
What should I do to get it to work
Cheers Sam