I am trying to read in a simple XML file, however when I run the SQL it always returns Ennumeration Yeilded no results.
Not sure what I am going wrong.
XDocument xmlInfo = XDocument.Parse(xmlContent);
XNamespace ns = xmlInfo.Root.Name.Namespace;
XNamespace ns = xmlBuilderInfo.Root.Name.Namespace;
var Info = from XMLtagin xmlInfo.Descendants()
where XMLtag.Name.LocalName == "XMLtag"
select new Information
{
Name = XMLtag.Element("name").Value.ToString(),
Region = XMLtag.Element("negion").Value.ToString()
};
InfoList.SelectedIndex = -1;
InfoList.ItemsSource = Info;
Any idea what I have done wrong???
Here is a sample of the XML file also
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<NameAndRegionDataSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<XMLTag>
<Name>Content</Name>
<Region>Peterborough</Region>
</XMLTag>
<XMLTag>
<Name>Content</Name>
<Region>Medicine Hat</Region>
</XMLTag>