XML节点名称中有小数点处理(deal with dot)导致使用xpath时报错解决方法

1 <?xml version="1.0"?>
2 <ModifyFiles>
3   <_Layout.cshtml>123456</_Layout.cshtml>
4 <Contact.cshtml>@section MasterPart{"/Home/About"}</Contact.cshtml>
5 </ModifyFiles>

XML节点中有小数点怎么办?怎么引用它的xpath呢?在百度没找到答案,于是google:how to deal with xml node name include dot?Get it!

其实很简单,只要把那个子节点中括号起来就好啦,就不会把它当作***.**那种子节点啦~终于解决了~

$code=($sectionPartsxml.ModifyFiles['Index.cshtml']).InnerText

原文地址:https://www.cnblogs.com/jin-wen-xin/p/3992241.html