When upgrading my InstallBuilder version I receive an "Attribute value can only contain alphanumeric or '_' characters" error

asked 13 Sep '11, 07:08

Jake's gravatar image

Jake ♦♦
796222226235
accept rate: 98%


Starting with InstallBuilder 4.3.0 we implemented a restriction on the possible values for <value> tags inside <option> elements. This affects optionLists inside <choiceParameter> elements and <addChoiceOptions> actions.

The change was prompted as part of an effort to validate the project XML to catch mistakes at build time rather than at installation time. In the case of choice options, the idea was to prevent empty values, values with spaces or values with invalid characters, such as "(" that could interfere with some InstallBuilder constructs when referencing variables.

If you use variables that may contain non alphanumeric characters as the value for a option in a choiceParameter, your project files may be affected by this change. Below you can find an example of a code that would give the "Attribute value can only contain alphanumeric or '_' characters" error.

<addChoiceOptions>
    <name>selection</name>
    <optionList>
        <option text="${non_alphanumeric_value_1}" value="${non_alphanumeric_value_1}" />
    </optionList>
</addChoiceOptions>

In this case the simplest solution will be to substitute the variable used in the value attribute by a fixed valid value. In most cases this change would not affect the implementation logic of your installer.

<addChoiceOptions>
    <name>selection</name>
    <optionList>
        <option text="${non_alphanumeric_value_1}" value="choice1" />
    </optionList>
</addChoiceOptions>

Then, if you want to recover the text of the selected entry (not the actual selected value) you could use:

${selection.text}
link

answered 13 Sep '11, 07:11

Jake's gravatar image

Jake ♦♦
796222226235
accept rate: 98%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×43
×22
×1
×1

Asked: 13 Sep '11, 07:08

Seen: 1,402 times

Last updated: 13 Sep '11, 07:11