Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which Java xml framework can handle code generation with restrictions/extensions in schemas?

There is a set of XSD files, with the following types described in them:

A is a complex type with various elements. B restricts A, keeping only some of its elements C extends B, adding some elements.

So, this means that a Java class generated by a tool using type C from the XML schema, is expected to include only those members of A which are kept by B, and the new ones added by C

To make things even more difficult, B actually changes minOccurs attribute of some of the elements.

Are there any frameworks out there which can handle this? I've tried EMF and restrictions are not even reflected to code.

like image 975
mahonya Avatar asked Nov 18 '10 21:11

mahonya


1 Answers

Use Castor CodeGenerator. It's Nice. See http://www.castor.org/reference/html-single/index.html#xml.code.generator.examples.non-trivial

like image 94
Puspendu Banerjee Avatar answered Oct 09 '22 17:10

Puspendu Banerjee