untitled

(ff) #1

16 1 Hierarchies and Relationships


attribute’s value. When an attribute has only a limited list of possible values,
then one chooses the desired value from a menu. Attributes are specified
in the same manner as one specifies fields of a record in a database using a
traditional “data entry” screen. An XML document is effectively an entire
database with one table for every kind of element.
In addition to attributes, an XML element can have text. This is often re-
ferred to as itstext contentto distinguish it from the elements it can contain.
In an XML editor, the text content is shown as if it were another child ele-
ment, but labeled with#text. It is also shown as if it were another attribute,
also labeled with#text.

Figure 1.8 The process of adding a new element to an XML document. The menus
shown were obtained by right-clicking on thegeneelement and then selecting the
Addchoice. The menu containingdna,name, and so on shows the elements that are
allowed in thegeneelement.
Free download pdf