C# LINQ到XML的问题
我有一个xmlC# LINQ到XML的问题,c#,.net,xml,linq-to-xml,C#,.net,Xml,Linq To Xml,我有一个xml <MyRoot> <ITEM> <Created>Customer created Aug 22 2011 9:28AM Contact Details Last Updated Aug 22 2011 9:39AM</Created> <Name>SomeName</Name> <Address>High way to hell</Address>
<MyRoot>
<ITEM>
<Created>Customer created Aug 22 2011 9:28AM
Contact Details Last Updated Aug 22 2011 9:39AM</Created>
<Name>SomeName</Name>
<Address>High way to hell</Address>
<Phone1>123456</Phone1>
<Phone2></Phone2>
<Mobile>654321</Mobile>
<Email>myemail@gmail.com</Email>
</ITEM>
</MyRoot>
我得到类型为的元素
{System.Xml.Linq.XContainer+<GetElements>d__11} System.Type {System.RuntimeType}
{System.Xml.Linq.XContainer+d_u11}System.Type{System.RuntimeType}
元素数为0
如何获取项目集合?XML区分大小写
var items= xdoc.Root.Elements("ITEM");
XML区分大小写
var items= xdoc.Root.Elements("ITEM");