[xsd-users] XSD Vs XSD/e differences

Iain Sharp isharp at atis.org
Mon Jul 17 09:56:59 EDT 2017


Hi Boris,

Thanks for the answer - this is very helpful.

> In fact, generating these for all the global elements is usually a source of huge (and usually unnecessary) bloat.

Yes, ultimately I think this is the root cause of our problem. I will look at how we can optimize-out unneeded elements and features.

Regards

Iain


-----Original Message-----
From: Boris Kolpackov [mailto:boris at codesynthesis.com] 
Sent: 17 July 2017 14:05
To: Iain Sharp <isharp at atis.org>
Cc: xsd-users at codesynthesis.com
Subject: Re: [xsd-users] XSD Vs XSD/e differences

Iain Sharp <isharp at atis.org> writes:

> * Export and import the data model to/from a DOM to allow serialization
>   and parsing in protocols other than XML (the prototype uses Xerces in
>   addition to XSD tree output)

This will be pretty hard to achieve in XSD/e since it doesn't have an intermediate representation like this.


> I built an initial trial based on XSD which works OK, but even with 
> the best optimizations I can find the code size is rather large - this 
> seems to be mostly due to the large number of objects defined in the 
> XSD.
> 
> Would swapping to XSD/e be expected to reduce the code size?

Highly unlikely. XSD/e will generate even more code for each schema type (for parser and serializer), especially if you don't disable validation.

Another thing you can try is look through --suppress-* options in XSD to eliminate features you don't need. Plus --generate-inline is a good idea. Finally, if desperate, you may want to disable generation of parsing/serialization functions (--root-element-none) and set this up yourself. In fact, generating these for all the global elements is usually a source of huge (and usually unnecessary) bloat.


> Is there a guide to the functional differences between XSD and XSD/e?

There is no feature-by-feature comparison. Generally, XSD has more features, is more powerful, flexible, and convenient. My recommendation would be to go with XSD unless you have a good reason to prefer XSD/e and are prepared for a "spartan" object model. In your case I believe XSD is a better choice.

Boris



More information about the xsd-users mailing list