小编mli*_*me2的帖子

解析包含冒号的 xml

我有这个 XML 文本:

<test:solution xmlns:test="http://www.test.com/">
    <script/>
    <test:question>
        <test:param name="name1">value 1</test:param>
        <test:param name="name2"> value 2</test:param>
    </test:question>
</test:solution>
Run Code Online (Sandbox Code Playgroud)

当我运行包含这些行的应用程序时:

XmlDocument doc = new XmlDocument();
doc.Load(xmlUrl);
XmlNode testQuestions = doc.SelectSingleNode("/test:solution/test:question");
//XmlNodeList testParamNodeList = testQuestions.SelectNodes("test:param");
Run Code Online (Sandbox Code Playgroud)

它给出了一个错误,我知道错误来自冒号,但我不知道如何解决它。
感谢帮助

c# xml parsing

0
推荐指数
1
解决办法
554
查看次数

标签 统计

c# ×1

parsing ×1

xml ×1