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>
<Phone1>123456</Phone1>
<Phone2></Phone2>
<Mobile>654321</Mobile>
<Email>[email protected]</Email>
</ITEM>
</MyRoot>
,它的值是 xdoc ([System.RuntimeType] {System.Xml.Linq.XDocument} System.RuntimeType)
当我执行此操作时:
var items= xdoc.Root.Elements("Item");
我得到类型元素
{System.Xml.Linq.XContainer+<GetElements>d__11} System.Type {System.RuntimeType}
,元素数量为 0。
我怎样才能获得物品收藏?
I have a 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>
<Phone1>123456</Phone1>
<Phone2></Phone2>
<Mobile>654321</Mobile>
<Email>[email protected]</Email>
</ITEM>
</MyRoot>
and it's a value of xdoc ([System.RuntimeType] {System.Xml.Linq.XDocument} System.RuntimeType)
When I execute this:
var items= xdoc.Root.Elements("Item");
i get element of type
{System.Xml.Linq.XContainer+<GetElements>d__11} System.Type {System.RuntimeType}
and with 0 as number of elements.
How can I get collection of items ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
XML 区分大小写。
XML is case-sensitive.