Java Reference
In-Depth Information
<language>français</language>
</movie>
ThefinalattributethatcanappearintheXMLdeclarationis
standalone
.Thisop-
tionalattributedetermineswhethertheXMLdocumentreliesonanexternalDTD(dis-
cussedlaterinthischapter)—its valueis
no
—ornot—itsvalueis
yes
.Thevaluede-
faultsto
no
,implyingthatthereisanexternalDTD.However,becausethereisnoguar-
antee of a DTD,
standalone
is rarely used and will not be discussed further.
Elements and Attributes
FollowingtheXMLdeclarationisa
hierarchical
(tree)structureofelements,wherean
element
isaportionofthedocumentdelimitedbya
start tag
(suchas
<name>
)andan
end tag
(suchas
</name>
),orisan
empty-element tag
(astandalonetagwhosename
ends with a forward slash [
/
], such as
<break/>
). Start tags and end tags surround
content and possibly other markup whereas empty-element tags do not surround any-
thing.
Figure 10-1
reveals
Listing 10-1
'
s XML document tree structure.
AswithHTMLdocumentstructure,thestructureofanXMLdocumentisanchoredin
a
root element
(thetopmostelement).InHTML,therootelementis
html
(the
<htm-
l>
and
</html>
tagpair).UnlikeinHTML,youcanchoosetherootelementforyour