Edit online

XML Instance Generator

Attention: To run this script, you are required to purchase a special scripting commercial license.

You can generate multiple XML documents from an XML Schema from Oxygen XML Developer by using the Tools > Generate Sample XML Files main menu action. The settings dialog box has an Export settings option that can be used to export the settings to an XML configuration file. Once the settings are exported, you can use the scripts/xmlGenerator.sh script to generate multiple XML instance files from the command line.

Sample Command Line for the Generate Sample XML Files Script

sh scripts/xmlGenerator.sh path/to/config/file [-verbose]

Extended Version of the Script and its Arguments

sh scripts/xmlGenerator.sh [[path_to_config_file] [-s XML_schema_path -r root [-n ns] [-o output_dir] 
[-f instance_name] [-i num_of_instances]] [-verbose]]
The path to the file that contains the configuration to be used.
-s XML_schema_path
The path to the XML schema to be used for generating the XML file(s).
-n ns
The namespace used for the XML namespace declaration.
-r root

The root element for the generated file(s).

-o output_dir
The output directory to be used for storing the generated file(s).
-f instance_name
The pattern name to be used for the generated file(s). It is usually the name plus extension.
-i num_of_instances
The number of XML files to be generated.
This argument can be specified to activate verbose logging.
Note: Any value specified by the -s, -n, -r, -o, -f, or -i arguments overrides the corresponding value from the configuration file, if that file is specified in the path_to_config_file argument.