Microsoft Word Applied xml a toolkit for Programmers Wiley doc




Download 2,96 Mb.
Pdf ko'rish
bet63/131
Sana14.05.2024
Hajmi2,96 Mb.
#232039
1   ...   59   60   61   62   63   64   65   66   ...   131
Bog'liq
Ceponkus, Hoodbhoy - Applied XML - Toolkit for Programmers

Figure 3.4:
Raw XML display in Internet Explorer 5.
The red (gray in the picture) hyphens preceding the parent element names are handles 
that you can click on to collapse or expand portions of the XML document tree. 
While this discussion may seem fairly complicated for something as small as a single 
contact entry, think of it in terms of scalability. This model scales very well for larger data 
sets, say for a contact database of several thousand contacts.
Finally, every so often, you have elements that are not being used for containing content 
but are being used as placeholders or to signify information by virtue of their existence 
(for example, the line break 
tag in HTML). For such empty elements, you can 
represent them in one of two ways. Let’s say a particular contact has no address 
information. In that case, you could represent the contact as follows:

Or, if you prefer, as:



- 58 -
Both are acceptable and considered well formed.
Attributes
Attributes
 
are usually small, descriptive bits of information used for describing elements. 
Again, if you are familiar with HTML, then the concept of attributes is also familiar. For 
example, an attribute of the 

element would be 
align = "center"
. If you’re 
not familiar with HTML, then think of attributes in their literal sense: as adjectives used to 
describe nouns (elements).
You can use attributes in several ways to further describe your data. They are contained 
within the start tag of an element after the element name (remember the rule from Table 
3.1, “no spaces allowed in element names”?—now you know why) and are followed by 
an = sign, which is followed by the value of the attribute in quotes (“”). Table 3.2 
describes some syntax and interpretations.

Download 2,96 Mb.
1   ...   59   60   61   62   63   64   65   66   ...   131




Download 2,96 Mb.
Pdf ko'rish

Bosh sahifa
Aloqalar

    Bosh sahifa



Microsoft Word Applied xml a toolkit for Programmers Wiley doc

Download 2,96 Mb.
Pdf ko'rish