prev table of contents next

2.2.12.2 Content: An Ordered Set of Elements

The schema element xsd:sequence defines that the enclosed set of elements should occur in the given order and according to the specified minimum and maximum repetition counts. (The default for both is 1.) The following complex type defines a set of two coordinates.

<xsd:complexType name="PointType">
  <xsd:sequence>
    <xsd:element name="X" type="xsd:int"/>
    <xsd:element name="Y" type="xsd:int"/>
  </xsd:sequence>
</xsd:complexType>
The resulting Java code is straightforward.
public class PointType {
 
    protected int x;
    protected int y;
 
    public int getX() {
        return x;
    }
 
    public void setX(int value) {
        this.x = value;
    }
 
    public int getY() {
        return y;
    }
 
    public void setY(int value) {
        this.y = value;
    }
}

prev table of contents next