The Options tab allows you to set specific options for different
namespaces and elements.
The Generate Sample XML Files Dialog
- Namespace / Element table - Allows you to set a namespace for
each element name that appears in an XML document instance. The following
prefix-to-namespace associations are available:
- All elements from all namespaces (<ANY> - <ANY>). This is the default setting
and can be customized from the XML Instances Generator preferences page.
- All elements from a specific namespace.
- A specific element from a specific namespace.
- Settings
- Generate optional elements - When checked, all elements are
generated, including the optional ones (having the minOccurs
attribute set to 0 in the schema).
- Generate optional attributes - When checked, all attributes
are generated, including the optional ones (having the use attribute
set to optional in the schema.)
- Values of elements and attributes - Controls the content of
generated attribute and element values. Several choices are available:
- None - No content is inserted;
- Default - Inserts a default value depending of data type
descriptor of the particular element or attribute. The default value can be either
the data type name or an incremental name of the attribute or element (according
to the global option from the XML Instances Generator
preferences page). Note that type restrictions are ignored when this option is
enabled. For example, if an element is of a type that restricts an
xs:string with the xs:maxLength
facet in order to allow strings with a maximum length of 3, the XML instance
generator tool may generate string element values longer than 3 characters.
- Random - Inserts a random value depending of data type
descriptor of the particular element or attribute.
Important:
If all of the following are true, the
XML Instances
Generator outputs invalid values:
- at least one of the restrictions is a regexp;
- the value generated after applying the regexp does not match the
restrictions imposed by one of the facets.
This limitation leads to attributes or elements with values set to
Invalid.
- Preferred number of repetitions - Allows the user to set the
preferred number of repeating elements related with minOccurs and
maxOccurs facets defined in XML Schema.
- If the value set here is between minOccurs and
maxOccurs, then that value is used;
- If the value set here is less than minOccurs, then the
minOccurs value is used;
- If the value set here is greater than maxOccurs, then that
value is used.
- Maximum recursion level - If a recursion is found, this
option controls the maximum allowed depth of the same element.
- Choice strategy - Option used in case of
xs:choice or substitutionGroup elements. The
possible strategies are:
- First - the first branch of xs:choice or
the head element of substitutionGroup is always used;
- Random - a random branch of xs:choice or
a substitute element or the head element of a substitutionGroup
is used.
- Generate the other options as comments - Option to generate
the other possible choices or substitutions (for xs:choice and
substitutionGroup). These alternatives are generated inside
comments groups so you can uncomment and use them later. Use this option with care
(for example on a restricted namespace and element) as it may generate large result
files.
- Load settings / Export settings - The current settings can be
saved for further usage with the Export settings button, and
reloaded when necessary with the Load settings button.
- Element values - The Element values tab
allows you to add values that are used to generate the elements content. If there are more
than one value, then the values are used in a random order.
- Attribute values - The Attribute values
tab allows you to add values that are used to generate the attributes content. If there
are more than one value, then the values are used in a random order.