<bdo id='6tB44'></bdo><ul id='6tB44'></ul>

<small id='6tB44'></small><noframes id='6tB44'>

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

      替换 XML 中的一些元素 [提供 XML 示例]

      时间:2023-11-10
      <i id='qOSQZ'><tr id='qOSQZ'><dt id='qOSQZ'><q id='qOSQZ'><span id='qOSQZ'><b id='qOSQZ'><form id='qOSQZ'><ins id='qOSQZ'></ins><ul id='qOSQZ'></ul><sub id='qOSQZ'></sub></form><legend id='qOSQZ'></legend><bdo id='qOSQZ'><pre id='qOSQZ'><center id='qOSQZ'></center></pre></bdo></b><th id='qOSQZ'></th></span></q></dt></tr></i><div id='qOSQZ'><tfoot id='qOSQZ'></tfoot><dl id='qOSQZ'><fieldset id='qOSQZ'></fieldset></dl></div>
      <tfoot id='qOSQZ'></tfoot>
        <tbody id='qOSQZ'></tbody>
    2. <small id='qOSQZ'></small><noframes id='qOSQZ'>

      • <legend id='qOSQZ'><style id='qOSQZ'><dir id='qOSQZ'><q id='qOSQZ'></q></dir></style></legend>
            • <bdo id='qOSQZ'></bdo><ul id='qOSQZ'></ul>

                本文介绍了替换 XML 中的一些元素 [提供 XML 示例]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我有一个看起来像这样的 xml 文档.我有一个如下结构的 XML 文件.示例 XML 如下:

                I have an xml document that looks like this.I have a XML file structured as below. Sample XML is as follows:

                    <Dr.Watson>
                    <Bugs>
                      <Bug Name="Bug.add --> AAAAAAAAAAAA">
                        <criteria>
                          <includeFilterSets>
                            <filterSet>
                              <filter>
                                <filterName>PRODUCT_NAME</filterName>
                                <operator>
                                  <name>Equals</name>
                                </operator>
                                <value>Dr.Watson</value>
                              </filter>
                            </filterSet>
                          </includeFilterSets>
                          <grouping>
                            <groupBy>
                              <name>STATUS</name>
                            </groupBy>
                          </grouping>
                          <caseSensitive>false</caseSensitive>
                          <entityToSearch>
                            <name>BUG</name>
                          </entityToSearch>
                        </criteria>
                      </Bug>
                      </Bugs>
                
                  </Dr.Watson>
                

                我想替换 XML 文件中的一些元素,如下所示:

                I want to replace some of elements in the XML file like below:

                <Dr.Watson>
                <Bugs>
                  <Bug Name="Bug.add --> AAAAAAAAAAAA">
                    <criteria>
                      <includeFilterSets>
                        <filterSet>
                          <filter>
                            <filterName>PRODUCT_NAME</filterName>
                            <operator>
                              <name>Equals</name>
                            </operator>
                            <value>Dr.Watson</value>
                          </filter>
                        </filterSet>
                      </includeFilterSets>
                      <grouping>
                        <groupBy>
                          <name>STATE</name>
                        </groupBy>
                      </grouping>
                      <caseSensitive>false</caseSensitive>
                      <entityToSearch>
                        <name>BUG</name>
                      </entityToSearch>
                    </criteria>
                  </Bug>
                  </Bugs>
                  </Dr.Watson>
                

                我想更改可用的 under,然后是 as State.请提出建议.

                i would like to change the available under followed by as State. Please suggest.

                推荐答案

                var xdoc = XDocument.Load(path_to_xml);
                var groupByName = xdoc.XPathSelectElement("//groupBy/name");
                groupByName.Value = "STATE";
                xdoc.Save(path_to_xml);
                

                这篇关于替换 XML 中的一些元素 [提供 XML 示例]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:论坛标签.实施它们的最佳方法是什么? 下一篇:标签系统的 linq 查询 - 搜索多个标签

                相关文章

                  <legend id='WeZbD'><style id='WeZbD'><dir id='WeZbD'><q id='WeZbD'></q></dir></style></legend>
                    <bdo id='WeZbD'></bdo><ul id='WeZbD'></ul>

                  <tfoot id='WeZbD'></tfoot>
                1. <small id='WeZbD'></small><noframes id='WeZbD'>

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