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
- :
- XML File Changes - Adding identically named elements
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
![](/skins/images/3B39CE851FDD5528C393F146EB70A2D0/responsive_peak/images/icon_anonymous_message.png)
Not applicable
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
May 14, 2009
11:09 AM
XML File Changes - Adding identically named elements
I'm trying to use the XML File Changes feature in my InstallScript MSI Project to create a XML configuration file for my application during install. I'm running into a problem getting it to write out all of the elements, though.
The format of the file I'm trying to write is something like this:
A root, a comment element, and a list of 'entry' elements with unique key attributes.
The file I'm generating, however, comes out like this:
It only writes one of the 'entry' elements, even though I have several defined.
I also noticed that under the Advanced tab of the XML file, only two XPath Query statements are being generated for the file I'm defining: //comment and //entry.
Does XML File Changes ignore attribute values when defining elements, or is there a process for making it recognize them?
The format of the file I'm trying to write is something like this:
...
content
content
content
A root, a comment element, and a list of 'entry' elements with unique key attributes.
The file I'm generating, however, comes out like this:
...
content
It only writes one of the 'entry' elements, even though I have several defined.
I also noticed that under the Advanced tab of the XML file, only two XPath Query statements are being generated for the file I'm defining: //comment and //entry.
Does XML File Changes ignore attribute values when defining elements, or is there a process for making it recognize them?
(1) Reply
![](/skins/images/3B39CE851FDD5528C393F146EB70A2D0/responsive_peak/images/icon_anonymous_message.png)
Not applicable
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
May 14, 2009
11:25 AM
It figures, practically the moment I hit 'Post' I figured out the solution.
If I named the elements like this:
entry[@key="X"]
InstallShield would create the correct XPath for the element I was trying to work with.
From there, all I needed to do was select the entry element from the list, create a 'key' attribute for it and set the element content under the Advanced tab.
If I named the elements like this:
entry[@key="X"]
InstallShield would create the correct XPath for the element I was trying to work with.
From there, all I needed to do was select the entry element from the list, create a 'key' attribute for it and set the element content under the Advanced tab.
![](/skins/images/3B39CE851FDD5528C393F146EB70A2D0/responsive_peak/images/icon_anonymous_message.png)