Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

15. XMLĀ >Ā 15.2. XML Basics

15.2. XML Basics

XML permits document authors to create markup (i.e., a text-based notation for describing data) for virtually any type of information, enabling them to create entirely new markup languages for describing any type of data, such as mathematical formulas, software-configuration instructions, chemical molecular structures, music, news, recipes and financial reports. XML describes data in a way that human beings can understand and computers can process.

Figure 15.1 is a simple XML document that describes information for a baseball player. We focus on lines 5–9 to introduce basic XML syntax. You’ll learn about the other elements of this document in Section 15.3.


Ā 1Ā Ā Ā <?xml version = "1.0"?>
Ā 2
Ā 3Ā Ā Ā <!-- Fig. 15.1: player.xml -->
Ā 4Ā Ā Ā <!-- Baseball player structured with XML -->
Ā 5Ā Ā Ā <player>
Ā 6Ā Ā Ā Ā Ā Ā <firstName>John</firstName>
Ā 7Ā Ā Ā Ā Ā Ā <lastName>Doe</lastName>
Ā 8Ā Ā Ā Ā Ā Ā <battingAverage>0.375</battingAverage>
Ā 9Ā Ā Ā </player>


Ā Ā 

You are currently reading a PREVIEW of this book.

Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā 

Get instant access to over
$1 million worth of books and videos.

Ā Ā 

Start a Free Trial


Ā Ā