You work your own way at Delphi.
With that said, I use xjc and xsd files to create Java classes.
It looks like you included the xsd sample in your question, which, as you know, is wrong. In your xsd example, you have a sequence of sequences - I would expect your sample to generate a class with a collection of collections of task objects.
If I understand your question correctly, then you want the TaskList to contain a set of tasks. It should not be too complicated. What have you tried?
Here is an example of how I generate a Thresholds object that contains a list of individual Threshold objects:
<xsd:element name="Thresholds" type="ThresholdsType"/> <xsd:complexType name ="ThresholdsType"> <xsd:sequence> <xsd:element ref="Threshold" maxOccurs="unbounded" minOccurs="0"/> </xsd:sequence> <xsd:attribute name="interpolate" type="xsd:string" use="optional" /> <xsd:attribute name="parameter" type="xsd:string" use="optional" /> <xsd:attribute name="unitSystem" type="xsd:string" use="optional" /> </xsd:complexType> <xsd:element name="Threshold" type="ThresholdType"/> <xsd:complexType name="ThresholdType"> <xsd:simpleContent> <xsd:extension base="xsd:string"> <xsd:attribute type="xsd:string" name="id" use="optional"/> <xsd:attribute type="xsd:double" name="minInclusive" use="optional"/> <xsd:attribute type="xsd:double" name="maxExclusive" use="optional"/> </xsd:extension> </xsd:simpleContent> </xsd:complexType>
Here is the beginning of the generated java class of the ThresholdsType class:
@XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ThresholdsType", propOrder = { "threshold" }) @javax.xml.bind.annotation.XmlRootElement(name="ThresholdsType implements Cloneable, Named, Visitable, CopyTo, Equals, HashCode, ToString") public class ThresholdsType implements Cloneable, Named, Visitable, CopyTo, Equals, HashCode, ToString { @XmlElement(name = "Threshold") protected List<ThresholdType> threshold; @XmlAttribute(name = "interpolate") protected String interpolate; @XmlAttribute(name = "parameter") protected String parameter; @XmlAttribute(name = "unitSystem") protected String unitSystem; @XmlTransient private QName jaxbElementName; ...
I had to rename the “threshold” field inside ThresholdsType to “thresholds”, but other than that, it works fine.
Does it work?
<complexType name="TaskList"> <sequence> <element ref="struct:task" maxOccurs="unbounded" minOccurs="0"/> </sequence> </complexType>