Alex
Alex

Reputation: 40445

Convert XSD without single root Node to XML

I'm looking for an easy way to generate a sample XML file from an XSD that do not contain a single root node.

Upvotes: 1

Views: 711

Answers (2)

user1228
user1228

Reputation:

If your file doesn't have an xml declaration at the top, a single root node, and follow all other XML rules, it's not XML, its a text file. You can't treat any old text files like XML.

Upvotes: 1

Pavel Minaev
Pavel Minaev

Reputation: 101665

I don't think you can do that without specifying the root. XML Schema is designed such that all top-level xs:element can represent the root node, so you cannot distinguish it given the schema alone. You'll have to ask user to explicitly specify the xs:element he wants to treat as root.

Upvotes: 1

Related Questions