我又来提问了 关于XML node的问题

Anod Anod 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
- <bookstore>
- <book genre="autobiography" publicationdate="1991" ISBN="1-861003-11-0">
<title>The Autobiography of Benjamin Franklin</title>
- <author>
<first-name>Benjamin</first-name>
<last-name>Franklin</last-name>
</author>
<price>8.99</price>
</book>
- <book genre="novel" publicationdate="1967" ISBN="0-201-63361-2">
<title>The Confidence Man</title>
- <author>
<first-name>Herman</first-name>
<last-name>Melville</last-name>
</author>
<price>11.99</price>
</book>
- <book genre="philosophy" publicationdate="1991" ISBN="1-861001-57-6">
<title>The Gorgias</title>
- <author>
<name>Plato</name>
</author>
<price>9.99</price>
</book>
</bookstore>


为什么上述<title>The Autobiography of Benjamin Franklin</title>
中title node的value值为null 而竟然HasChildNodes为true, “The Autobiography of Benjamin Franklin”是作为一个名为“#Text”的ChildNode的Value值出现的,InnerText也是“The Autobiography of Benjamin Franklin”,但是InnerXml为空的字符串“”。求解释。 我需要把一个Node下的所有递归子节点或属性的name和对应的值输出出来。
...全文

相关推荐

评论 12
收藏 已收藏
分享
返回顶部
Anod
C# 111,129 成员 642,538 内容