VS2010経由で利用可能なweb.configトランスフォームを使用しています。この1つのケースでは、変換中に要素を別の要素で「囲む」ことが可能かどうか疑問に思っています。次に例を示します。
デフォルトのweb.configには次のものが含まれます。
<configuration>
<system.web>
....
</system.web>
</configuration>
変換されたファイルには
<configuration>
<location inheritInChildApplications="false">
<system.web>
...
</system.web>
</location>
</configuration>
したがって、基本的には、system.web要素をlocation要素で「ラップ」したいと思います。私の唯一の考えは、次のように前後に挿入するように変換を行うことでした。
<location inheritInChildApplications="false"
xdt:Transform="InsertBefore(/configuration/system.web)">
</location xdt:Transform="InsertAfter(/configuration/system.web)">
しかし、VSによると、終了位置要素は有効なxmlではありません(Transform属性のために推測しています)。結果のsystem.webはまだ「囲まれていない」ため、system.webの前に自己閉鎖位置要素を挿入するだけでも役に立ちません。