Some enumerated properties have a set of allowed values in Formsfor example
the integer property ItemType
on the Item
object has
allowed values of 0, 1, 2, ...15. Each of these values has a constant name associated
with it. If you convert a Forms module with the Forms2XML
tool,
the XML output will display these properties with their constant name as the
value for the attribute instead of the integer.
Here are some examples of XML using an enumerated property:
<Item Name="MYBUTTON" ItemType="Push Button"
/>
<Graphics Name="MYRECT" GraphicsType="Rectangle"
/>
If you edit the XML file and wish to use XML2Forms to convert it back to a Forms file, you must ensure that any enumerated values are expressed as a constant name. Follow the instructions below to find the constant name associated with the enumerated property.
To find the constant name associated with the integer property:
SchemaGenerator
, to produce
a forms.xsd
file containing the Forms XML Schema. For example, to find the allowed values for the PromptAlign
property,
run the Schema Generator tool and look up PromptAlignTypes
in the
forms.xsd
XMLSchema file. You will find:
<simpleType name="PromptAlignTypes"> <restriction base="string"> <enumeration value="Start"> <enumeration value="End"> <enumeration value="Center"> </restriction> </simpleType>
In the Schema all properties are defined with their type, if you look up PromptAlign you also find:
<attribute name="PromptAlign" type="tns:PromptAlignType"/>
which tells you it is of type PromptAlignType
(shown above). If
you look up Height
, you find
<attribute name="Height" type="integer"/>
telling you that Height
is a simple integer property, and has
no restriction on its value other than that.
The constant names associated with enumerated properties are translated. For
example, the Japanese version of the Schema Generator tool will produce an XMLSchema
where the constant name values of the enumerated properties will be expressed
in Japanese. Taking the XML output above as an example, Start
,
End
, and Center
values will be in Japanese. In contrast,
the property names and object names are always in English.
If you provide constant name values for an enumerated type in an XML file, enter the name in your own language for the form to validate correctly. Note that this means that a Japanese XML form, for example, cannot be converted back to a Forms Module on a US machine because the enumerated properties will fail to validate.
Understanding the Generated XML