I have the following XML in my web configuration, and I would like to select an attribute to delete using the web.config transforms, but I would like to select an element to delete based on the value of one of the child elements.
My web.config looks something like this:
<configuration>
<sitecore>
<scheduling>
<agent type="Sitecore.Tasks.DatabaseAgent">
<param desc="database">core</param>
</agent>
<agent type="Sitecore.Tasks.DatabaseAgent">
<param desc="database">master</param>
</agent>
</scheduling>
</sitecore>
</configuration>
I tried the following to try and select the second agent item to delete based on the child <param desc="database">master</param>, but without success.
<configuration>
<sitecore>
<scheduling>
<agent type="Sitecore.Tasks.DatabaseAgent"
xdt:Transform="Remove"
xdt:Locator="XPath(configuration/sitecore/scheduling/agent/param[text()='master'])"/>
<agent type="Sitecore.Tasks.DatabaseAgent"
xdt:Transform="Remove">
<param desc="database"
xdt:Locator="XPath([text()='master'])"/>
</agent>
</scheduling>
</sitecore>
</configuration>
source
share