我需要一个正则表达式,它会给我"资源"来自父节点的属性值,其中" Name" node =" BES支持"
<BESAPI xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="BESAPI.xsd">
<ExternalSite Resource="https://server.domain.com:52311/api/site/external/BES%20Support">
<Name>BES Support</Name>
<GatherURL>http://sync.bigfix.com/cgi-bin/bfgather/bessupport</GatherURL>
</ExternalSite>
<CustomSite Resource="https://server.domain.com:52311/api/site/custom/DSE_Relays">
<Name>DSE_Relays</Name>
<GatherURL>http://server.domain.com:52311/cgi-bin/bfgather.exe/CustomSite_DSE_Relays</GatherURL>
</CustomSite>
<OperatorSite Resource="https://server.domain.com:52311/api/site/operator/idhere">
<Name>idhere</Name>
<GatherURL>http://server.domain.com:52311/cgi-bin/bfgather.exe/actionsite</GatherURL>
</OperatorSite>
</BESAPI>
答案 0 :(得分:0)
//name[text()="BES Support"]/parent::*/@resource