XPath 未找到匹配项

XPath Not Finding Match

我有以下 XML 文档:

<report>
    <ProcessorInfo
        xmlns="http://SITE/monitor"
        xmlns:SOAP="http://SITE/envelope/">
        <count>8</count>
    </ProcessorInfo>
</report>

当我尝试查询以下 XPath 时://ProcessorInfo,它说找不到匹配项(我。如果我删除 xmlns,我的问题就解决了。什么是正确的无需删除 xmlns

即可使用的 XPath

试试这个:

//*[local-name()='ProcessorInfo']

这将从搜索条件中删除命名空间。