Java Reference
In-Depth Information
<samplexmltag color="blue">Sample XML tagged data</samplexmltag>
If you have an empty element, one that that either does not or cannot have
data between its start tag and end tag, you may “combine” the start and end
tag by putting the slash at the end of the tag:
<samplexmltag color="blue"/>
Obviously, there is more to it than this, but it is enough to begin with.
XML's uses range from publishing to networked interprocess communica-
tions. Our interest here is in using it to represent a model of a piece of software
and the various ways that software might be built and deployed. So from here
on, we will be discussing not XML in general, but the ant document type. Ac-
tually, ant 's markup language uses unvalidated XML. In other words, there
isn't officially a schema for ant . Thus, the only formal definition for an ant
XML file is what ant accepts and understands. This is more common than it
should be. Any XML markup vocabulary really should have a schema, but often
XML use starts with “Oh, this is just a quick thing. No one will ever read or
write this markup. Just these two programs of mine.” These famous last words
will one day be right up there with “I only changed one line of code!” As
strongly as we feel about this, ant really can never have a DTD, at least not a
complete one. The custom task feature makes this impossible.
9.4.2
The buildfile (usually named build.xml ) begins with a header announcing
that this is an XML document and specifying what version of XML is being
used in it:
The Buildfile Tags
<?xml version="1.0"?>
The <? and ?> delimiters mark up an XML statement (as opposed to an
XML tag). 6 In this case, we are declaring that this is an XML document and
that it is using XML version 1.0.
6. Note that these are the terms we are using to describe XML to a new user. They are not the
formal terms for these document elements. For the proper names, consult an XML reference.
Search WWH ::




Custom Search