Schema diagrams make it clear of the structure, 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 un expect 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, such 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. |
1 <?xml version="1.0" encoding="utf-8"?>
2 <!-- Created with Liquid XML Studio -->
3 <bookstore xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4 xsi:noNamespaceSchemaLocation="BookStore.xsd">
5 <book price="730.54" ISBN="string"
6 publicationdate="2016-02-27">
7 <title>string</title>
8 <author>
9 <first-name>string</first-name>
10 <last-name>string</last-name>
11 </author>
12 <genre>string</genre>
13 </book>
14 <book price="6738.774" ISBN="string">
15 <title>string</title>
16 <author>
17 <first-name>string</first-name>
18 <last-name>string</last-name>
19 </author>
20 </book>
21 </bookstore>
|