How to generate example XML containing all allowed elements and actual data from a collection of XML documents?



I have a frequent use case of handling collections of XML documents that have a common structure but almost always utilize just a small subset of the allowed elements. For testing purposes I would prefer an example XML that would contain all the allowed elements. I can of course use some tools to infer XSD from the XML documents, and use the XSD to generate an example XML, but the resulting document would just contain filler data, using any of the XSD-to-XML tools I know. Instead, I would like to generate a document with real data, i.e. an "address" element would contain the text from the "address" element of one of the original XML documents.


No comments:

Post a Comment