HTML and CSS Reference
In-Depth Information
Line 4 represents the root element of the XML document, with the start <products> tag and the code that
identifies and binds the XML Schema Definition file to this XML document. Line 5 defines the <item> element.
Lines 6 through 11 are the child elements of the <item> element, with one instance for each occurrence of a
data item. Line 12 is the </item> element end tag. The following step enters the document instance in the XML
document, chapter12-1products.xml.
1
If necessary, click
line 4.
Enter the XML code
shown in Table 12-19
to create the root
and first document
instance. Press the
e n t e r key after line 12
(Figure 12-15).
root element
containing
schema filename
child elements
containing item
attributes
When I enter line 4,
when should I press
e n t e r ?
Type line 4 as one
continuous line, and
do not press the e n t e r
key until the end of
the line. Where line 4 wraps to the next line on your screen may differ from Table 12-19 or Figure 12-15.
press e n t e r
key once
Figure 12-15
To Finish Entering a Document Instance in an XML Document
To complete the document instance, the remaining elements for each item record in the list are entered using the
same format, as shown in Table 12-20.
Table 12-20 Code for Completing the Document Instance
Line
Code
13
<item>
14
<item-id>R140</item-id>
15
<item-description>14-inch Roast Knife</item-description>
16
<item-boh>19</item-boh>
17
<item-brand>Russel</item-brand>
18
<item-cost>58.99</item-cost>
19
<item-vendor_ID>CH100</item-vendor_ID>
20
</item>
21
<Item>
22
<item-id>S245</item-id>
23
<item-description>Salt and Pepper Shakers</item-description>
24
<item-boh>3</item-boh>
25
<item-brand>Du Pont</item-brand>
26
<item-cost>9.99</item-cost>
27
<item-vendor_ID>5TY90</item-vendor_ID>
28
</item>
29
<item>
 
Search WWH ::




Custom Search