c#select单节点xpath返回null

时间:2015-08-04 15:53:34

标签: c# xpath

我在c#项目中有一个app配置,我需要在运行时编辑。作为其中的一部分,我有一个自定义部分集合,我需要为其选择一个节点。这是我的即时窗口中的xml和selection语句:

node = xmlDoc.SelectSingleNode("//Customers/add[@id='1']");  

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <configSections>
        <section name="customers" type ="ImporterSupport.CustConfigSection, ImporterSupport"/>
    </configSections>
    <customers>
        <add id ="1" license="gh620g0g0g0g0g3p" ServerAddress ="localhost"  ServerPort="8292" SettingsFile ="AutoImportTest.txt" Confirm ="false" DisableRemoveRecips="true" DisableRecoverRecips="true" DisableAlphaId ="true" />
    </customers>
</configuration>

1 个答案:

答案 0 :(得分:3)

Xml区分大小写。使用

Context
相关问题