最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp.net 读取带命名空间的Xml文档
时间:2022-06-25 06:34:54 编辑:袖梨 来源:一聚教程网
| 代码如下 | 复制代码 |
| StringReader textReader = new StringReader(surveyProject.SurveryContent); XPathDocument xd = new XPathDocument(textReader); XPathNavigator navigator = xd.CreateNavigator(); -- 加入命名空间 NameTable nt = new NameTable(); XmlNamespaceManager nsmgr = new XmlNamespaceManager(nt); nsmgr.AddNamespace("rc", "http://sechemas.*hir*e*de.com/2011/05/Apps/ReferenceChecking"); -- 用的时候还得传入 XPathNavigator pathNavigator = navigator.SelectSingleNode("//rc:BasicInformation/rc:Name", nsmgr); if (pathNavigator != null) { return pathNavigator.Value; } |
|
相关文章
- Linux防火墙如何达成网络隔离 07-27
- 微软利用AI加速漏洞识别:Windows 11补丁星期二更新规模将扩大 07-27
- 微软发布Aurora 1.5:用于天气与地球系统应用扩展的基础模型 07-27
- 谷歌发布 LiteRT.js 库:Web AI 推理最高提速 3 倍 07-27
- 妄想山海五周年大版本预告 07-27
- 如何通过竞品分析:快速找到自己的GEO产品方向 07-27