Page 1 of 1

How to generate XML sample data from XSD Schema file?

Posted: Wed Sep 02, 2009 4:24 pm
by pstein
Assume I have a XSD Schema file. How can I generate an XML sample instance doc with sample values from this XSD (with Oxygen) ?

If this is not possible with Oxygen: Which other tool can help me
at this task?

What, if the XSD Schema file contains <xsd:choice> in deeper levels and I want to generate some sample XML for lets say the fifth variant?
Can I select between different branches of such a <xsd:choice>?

Peter

Re: How to generate XML sample data from XSD Schema file?

Posted: Wed Sep 02, 2009 5:25 pm
by sorin_ristache
Hello,
pstein wrote:Assume I have a XSD Schema file. How can I generate an XML sample instance doc with sample values from this XSD (with Oxygen) ?
You specify the sample values in an xs:enumeration or on the Element values tab or the Attribute values tab of the Generate Sample XML Files dialog.
pstein wrote:What, if the XSD Schema file contains <xsd:choice> in deeper levels and I want to generate some sample XML for lets say the fifth variant?
Can I select between different branches of such a <xsd:choice>?
You can select only between first choice and random choice with the option Choice strategy in the Generate Sample XML Files dialog. If you want the fifth variant you select the option Generate the other options as comments and edit manually the generated instance if the choice selected randomly was not the fifth: comment out the generated choice and uncomment the fifth one.


Regards,
Sorin