© 2009 syncRO soft ltd. | To generate sample XML files from an XML Schema use the Generate Sample XML Files... dialog. It is opened with the action → . The action is available also on the contextual menu from the schema page. Complete the dialog as follows:
The Options tab becomes active only after the URL field is filled-in and a schema is detected. It allows the user to set specific options for different namespaces and elements.
The XML instance generator tool can be used also from command line by
running the script called xmlGenerator.sh -cfgFile myConfigurationFile.xml The script can be integrated in an external batch process launched from the command line. The command line parameter of the script is the relative path to the exported XML settings file. The files which are specified with relative paths in the exported XML settings will be made absolute relative to the directory from where the script is run. Example 4.14. Example of an XML configuration file saved with Export settings button <settings>
<schemaSystemId>http://www.w3.org/2001/XMLSchema.xsd</schemaSystemId>
<documentRoot>schema</documentRoot>
<outputFolder>D:\projects\output</outputFolder>
<filenamePrefix>instance</filenamePrefix>
<filenameExtension>xml</filenameExtension>
<noOfInstances>1</noOfInstances>
<openFirstInstance>true</openFirstInstance>
<defaultNamespace><NO_NAMESPACE></defaultNamespace>
<element namespace="<ANY>" name="<ANY>">
<generateOptionalElements>false</generateOptionalElements>
<generateOptionalAttributes>false</generateOptionalAttributes>
<valuesForContentType>DEFAULT</valuesForContentType>
<preferredNumberOfRepetitions>2</preferredNumberOfRepetitions>
<maximumRecursivityLevel>1</maximumRecursivityLevel>
<choicesAndSubstitutions strategy="RANDOM"
generateOthersAsComments="false"/>
<attribute namespace="<ANY>"
name="<ANY>">
<attributeValue>attrValue1</attributeValue>
<attributeValue>attrValue2</attributeValue>
</attribute>
</element>
<element namespace="<NO_NAMESPACE>"
name="<ANY>">
<generateOptionalElements>true</generateOptionalElements>
<generateOptionalAttributes>true</generateOptionalAttributes>
<valuesForContentType>DEFAULT</valuesForContentType>
<preferredNumberOfRepetitions>2</preferredNumberOfRepetitions>
<maximumRecursivityLevel>1</maximumRecursivityLevel>
<choicesAndSubstitutions strategy="RANDOM"
generateOthersAsComments="true"/>
<elementValue>value1</elementValue>
<elementValue>value2</elementValue>
<attribute namespace="<ANY>"
name="<ANY>">
<attributeValue>attrValue1</attributeValue>
<attributeValue>attrValue2</attributeValue>
</attribute>
</element>
</settings> © 2009 syncRO soft ltd. |