To configure the XML Instances Generator options, open the
Preferences dialog box and go to . It sets the default parameters of the Generate Sample XML
Files tool that is available on the Tools menu.
The options of the tool that generates XML instance documents based on a W3C XML Schema are
the following:
-
Generate optional elements - If checked, the elements declared optional in the schema will be generated in the XML
instance.
-
Generate optional attributes - If checked, the attributes declared optional in the schema will be generated in the XML
instance.
-
Values of elements and attributes - Specifies what values are generated in elements and attributes of the XML instance. It
can have one of the values:
- None - no values for the generated elements and
attributes
- Default - the value is the element name or attribute
name
- Random - a random value
-
Preferred number of repetitions - If the values set here is greater than maxOccurs, then the
maxOccurs is used.
-
Maximum recursivity level - For recursive type definitions this parameter specifies the number of levels of
recursive elements inserted in the parent element with the same name.
-
Type alternative strategy - Specifies how the element type alternatives are generated in the XML instance:
- First - the first element type alternative whose XPath
condition is true is used;
- Random - a random element type alternative whose XPath
condition is true is used;
Note: In case no XPath condition is true, the default
element type alternative is used.
-
Note: To evaluate an XPath expression, either the values of the attributes defined in
the Options tab of the XML Instance
Generator dialog, or the attributes values defined in the XML Schema
are used.
-
Choice strategy - For choice element models specifies what choice will be generated in
the XML instance:
- First - the first choice is selected from the
choice definition and an instance of that choice is generated in
the XML instance document.
- Random - a random choice is selected from the
choice definition and an instance of that will be generated.
-
Generate the other options as comments - If checked, the other options of the choice element model (the
options which are not selected) will be generated inside an XML comment in the XML
instance.
-
Use incremental attribute / element names as default - If checked, the value of an element or attribute starts with the name of that element or
attribute. For example, for an a element the generated values are:
a1, a2, a3, etc. If not checked, the
value is the name of the type of that element / attribute, for example:
string, decimal, etc.
-
Maximum length - The maximum length of string values generated for elements and attributes.
-
Discard optional elements after nested level - The optional elements
that exceed the specified nested level are discarded. This option is useful for limiting
deeply nested element definitions that can quickly result in very large XML documents.