XML Sample Generator

The XML Sample generator is a tool which creates an XML document from an XML Schema (XSD). The user selects the element that will become the root node in the XML document, and the generator does the rest, creating all the child elements and attributes, populating them with valid placeholder values.

 

Options allow you to control the size of the generated document by forcing or restricting the creation of optional elements to a given depth in the XML document. This allows you to create minimal sample instances or comprehensive fully populated documents.

Prototyping

While designing XML Schemas it is often useful to be able to see what the resulting XML documents will look like. The XSD Schema diagrams make it clear what the structure is, but it is sometimes easier to see an example of an actual document in order to get a clear picture. The XML Sample generator does exactly this, it takes an XSD and generates random sample XML documents based on your XSD. This allows you to quickly see any unexpected artifacts in the XML document. 

Development

When tasked with reading an XML document into an application, it is useful to have a good set of valid test cases to work from. In the early stages of a development project such examples can be thin on the ground, so being able to generate them can save hours of manual typing. Furthermore when writing XML from an application, it is useful to have a clear idea of what the XML should look like, samples make it much easier to see where the applications output differ from the test cases.

For reading and writing XML from an application see XML Data Binding

Testing

Testing an application is all about having good test cases, and good test cases need good test data. Being able to generate sample XML documents can save huge amounts of time when creating your test data, as it provides the skeletal message, making easy for meaningful test values to be inserted into the document.   

Example



Source XML Schema (See Source Code)
<?xml version="1.0" encoding="utf-8"?>
<!-- Created with Liquid XML Studio -->
xsi:noNamespaceSchemaLocation="BookStore.xsd">
<book price="730.54" ISBN="string"
publicationdate="2016-02-27">
<title>string</title>
<author>
<first-name>string</first-name>
<last-name>string</last-name>
</author>
<genre>string</genre>
</book>
<book price="6738.774" ISBN="string">
<title>string</title>
<author>
<first-name>string</first-name>
<last-name>string</last-name>
</author>
</book>
</bookstore>

 
Generated XML Sample Document

Liquid XML Studio

Starter Edition


Liquid XML Studio

Designer Edition


Liquid XML Studio

Developer Edition