Java Reference
In-Depth Information
<firstName>James</firstName>
<lastName>Joyce</lastName>
</s:search>
For such a small schema, this doesn't seem to give you much. But the benefit increases with
the size and complexity of your schema, and you can use XIG to generate sets of instances.
The XIG file is a template that can be used to generate not just one, but a volume of XML
instances based on this type. Moreover, you can pass runtime data to the template to provide
distinct values if necessary. Check out the Sourceforge XIG site for details, but here is what
the default generated .xigfile looks like:
<xig:template document='search' schema='src/xml/META-INF/wsdl/
Catalog.xsd'
xmlns:xds='http://xml-xsd.sourceforge.net/schema/XmlXsd-0.1'>
<search>
<firstName>${xs:string}</firstName>
<lastName>${xs:string}</lastName>
</search>
<xig:generate>
<!-- Generate instance documents from template document above -->
<loop count='10'>
</loop>
</xig:generate>
</xig:template>
If you want to invoke it multiple times with differently indexed data, it's ready to go. This is
similar to the parameterized test functionality available in JUnit 4.4.
Relaxer
Another popular tool for doing the same work is Relaxer, which works for XML Schema,
RELAX NG, Relax Core, and DTD. It's also a free download. Check out the tutorial and doc-
umentation at http://www.asahi-net.or.jp/~dp8t-asm/java/tools/Relaxer .
Search WWH ::




Custom Search