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

        <small id='4C4ib'></small><noframes id='4C4ib'>

        C#:如何从 XML 元素中删除命名空间信息

        C#: How to remove namespace information from XML elements(C#:如何从 XML 元素中删除命名空间信息)
          <tbody id='oJEhW'></tbody>
        <legend id='oJEhW'><style id='oJEhW'><dir id='oJEhW'><q id='oJEhW'></q></dir></style></legend>

        <small id='oJEhW'></small><noframes id='oJEhW'>

          <bdo id='oJEhW'></bdo><ul id='oJEhW'></ul>

            <tfoot id='oJEhW'></tfoot>
            <i id='oJEhW'><tr id='oJEhW'><dt id='oJEhW'><q id='oJEhW'><span id='oJEhW'><b id='oJEhW'><form id='oJEhW'><ins id='oJEhW'></ins><ul id='oJEhW'></ul><sub id='oJEhW'></sub></form><legend id='oJEhW'></legend><bdo id='oJEhW'><pre id='oJEhW'><center id='oJEhW'></center></pre></bdo></b><th id='oJEhW'></th></span></q></dt></tr></i><div id='oJEhW'><tfoot id='oJEhW'></tfoot><dl id='oJEhW'><fieldset id='oJEhW'></fieldset></dl></div>
                  本文介绍了C#:如何从 XML 元素中删除命名空间信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  如何从 C# 中的每个 XML 元素中删除xmlns:..."命名空间信息?

                  How can I remove the "xmlns:..." namespace information from each XML element in C#?

                  推荐答案

                  尽管 Zombiesheep 给出了警告性的回答,我的解决方案是使用 xslt 转换来清洗 xml 以执行此操作.

                  Zombiesheep's cautionary answer notwithstanding, my solution is to wash the xml with an xslt transform to do this.

                  wash.xsl:

                  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
                    <xsl:output method="xml" indent="no" encoding="UTF-8"/>
                  
                    <xsl:template match="/|comment()|processing-instruction()">
                      <xsl:copy>
                        <xsl:apply-templates/>
                      </xsl:copy>
                    </xsl:template>
                  
                    <xsl:template match="*">
                      <xsl:element name="{local-name()}">
                        <xsl:apply-templates select="@*|node()"/>
                      </xsl:element>
                    </xsl:template>
                  
                    <xsl:template match="@*">
                      <xsl:attribute name="{local-name()}">
                        <xsl:value-of select="."/>
                      </xsl:attribute>
                    </xsl:template>
                  
                  </xsl:stylesheet>
                  

                  这篇关于C#:如何从 XML 元素中删除命名空间信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  C# namespace alias - what#39;s the point?(C# 命名空间别名 - 有什么意义?)
                  Using Xpath With Default Namespace in C#(在 C# 中使用具有默认命名空间的 Xpath)
                  IBM.Data.DB2.Core connection problems(IBM.Data.DB2.Core 连接问题)
                  Generating an EDMX from a DB2 Database(从 DB2 数据库生成 EDMX)
                  Datetime field overflow with IBM Data Server Client v9.7fp5(IBM Data Server Client v9.7fp5 的日期时间字段溢出)
                  Using entity Framework with .NET Core and DB2(将实体框架与 .NET Core 和 DB2 结合使用)
                  <legend id='t5z9z'><style id='t5z9z'><dir id='t5z9z'><q id='t5z9z'></q></dir></style></legend>

                  <small id='t5z9z'></small><noframes id='t5z9z'>

                  • <tfoot id='t5z9z'></tfoot>

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