Sie sind auf Seite 1von 1

3236-7 ch04.F.

qc

66

6/29/99

1:04 PM

Page 66

Part I Introducing XML

tag comes before all other elements start tags, and the root elements end tag
comes after all other elements end tags. For our root element, we will use SEASON
with a start tag of <SEASON> and an end tag of </SEASON>. The document now
looks like this:
<?xml version=1.0?>
<SEASON>
</SEASON>

The XML declaration is not an element or a tag. It is a processing instruction.


Therefore, it does not need to be contained inside the root element, SEASON. But
every element we put in this document will go in between the <SEASON> start tag
and the </SEASON> end tag.
This choice of root element means that we will not be able to store multiple
seasons in a single file. If you want to do that, however, you can define a new root
element that contains seasons. For example,
<?xml version=1.0?>
<DOCUMENT>
<SEASON>
</SEASON>
<SEASON>
</SEASON>
</DOCUMENT>

Naming Conventions
Before we begin, Id like to say a few words about naming conventions. As youll see in the
next chapter, XML element names are quite flexible and can contain any number of letters
and digits in either upper- or lowercase. You have the option of writing XML tags that look
like any of the following:
<SEASON>
<Season>
<season>
<season1998>
<Season98>
<season_98>
There are several thousand more variations. I dont really care (nor does XML) whether you
use all uppercase, all lowercase, mixed-case with internal capitalization, or some other convention. However, I do recommend that you choose one convention and stick to it.

Das könnte Ihnen auch gefallen