Re: [xsl] Question about Altova XML Spy

Subject: Re: [xsl] Question about Altova XML Spy
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Sun, 15 Oct 2006 20:06:56 +0200
meenakshi n wrote:
The issue I am facing
is that XML Spy is generating the sample XML only for
a part of the Schema and not for the entire schema. Is
there any way the XML can be generated for the entire
schema

Hi Meena,


I've often used XML Spy, but quickly abandoned generating XML from Schema, because it is severely lacking. Often it produces XML that will not validate. In situations where you have choices of sequences, or sequences of choices of sequences, XML creates totally unvalidating content. Types with a pattern will hardly ever result in a correct result. Not to mention unions, enums, and combinations of unions, enums and patterns.

This is not surprising. It is computationally (not sure of the term) very hard to reverse-engineer XML from XSD, except for the most trivial of cases, just to create some sample data. The best it can do, is provide you with a possible structure, that is quite close to your definition.

(the other way, from XML to Schema, is also hard, but at least the XSD created will be easier to create in such a way that is will indeed validate against the reference XML document).

If you want to auto-generate sample documents, I think your best bet is your own specially tailored XSLT. All you need to do is map some of your more special types to sample data, and you're done (well, it will require a bit of time, I guess).

Cheers,
-- Abel Braaksma
   http://www.nuntia.com

Current Thread