HTML and CSS Reference
Defining and Inserting the Child Elements
The next part of the schema defines the child elements, which are defined as
<complexType> elements using a group element. Table 12-13 describes the basic form of
a <group> element.
Table 12-13 General Form of a Group Element
<namespace:group [id=ID name=Name ref=referencedName maxOccurs=positive
Integer minOccurs=zero or any positive Integer any attributes] >
The group element indicates a series of elements are part of a larger group element. The
id is a unique name. The name specifies the name for the group and is used only when
the element is the parent of the group. Ref relates this group to another group element.
The name and ref attributes cannot be used together. The minOccurs and maxOccurs
indicate a valid range of values that can occur with a minimum of zero (minOccurs) to infinity
as defined by unbounded in maxOccurs. The any attributes are any non-XML attributes.
<xs:group ref="childElements" />
To Enter Code for the <complexType> Element
The code in Table 12-14 shows the XML Schema Definition element tags to define the group elements.
Table 12-14 Code for Inserting the <complexType> Elements
<xs:group ref=”childElements” />
Line 19 is a <complexType> element that indicates the following element is a child element. Line 20 expands
this definition by indicating with a <group> tag that the group elements belong to a child element, which is <item>.
Line 21 closes the <complexType> element. The following step enters the code for the <complexType> element.
Enter the XML code
shown in Table 12-14
to enter the
element to define
the group elements.
e n t e r key
twice after line 21
and position the
insertion point at the
beginning of line 23
for child elements
press e n t e r