Conditional xml updates - 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!

GlennWilson
Posts: 33
Joined: Wed Sep 01, 2010 2:22 pm

Conditional xml updates

Hi,

Does anyone know whether it's possible to use the XML edit feature (or some other feature) to update an element in an XML document only if a particular property has a specific value? For example, can I insert <myElement myAttribute="value" /> only when MY_PROPERTY="true"? Conversely, if MY_PROPERTY<>"true", how can I exclude the XML element from the file. (I am using AI version 7.7).

Regards,

Glenn
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Conditional xml updates

Hi Glenn,

You cannot condition each element entry of your XML file within the XML editor. What you can do instead, is to condition the XML file itself's component from the "XML File Install Tab". Simply associate the XML file with a component and then from the Organization page, add a "Condition" for that component. The condition can of course include a reference to a public property( e.g MY_PROPERTY ).

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”