cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
deblin
Level 4

XML Attribute Order

I have an open support incident with Accress Support on the following issue but, based on recent results I doubt that I'll get a satisfactory answer.

My MSI creates an XML in part based on user provided values. For this product, the order of the Macro Names is not important, but the order of each Macro's attributes must be consistent.

Each of the macros are defined as:
macro[@name="(value)" and @type="(value)" and @value="(value)"]

When the macro is created, I get the following results:

















Notice that the orders of attributes "Name", "Type", and "Value" change from macro to macro. Why can't InstallShield create these records in the order given?
Labels (1)
0 Kudos
(3) Replies
Cary_R
Level 11

Hi There,

It's my understanding that the XML ordering problem is rather subtle. The idea here is that regardless of ordering, it's still valid XML, which is perhaps why no control over ordering was put into the table schema behind the scenes.

So, that leaves the question of ordering up to the order in which records are return to the MSI Engine when it queries the tables in question. MSI generally returns records based on the order in which they went into the tables, and so you can fiddle with this a bit by cutting and pasting until you see the order you'd like in the Direct Editor.

The other way to do this is to store the *.ism project file in XML itself, since this will again allow you to specify a specific order, which gets respected down the line converting from XML *.ism -> Binary *.ism -> *.msi file.

Not the most convenient, certainly. However, it's at least one option for making the finished *.xml files more readable.
0 Kudos
deblin
Level 4

Thanks Cary, I'll give your idea a try and report back. I appreciate the fast feedback.
0 Kudos
deblin
Level 4

Cary,
Thanks so much, your suggestion paid off! I changed the project file format from Binary to XML, rebuilt the project and, with no other changes, the XML file is now being created as the developer needs it.

Thanks again, you're a life saver!
0 Kudos