XML replacements not working - 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!

FergusMurray
Posts: 150
Joined: Thu Sep 30, 2010 10:44 am

XML replacements not working

Im using the XML replacements to modify various pieces of my web.config
Have included the original web.config as well as the xml file working in "if element is found update"

When I run, its going wrong and truncating all the substitutions onto the 1 line, its changing

<DocumentEnquiry.Properties.Settings>
<setting name="DocumentEnquiry_Aperta_Diagnostics_Aperta_Diagnostics" serializeAs="String">
<value>http://localhost/DocumentArchive/Aperta ... smx</value>
</setting>
<setting name="DocumentEnquiry_DocArch_Guard_DocArch_Guard" serializeAs="String">
<value>http://localhost/DocumentArchive/DocArc ... smx</value>
</setting>
<setting name="DocumentEnquiry_DocArchive_Tweaking_DocArchive_Tweaking" serializeAs="String">
<value>http://localhost/DocumentArchive/DocArc ... smx</value>
</setting>
<setting name="DocumentEnquiry_DocumentStore_DocumentStore" serializeAs="String">
<value>http://localhost/DocumentArchive/Docume ... smx</value>
</setting>
<setting name="DocumentEnquiry_DocEnquiryAPI_DocEnquiryAPI" serializeAs="String">
<value>http://localhost/DocumentArchive/Docume ... smx</value>
</setting>
<setting name="DocumentEnquiry_SecureDB_SecureDB" serializeAs="String">
<value>http://localhost/SecureDB.asmx</value>
</setting>
<setting name="DocumentEnquiry_ApertaLicenseInformation_ApertaLicenseInformation" serializeAs="String">
<value>http://localhost/ApertaLicensingService ... smx</value>
</setting>
</DocumentEnquiry.Properties.Settings>

to
<applicationSettings>
<DocumentEnquiry.Properties.Settings>
<setting name="DocumentEnquiry_ApertaLicenseInformation_ApertaLicenseInformation" serializeAs="String">
<value>http://127.0.0.1/DocumentArchive/Aperta ... smx</value>
</setting>
<setting name="DocumentEnquiry_DocArch_Guard_DocArch_Guard" serializeAs="String">
<value>http://localhost/DocumentArchive/DocArc ... smx</value>
</setting>
<setting name="DocumentEnquiry_DocArchive_Tweaking_DocArchive_Tweaking" serializeAs="String">
<value>http://localhost/DocumentArchive/DocArc ... smx</value>
</setting>
<setting name="DocumentEnquiry_DocumentStore_DocumentStore" serializeAs="String">
<value>http://localhost/DocumentArchive/Docume ... smx</value>
</setting>
<setting name="DocumentEnquiry_DocEnquiryAPI_DocEnquiryAPI" serializeAs="String">
<value>http://localhost/DocumentArchive/Docume ... smx</value>
</setting>
<setting name="DocumentEnquiry_SecureDB_SecureDB" serializeAs="String">
<value>http://localhost/SecureDB.asmx</value>
</setting>
<setting name="DocumentEnquiry_ApertaLicenseInformation_ApertaLicenseInformation" serializeAs="String">
<value>http://localhost/ApertaLicensingService ... smx</value>
</setting>
</DocumentEnquiry.Properties.Settings>


Any ideas?
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: XML replacements not working

Hello,

When a XML element is in update mode, the text content is also updated. However, when the XML element being updated has mixed content with several text regions, the new text specified here will be appended to the element content.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
FergusMurray
Posts: 150
Joined: Thu Sep 30, 2010 10:44 am

Re: XML replacements not working

My problem was that I had elements with the same name
eg.
<appsetting>
--<add>
--<add>
--<add>
</appsetting>

Putting "is Identifier attribute" on the "name" attribute on each of the non-unique sub elements sorted my issue.

Return to “Common Problems”