In order to avoid committing sensitive information to an SCM repository, I wrote an XSL stylesheet that removes connection string passwords from ASP.NET Web.config
files. It achieves my goal of removing passwords, but it also affects the whitespace within the opening tags of elements. I would like to preserve this whitespace if possible.
For example, given this Web.config
:
<configuration>
<connectionStrings>
<add name="ApplicationServices"
connectionString="Host=localhost;Username=dev;Password='sensitive password';Database=database"
providerName="MySql.Data.MySqlClient" />
</connectionStrings>
<!-- ... -->
I am able to transform it to:
<configuration>
<connectionStrings>
<add name="ApplicationServices" connectionString="Host=localhost;Username=dev;Password=********;Database=database" providerName="MySql.Data.MySqlClient" />
</connectionStrings>
<!-- ... -->
But I would like to transform it to:
<configuration>
<connectionStrings>
<add name="ApplicationServices"
connectionString="Host=localhost;Username=dev;Password=********;Database=database"
providerName="MySql.Data.MySqlClient" />
</connectionStrings>
<!-- ... -->
Is this possible?