【发布时间】:2023-03-20 22:35:01
【问题描述】:
我想转换一些属性,但我无法添加名称或键属性来使用 xdt:Locator="Match(name)" 或 xdt:Locator="Match(key)"。
例如,我可以:
<parentElement>
<children>
<add key="ExampleKey">
<thing attribute="blablabla"></thing>
</add>
</children>
</parentElement>
如何将事物属性“blablabla”替换为另一个值?
更新 1:除此之外,我不能在“事物”标记中插入其他属性,因为它会通过使用该属性的 dll 引发一些错误。
更新 2:看来我必须使用 SlowCheetah,然后它运行良好。感谢预览,我发现我可以将 xdt:Transform="Replace" 添加到父元素,就像这样:
<parentElement xdt:Transform="Replace">
<children>
<add key="ExampleKey">
<thing attribute="blablabla"></thing>
</add>
</children>
</parentElement>
现在它可以完美运行了! :)
【问题讨论】:
标签: asp.net .net web-config app-config slowcheetah