Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 将XmlNode条目与字符串文本值匹配_C#_Xml_String_File - Fatal编程技术网

C# 将XmlNode条目与字符串文本值匹配

C# 将XmlNode条目与字符串文本值匹配,c#,xml,string,file,C#,Xml,String,File,如何在xmldata文件节点中搜索字符串值中的确切文本 例如:string fullname=“John Smith” 在XmlData.xml中搜索节点“FullName”,其中text=“John Smith”的值。尝试类似以下内容的xpath表达式: //FullName[.='John Smith'] 这意味着查找名为FullName且值为“John Smith”的任何元素 有关如何加载文档和使用xpath查询的示例,请参阅。要在示例文档上测试一些xpath查询,请尝试

如何在xmldata文件节点中搜索字符串值中的确切文本

例如:
string fullname=“John Smith”

在XmlData.xml中搜索节点“FullName”,其中text=“John Smith”的值。

尝试类似以下内容的xpath表达式:

//FullName[.='John Smith']
这意味着查找名为
FullName
且值为“John Smith”的任何元素

有关如何加载文档和使用xpath查询的示例,请参阅。要在示例文档上测试一些xpath查询,请尝试