c# - 读取 XML 没有结果
问题描述
我正在尝试枚举此 xml(示例):
<SearchSuggestion xmlns="http://opensearch.org/searchsuggest2" version="2.0">
<Query xml:space="preserve">Relativity</Query>
<Section>
<Item>
<Text xml:space="preserve">Relativity</Text>
<Url xml:space="preserve">https://en.wikipedia.org/wiki/Relativity</Url>
</Item>
<Item>
<Text xml:space="preserve">Relativity priority dispute</Text>
<Url xml:space="preserve">https://en.wikipedia.org/wiki/Relativity_priority_dispute</Url>
</Item>
....
使用:
XmlNodeList nItems = rssDoc.SelectNodes("/SearchSuggestion/Section/Item")
但它没有产生任何结果。谁能告诉我为什么?
解决方案
推荐阅读
- visual-studio - Visual Studio Profiler 将“[broken]”显示为函数名称
- python - 将 Python 脚本转换为 PowerShell
- python - 如何获取熊猫系列中值的索引
- node.js - 使用 Node.JS Readline:“TypeError: rl is not async iterable”
- asp.net-core - AspNetCore cookie 和 bearer 一起使用,并让 Authorize 属性默认同时使用
- python - 用于“修剪”正态分布的 cdf
- java - 简单线程不能完全并行执行
- java - 如何在不存储数据两次的情况下链接 2 个不同的类对象中的数据
- python - Selenium 除了启动浏览器并打开页面外无法正常工作
- javascript - 如何从 React 项目的 API URL 中删除冒号 (:)