Generate sample XML document from XSD without 1 root element

Questions about XML that are not covered by the other forums should go here.
alexvb74
Posts: 1
Joined: Wed Aug 19, 2009 9:04 pm

Generate sample XML document from XSD without 1 root element

Post by alexvb74 »

Hello,
I'm having a bit of difficulties generating a sample XML document from XSD schema that do not have a single root element. The utility is forcing me to select a root element and doing so it drops off all elements that are not under the root item chosen. Is there a way to generate sample xml doc without having to select root element, or perhaps a work around?

Please advice

Thanks,
Alex
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Generate sample XML document from XSD without 1 root element

Post by sorin_ristache »

Hello,
alexvb74 wrote:The utility is forcing me to select a root element and doing so it drops off all elements that are not under the root item chosen.
Do you mean that the elements that are declared in the XML Schema but are not included in the content model of the root element are not present in the generated XML instance? That is an effect of setting a root element for your generated XML instances and cannot be avoided. For an XML Schema with multiple declarations of global elements any global element can be a root of an XML instance. Depending on the content model of the selected root element other elements declared in the same XML Schema may not be included in this content model.


Regards,
Sorin
Post Reply