我正在使用 c# 处理 XML 文档。
<data>
<single>
<p xmlns="http://www.w3.org/1999/xhtml">
<strong>Hi hello bbvahvgxvzhavxhgsavxv</strong>
</p>
<p xmlns="http://www.w3.org/1999/xhtml">
<strong>dmcdnsbcdbn</strong>
</p>
</single>
<single>
<div xmlns="http://www.w3.org/1999/xhtml">
<strong>Hi hello bbvahvgxvzhavxhgsavxv</strong>
</div>
<span xmlns="http://www.w3.org/1999/xhtml">
<strong>dmcdnsbcdbn</strong>
</span>
</single>
</data>
我想删除所有<p>
,<div>
和<span>
标签。
需要的输出:
<data>
<single>
<strong>Hi hello bbvahvgxvzhavxhgsavxv</strong>
<strong>dmcdnsbcdbn</strong>
</single>
<single>
<strong>Hi hello bbvahvgxvzhavxhgsavxv</strong>
<strong>dmcdnsbcdbn</strong>
</single>
</data>
任何人都可以建议如何使用 C# 来做到这一点。使用 XmlDocument。