For stress tests, I would like to create XML files based on a XSD with random (but valid!) test data. Is there a tool which can read a (simple) XSD file and build a XML file based on the schema definition?
Just follow the below steps to get XML from XSD. Select XSD File in project, right click for Menu and select Generate > XML File… Provide the XML file Name and XML File location in the popup window. Click on next button.
XSD is based and written on XML. XSD defines elements and structures that can appear in the document, while XML does not. XSD ensures that the data is properly interpreted, while XML does not. An XSD document is validated as XML, but the opposite may not always be true.
This is a simple python script to help you generate some xmls if you have a xsd. It uses the xmlschema library to parse the given schema document and then populate some hardcoded values.
With the desired XML document opened in the active editor tab, choose Tools | XML Actions | Generate XSD Schema from XML File on the main menu. The Generate Schema From Instance Document dialog box opens. and select the desired file in the dialog that opens.
Many tools exist to do this, check theses links
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With