最新下载
热门教程
- 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; } |
|
相关文章
- 心动小镇10.24溜溜橡木与无瑕萤石位置 10-27
- 地下城堡4骑士与破碎编年史墓穴305层攻略 10-27
- 伙伴弹途守护灵祭坛升阶攻略 10-27
- 新三国志曹操传飞石御敌五关卡攻略 10-27
- 永远的蔚蓝星球天使阵容搭配推荐 10-27
- 伙伴弹途35关琉璃雪山打法攻略 10-27