How to generate XML sample data from XSD Schema file?

Having trouble installing Oxygen? Got a bug to report? Post it all here.
pstein
Posts: 17
Joined: Wed May 21, 2008 9:13 pm

How to generate XML sample data from XSD Schema file?

Post 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
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

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

Post 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
Post Reply