• <bdo id='5dDCM'></bdo><ul id='5dDCM'></ul>

    <small id='5dDCM'></small><noframes id='5dDCM'>

  • <legend id='5dDCM'><style id='5dDCM'><dir id='5dDCM'><q id='5dDCM'></q></dir></style></legend>

    1. <tfoot id='5dDCM'></tfoot>
      1. <i id='5dDCM'><tr id='5dDCM'><dt id='5dDCM'><q id='5dDCM'><span id='5dDCM'><b id='5dDCM'><form id='5dDCM'><ins id='5dDCM'></ins><ul id='5dDCM'></ul><sub id='5dDCM'></sub></form><legend id='5dDCM'></legend><bdo id='5dDCM'><pre id='5dDCM'><center id='5dDCM'></center></pre></bdo></b><th id='5dDCM'></th></span></q></dt></tr></i><div id='5dDCM'><tfoot id='5dDCM'></tfoot><dl id='5dDCM'><fieldset id='5dDCM'></fieldset></dl></div>

        使用 C#、LINQ 从 xml 字符串中读取子节点

        时间:2023-08-26

        • <bdo id='2t1gx'></bdo><ul id='2t1gx'></ul>

          <tfoot id='2t1gx'></tfoot>

          <small id='2t1gx'></small><noframes id='2t1gx'>

          <legend id='2t1gx'><style id='2t1gx'><dir id='2t1gx'><q id='2t1gx'></q></dir></style></legend>

              <i id='2t1gx'><tr id='2t1gx'><dt id='2t1gx'><q id='2t1gx'><span id='2t1gx'><b id='2t1gx'><form id='2t1gx'><ins id='2t1gx'></ins><ul id='2t1gx'></ul><sub id='2t1gx'></sub></form><legend id='2t1gx'></legend><bdo id='2t1gx'><pre id='2t1gx'><center id='2t1gx'></center></pre></bdo></b><th id='2t1gx'></th></span></q></dt></tr></i><div id='2t1gx'><tfoot id='2t1gx'></tfoot><dl id='2t1gx'><fieldset id='2t1gx'></fieldset></dl></div>
                    <tbody id='2t1gx'></tbody>
                  本文介绍了使用 C#、LINQ 从 xml 字符串中读取子节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  - <entry xml:base="http://testserver.windows.net/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" m:etag="W/"datetime'2015-08-30T00%3A04%3A02.9193525Z'"">
                    <id>http://testserver.windows.net/Players(PartitionKey='zzz',RowKey='000125')</id> 
                    <category term="testServer.Players" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> 
                    <link rel="edit" title="Players" href="Players(PartitionKey='zzz',RowKey='000125')" /> 
                    <title /> 
                    <updated>2014-04-30T00:53:42Z</updated> 
                  - <author>
                    <name /> 
                    </author>
                  - <content type="application/xml">
                  - <m:properties>
                    <d:PartitionKey>zzz</d:PartitionKey> 
                    <d:RowKey>000125</d:RowKey> 
                    <d:Timestamp m:type="Edm.DateTime">2014-04-30T00:04:02.9193525Z</d:Timestamp> 
                    <d:Name>Black color</d:Name> 
                    <d:Comments>Test comments</d:Comments> 
                    </m:properties>
                    </content>
                    </entry>
                  

                  如何使用 C# 或 LINQ 读取m:properties"后代.此 xml 字符串存储在 XElement 类型的变量中

                  How can I read "m:properties" descendants using C# or LINQ. This xml string is stored in variable of type XElement

                  推荐答案

                  你可以使用XNamespace+"element local name"的组合来引用命名空间中的元素,对于示例:

                  You can use combination of XNamespace+"element local name" to reference element in namespace, for example :

                  XElement myxelement = XElement.Parse("your XML string here");
                  XNamespace m = "http://schemas.microsoft.com/ado/2007/08/dataservices/metadata";
                  List<XElement> properties = myxelement.Descendants(m+"properties").ToList();
                  

                  这篇关于使用 C#、LINQ 从 xml 字符串中读取子节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:单遍读取和验证 XML 与 C# 中引用的 XSD 下一篇:编写xml并读回c#

                  相关文章

                  最新文章

                1. <small id='mOygq'></small><noframes id='mOygq'>

                    • <bdo id='mOygq'></bdo><ul id='mOygq'></ul>
                  1. <tfoot id='mOygq'></tfoot>
                  2. <i id='mOygq'><tr id='mOygq'><dt id='mOygq'><q id='mOygq'><span id='mOygq'><b id='mOygq'><form id='mOygq'><ins id='mOygq'></ins><ul id='mOygq'></ul><sub id='mOygq'></sub></form><legend id='mOygq'></legend><bdo id='mOygq'><pre id='mOygq'><center id='mOygq'></center></pre></bdo></b><th id='mOygq'></th></span></q></dt></tr></i><div id='mOygq'><tfoot id='mOygq'></tfoot><dl id='mOygq'><fieldset id='mOygq'></fieldset></dl></div>

                  3. <legend id='mOygq'><style id='mOygq'><dir id='mOygq'><q id='mOygq'></q></dir></style></legend>