Reputation: 21
I am trying to generate sample XML from an XSD. I am using Altova XMLSpy to generate schemas. When I go to "Generate Sample XML File" I receive an error saying
Could not find any element declaration for a root element.
The program has worked perfectly for all other XSD files I have tried. How can I get this file converted or another program I can use to generate this sample XML?
Upvotes: 1
Views: 2324
Reputation: 111726
Without seeing your XSD, we might guess that it lacks any global element definitions. It could, for example, be a collection of xsd:simpleType
and xsd:complexType
definitions. If this is the case, you should still be able to create some sample XML if you can provide a root element:
xsd:element
declaration of the desired type.xsd:element
into the XSD directly, or place it in
its own file and import or include the type definitions into the new
XSD.Providing the sample XSD (or preferably a minimum version of it that still exhibits the issue) would have allowed us to be more specific in answering your question.
Upvotes: 3