lur*_*her 12 xpath xdt-transform
我在web.config中有以下节点:
<configuration>
...
<scheduling>
<agent>
<param desc="database">core</param>
</agent>
<agent>
<param desc="database">master</param>
</agent>
</scheduling>
...
</configuration>
Run Code Online (Sandbox Code Playgroud)
我想删除<agent>具有主内容的子param节点的整个节点.或多或少我的xdt转换节点看起来像:
<configuration>
...
<scheduling>
<agent
xdt:Transform="Remove"
xdt:Locator="XPath(./param[@desc='database']/??????)" />
</scheduling>
...
</configuration>
Run Code Online (Sandbox Code Playgroud)
如你所见,我不知道如何匹配节点内容字符串.我需要在这里添加什么?
环境笔记:windows 7 - visual studio 2010 SP1
bou*_*leu 12
text()在定位器中添加额外的测试.要匹配<param>节点:
xdt:Locator="XPath(./param[@desc='database' and text()='master'])">
Run Code Online (Sandbox Code Playgroud)
编辑:要匹配<agent>您需要移动param到XPath匹配的谓词的节点:
xdt:Locator="Condition(param/@desc='database' and param/text()='master')">
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5925 次 |
| 最近记录: |