visualsi
Posts: 40
Joined: Fri Oct 14, 2011 4:16 pm

Copy/Paste in XML Editor

Hi,

I need to add an XML Element to an existing XML file that is almost the same as one in there - a complex element with about 30 attributes, many AI variable substitutions, and other XML elements inside it. It loosk like there is no way to copy and paste one that is almost identical and change what is different? It will probably take a couple of hours at least to create it by hand and a couple of versions of testing to get out all the errors considering all the new typing that will be necessary and options that will need to be selected.

Thanks,
Rob
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: Copy/Paste in XML Editor

Hi Rob,

A simple way that you can try in order to achieve this, is to use the "Text File Update" operation. Just go to the "Append/Create" section and uncheck the "Create file with encoding" option, then go to the "Replace" section and write the old attribute in the "Find" field and the new one in the "Replace" field. Also, make sure the you set for this operation the same name as for the XML file that you want to modify.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
visualsi
Posts: 40
Joined: Fri Oct 14, 2011 4:16 pm

Re: Copy/Paste in XML Editor

Hi,

In the existing XML file, there are several substitutions (probably 150-200) - I assume that these would be lost if I did a replace?

Now, "append" sounds interesting - perhaps I could isolate the new sections of the raw XML that I need to add, append them to the existing good AI file, then "move" them to where I waht them, the do the edits to the newly imported XML?

Thanks,
Rob
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: Copy/Paste in XML Editor

Hi Rob,
In the existing XML file, there are several substitutions (probably 150-200) - I assume that these would be lost if I did a replace?
I'm not sure why do you say that those substitution would be lost. Maybe I did not understand correctly your scenario. Can you please give me more details (maybe exemplify)?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
visualsi
Posts: 40
Joined: Fri Oct 14, 2011 4:16 pm

Re: Copy/Paste in XML Editor

Hi,

We originally did an XML import of an app.config file - it was very large because we use the Enterprise Library and have several logging sources defined and other connections. We also use it to hold many tunable parameters of our own. On installation, the installer asks the user many questions in several dialog boxes about how he or she would like this application to run and we use the answers to replace values in the app.config file.

Now, we want to add a few more logging listeners and several more tunable parameters to the app.config. We would rather not start all over, re-importing (Import->XML Files) from a new template app.config file and re-do all the substitutions where we want run-time values replace values in the template (created by Visual Studio). I would also like something better than entering in all the new stuff by hand. Copy/Paste would be ideal - the new EL Trace listeners look very similar to the others, except for a few changes. Many of the tunables are similar...
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: Copy/Paste in XML Editor

Hi,

Sorry for the delayed reply.

I'm afraid that we do not have support for copying and pasting XML elements and the only way to achieve what you want is to manually create the new elements in the already existent "XML Edit" operation.

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

Return to “Building Installers”