hi i have an xml like this
<?xml version="1.0"?>
<DataSetExchangeWMS xmlns="http://tempuri.org/DataSetExchangeWMS.xsd">
<dtObjektInfo>
<LanguageCode>1031</LanguageCode>
<LiegenschaftID>7463</LiegenschaftID>
</dtObjektInfo>
1040 7463 09
Now as i learned from tutorial i get my xml file and select node from descendant.
now why the first foreache does not work? i need to create complicated queries.
XDocument test = XDocument.Load(Server.MapPath("~/XML/objects.xml"));
var objecte = from i in test.Root.Descendants("dtObjektInfo")
select i;
// new test with where
var objecte = from i in test.Descendants( ns + "dtObjektInfo")
where i.Element("LanguageCode").Value == "1031"
select i;
foreach (var item1 in objecte)
{
Response.Write(item1.Value);
}
foreach (XElement item in test.Root.Nodes())
{
Response.Write(item.Value + "<br />");
}