HTML and CSS Reference
In-Depth Information
To Enter Code for the Child Group Elements
The last <group> element lists the individual elements that belong to the <item> element. The <item> element
is a child of the <products> element, and each item instance has elements that describe the item. These descriptive (or
<sequence>) elements are child elements of the <item> element. The code in Table 12-15 contains the group element
and the <sequence> elements for each individual item and that item's data type.
Table 12-15 Code for Inserting the <group> Element
Line
Code
23
<xs:group name=”childElements”>
24
<xs:sequence>
25
<xs:element name="item-id" type="xs:string" />
26
<xs:element name="item-description" type="xs:string" />
27
<xs:element name="item-boh" type="xs:integer" />
28
<xs:element name="item-brand" type="xs:string" />
29
<xs:element name="item-cost" type="xs:decimal" />
30
<xs:element name="item-vendor_ID" type="xs:string" />
31
</xs:sequence>
32
</xs:group>
Line 23 is the <group> element that relates the <sequence> items to the child element (item), which is referenced
by the name childElements on line 20. Line 24 starts the <sequence> elements. Recall that elements after a <sequence>
element must be in order as they exist in the XML file. Lines 25 through 30 are element tags that name the individual
fields and define their data type. Line 31 closes the <sequence> tag and line 32 closes the <group> tag. The closing
</xs:schema> element (line 34 in Figure 12-9) was entered with the prolog in Table 12-11 so it would not be forgotten.
The following step enters the code for the <group> element to define the childElements that belong to the
<item> element.
1
line 23.
If necessary, click
code shown in
Table 12-15 to
enter the <group>
element to define
the childElements,
pressing the e n t e r
key once after
line 32 (Figure 12 - 9).
Enter the XML
child element
with data types
press e n t e r
key once
Figure 12-9
 
Search WWH ::




Custom Search