Issue Details (XML | Word | Printable)

Key: MODELLO-49
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Herve Boutemy
Reporter: Denis Cabasson
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Modello

Support for xml.attribute and xml.listStyle="flat" is missing in xsd plugin

Created: 28/Jul/06 11:10 AM   Updated: 01/Dec/07 05:25 PM
Component/s: modello-plugin-xsd
Affects Version/s: 1.0-alpha-5
Fix Version/s: 1.0-alpha-18

Time Tracking:
Not Specified

File Attachments: 1. Text File MODELLO-49-modello-plugin-xsd.patch (17 kB)

Issue Links:
dependent
 

Complexity: Intermediate


 Description  « Hide
Problem is trickier here (than for xdoc plugin).

Indeed, attributes are ok, but flat lists are a pain.

Right now, plugin is generating xs:all elements, which doesn't allow for maxOccurs. So that would mean detecting from parent class when child association is flat list, and generating a xs:sequence instead of the xs:all for this element.

Is this solution acceptable?



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Denis Cabasson added a comment - 07/Aug/06 08:47 AM
Support for attributes as well as different xml.listStyle.

Added support for nameSpace, but something is broken in model metadata, see MODELLO-46 .

Some TODOs left in the code.

Don't know if classes such as List or Properties are still supported in modello-core.

And dates doesn't seem to be supported in xsd plugin (update of the test case would be indeed cery interesting on this point).


Joakim Erdfelt added a comment - 21/Mar/07 06:30 AM
Support for Date and long was added to the xsd plugin r826.

Support for Model Metadata in core was added in r821.

Support for configurable Namespace was added in r826.

What's left?


Herve Boutemy added a comment - 03/Oct/07 06:31 AM
Support for xml.attribute was just added in r864.

The last one missing is support for xml.listStyle="flat"


Herve Boutemy added a comment - 04/Oct/07 04:14 AM
added support for xml.listStyle="flat" in r865
since such a list can't be expressed in XML Schema with an "all" compositor, which is the default compositor used, I added an attribute in the Modello class descriptor: xsd.compositor="all|sequence" (default value is "all", of course)
When a class contains a flat list, xsd.compositor="sequence" has to be declared in its descriptor or you'll get an IllegalStateException.
This way, the change from all to sequence is not automagic but known from the developer: when you have a sequence, the order of elements is checked while it is not the case with "all" compositor.
By the way, it permits to choose a sequence even if there is no flat list: after all, this can be a useful feature