Modello
  1. Modello
  2. MODELLO-49

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

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0-alpha-5
    • Fix Version/s: 1.0-alpha-18
    • Component/s: modello-plugin-xsd
    • Labels:
      None
    • Complexity:
      Intermediate
    • Number of attachments :
      1

      Description

      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?

        Issue Links

          Activity

          Hide
          Denis Cabasson added a comment -

          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).

          Show
          Denis Cabasson added a comment - 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).
          Hide
          Joakim Erdfelt added a comment -

          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?

          Show
          Joakim Erdfelt added a comment - 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?
          Hide
          Herve Boutemy added a comment -

          Support for xml.attribute was just added in r864.

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

          Show
          Herve Boutemy added a comment - Support for xml.attribute was just added in r864. The last one missing is support for xml.listStyle="flat"
          Hide
          Herve Boutemy added a comment -

          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

          Show
          Herve Boutemy added a comment - 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

            People

            • Assignee:
              Herve Boutemy
              Reporter:
              Denis Cabasson
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: