Set XML subtree - Advanced Installer Community
Wolfgang.Seidl
Posts: 1
Joined: Thu Jul 04, 2013 9:26 am

Set XML subtree

Hi,
I want to add something to the tag <connectionStrings> in a web.config.
I would like to add a complete xml subtree like

<add connectionString="Data Source=[SQLSERVER_PROP];Initial Catalog=DpeCoreDb[DPECOREDB_PROP];Integrated Security=True;Min Pool Size=100;Max Pool Size=1000" name="DpeCoreDb" />

But the "<" is replaced by <

The reason I want to set a complete subtree is that I support "windows authentication" and "sql server authentication" in my setup dialogs.
Therefore I cannot use the normal technique of specifying each node and attribute of the <add> tag.

Another way to solve that would be conditional XML editing, but AFAIK this is not available in AI, is it?

Regards,
Wolfgang
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Set XML subtree

Hi Wolfgang and welcome to Advanced Installer forums.

I'm afraid I don't fully understand what is your scenario. Can you give us more details (maybe exemplify)?

In order to edit an XML file based on a condition use the [New XML File] toolbar button and create more XML files with the same name using the method described in our How do I install two files with the same name in the same folder article.

Although, an XML file cannot have its own component, but you can create a "dummy" registry entry for each file and create components that will contain a registry entry and an XML file then set the appropriate conditions for them.

Let us know if this helped, otherwise give us more details about your scenario.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”