Inserting inner text into an XML element
In some cases, an XML file might use the inner text of an element to configure a setting. For example, if you view the properties of an ASP.NET project, there's a Settings tab where you can add rows of named application settings:
These settings will be stored in Web.config
under the applicationSettings
node:
<configuration> <!--Other elements omitted for brevity--> <applicationSettings> <MyWebApp.Properties.Settings> <setting name="MySetting" serializeAs="String"> <value>ValueA</value> </setting> </MyWebApp.Properties.Settings> </applicationSettings> </configuration>
As you can see, the value of the setting is stored as inner text in an element called value
. In this recipe, we'll update this inner text so that instead of saying ValueA
, it will say ValueB
.
Getting ready
To prepare for this recipe, perform the following steps:
Create a new setup project and...