HTML and CSS Reference
In-Depth Information
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
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:complexType name=”childType”>
<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.
If necessary,
line 19.
Enter the XML code
shown in Table 12-14
to enter the
element to define
the group elements.
Press the
e n t e r key
twice after line 21
and position the
insertion point at the
beginning of line 23
(Figure 12-8).
complex element
for child elements
press e n t e r
key twice
Figure 12-8
Search WWH ::

Custom Search