This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: XML file Changes
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 02, 2008
03:51 PM
XML file Changes
I have a problem with writing some changes to an XML-file.
Im using basic MSI project and have made a dialog where the user can configure 1-5 different database connections. These connections should be written to an sql.config file.
I've tried to import and modify in XML File Change in IS2008. But when the installation is complete the sql.config files does look very strange. So I started on an new sql.config file from scratch and tried to add the data through XML File Changes, but can't get it right.
Please help point out what I'm doing wrong.
Screendump Installshield
When I use the "Text XML File Install Changes..." in the IDE i get this:
[CODE]
[/CODE]
After the installation has complete i have this in my config file:
Not quite the result I expected..
Im using basic MSI project and have made a dialog where the user can configure 1-5 different database connections. These connections should be written to an sql.config file.
I've tried to import and modify in XML File Change in IS2008. But when the installation is complete the sql.config files does look very strange. So I started on an new sql.config file from scratch and tried to add the data through XML File Changes, but can't get it right.
Please help point out what I'm doing wrong.
Screendump Installshield
When I use the "Text XML File Install Changes..." in the IDE i get this:
[CODE]
After the installation has complete i have this in my config file:
Not quite the result I expected..
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 02, 2008
09:01 PM
I don't have the exact syntax in front of me, but basically you need to use parent | child | sibling type directives in your XPATH to define the relationship between the nested elemnts. Also use the Test XML Changes feature to help flush out the bugs without having to build and run your install.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 03, 2008
01:06 AM
My XPath Query looks like this
//database[@name="[PATRA_CN1_TITLE]"]
//database[@name="[PATRA_CN3_TITLE]"]
//database[@name="[PATRA_CN2_TITLE]"]
//database[@name="[PATRA_CN1_TITLE]"]/connection_string[@value="[PATRA_CN1_CONNECTIONSTRING]"]
//database[@name="[PATRA_CN2_TITLE]"]/connection_string[@value="[PATRA_CN2_CONNECTIONSTRING]"]
//database[@name="[PATRA_CN3_TITLE]"]/connection_string[@value="[PATRA_CN3_CONNECTIONSTRING]"]
//database[@name="[PATRA_CN1_TITLE]"]/provider[@assambly="" and @brand="31"
//database[@name="[PATRA_CN1_TITLE]"]
//database[@name="[PATRA_CN3_TITLE]"]
//database[@name="[PATRA_CN2_TITLE]"]
//database[@name="[PATRA_CN1_TITLE]"]/connection_string[@value="[PATRA_CN1_CONNECTIONSTRING]"]
//database[@name="[PATRA_CN2_TITLE]"]/connection_string[@value="[PATRA_CN2_CONNECTIONSTRING]"]
//database[@name="[PATRA_CN3_TITLE]"]/connection_string[@value="[PATRA_CN3_CONNECTIONSTRING]"]
//database[@name="[PATRA_CN1_TITLE]"]/provider[@assambly="" and @brand="31"
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 03, 2008
02:40 AM
After some more tests Ive discoverd that it must be the XPath Query order that must be changed.
New order needs to be
[CODE]
//database[@name="[PATRA_CN1_TITLE]"]/connection_string[@value="[PATRA_CN1_CONNECTIONSTRING]"]
//database[@name="[PATRA_CN1_TITLE]"]/provider[@assambly="" and @brand="31"
//database[@name="[PATRA_CN1_TITLE]"]
//database[@name="[PATRA_CN2_TITLE]"]/connection_string[@value="[PATRA_CN2_CONNECTIONSTRING]"]
//database[@name="[PATRA_CN2_TITLE]"]
//database[@name="[PATRA_CN3_TITLE]"]/connection_string[@value="[PATRA_CN3_CONNECTIONSTRING]"]
//database[@name="[PATRA_CN3_TITLE]"]
[/CODE]
Because PATRA_CN1_TITLE change at installation the node connection_string doesn't get any match to the database node.
How do i change the order of the XPath manually?
New order needs to be
[CODE]
//database[@name="[PATRA_CN1_TITLE]"]/connection_string[@value="[PATRA_CN1_CONNECTIONSTRING]"]
//database[@name="[PATRA_CN1_TITLE]"]/provider[@assambly="" and @brand="31"
//database[@name="[PATRA_CN1_TITLE]"]
//database[@name="[PATRA_CN2_TITLE]"]/connection_string[@value="[PATRA_CN2_CONNECTIONSTRING]"]
//database[@name="[PATRA_CN2_TITLE]"]
//database[@name="[PATRA_CN3_TITLE]"]/connection_string[@value="[PATRA_CN3_CONNECTIONSTRING]"]
//database[@name="[PATRA_CN3_TITLE]"]
[/CODE]
Because PATRA_CN1_TITLE change at installation the node connection_string doesn't get any match to the database node.
How do i change the order of the XPath manually?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 03, 2008
04:38 AM
Solved it by first import XML File and only change the connection_string nodes. Than import the file again in the XML File Change tool and this time I only change the databas name elements.
No beautiful solution but it worked...
No beautiful solution but it worked...