XML Editor With Duplicate Elements & Attributes - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

sjeslis
Posts: 308
Joined: Mon Aug 22, 2011 11:40 pm
Contact: Website

XML Editor With Duplicate Elements & Attributes

The section of my config that is being installed looks like:

<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:9004/XMDataSubscriptionService/" />
<add baseAddress="http://localhost:9006/XMDataSubscriptionService/" />
</baseAddresses>
</host>

I need to perform these resulting value updates:

<baseAddresses>
<add baseAddress="net.tcp://[ES_MASTER_IP]:9004/XMDataSubscriptionService/" />
<add baseAddress="http://[ES_MASTER_IP]:9006/XMDataSubscriptionService/" />
</baseAddresses>

I have not been able to find the correct set of options in order to accomplish this as making the above "Is identifier attribute" won't work given the new values have properties in them.

I'll try to figure something out, in the meantime I'd thought I'd ask....

Scott J.
Scott Jeslis
Senior Software Engineer
Cicero, Inc.
sjeslis
Posts: 308
Joined: Mon Aug 22, 2011 11:40 pm
Contact: Website

Re: XML Editor With Duplicate Elements & Attributes

As a workaround I thought I could add the "new" ones and "remove" the old nodes.

So I can add:

<add baseAddress="net.tcp://[ES_MASTER_IP]:9004/XMDataSubscriptionService/" />
<add baseAddress="http://[ES_MASTER_IP]:9006/XMDataSubscriptionService/" />

as siblings, simply enough but I can't seem to "remove":

<add baseAddress="net.tcp://localhost:9004/XMDataSubscriptionService/" />
<add baseAddress="http://localhost:9006/XMDataSubscriptionService/" />
Scott Jeslis
Senior Software Engineer
Cicero, Inc.
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: XML Editor With Duplicate Elements & Attributes

Hi Scott,

This is quite complicated, the problem is that you have only one attributed in the element, which is the one you want to update, so you can't use the
option "Is identifier attribute".

Also, you cannot perform your workaround to remove the original ones and add the new attributes because our XML editor is not designed to support defining multiple attributes with the same name, in order to define the attribute first with a remove operation and then with an install operation.

The solution is however very simple, instead of using our XML editor support, you need to look at the XML as to a normal text file. For this e we have our "Text File Update" support, so you can configure it to search for each line from the XML file and replace it with the new one, that uses the properties.

Best regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sjeslis
Posts: 308
Joined: Mon Aug 22, 2011 11:40 pm
Contact: Website

Re: XML Editor With Duplicate Elements & Attributes

Thanks Bogdan, I will give it a go!

Scott
Scott Jeslis
Senior Software Engineer
Cicero, Inc.
sjeslis
Posts: 308
Joined: Mon Aug 22, 2011 11:40 pm
Contact: Website

Re: XML Editor With Duplicate Elements & Attributes

Bogdan,

Worked great, thanks!

Scott
Scott Jeslis
Senior Software Engineer
Cicero, Inc.
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: XML Editor With Duplicate Elements & Attributes

Perfect, have a pleasant weekend Scott.

Best regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”