- Shopping Bag ( 0 items )
The third edition of Sams Teach Yourself XML in 24 Hours, Complete Starter Kit is everything you need to know about the XML language and how to use it in practical, innovative applications. Understanding the syntax of XML is only a small part of the learning process; understanding how to apply it is the larger part of the learning process, and is the primary focus of this book. It covers a broad range of topics, and wil show you how to use XML to mine data on the web, how to use it to interact with existing data services such as iTunes and Google, and how to use it in applications such as e-books, online speech synthesis, and multimedia. Sams Teach Yourself XML in 24 Hours, Complete Starter Kit, Third Edition will teach you what you need to know to get up and running with XML and more importantly, how to do cool things with it!
How This Book Is Structured.
What You’ll Need.
How to Use This Book.
I: XML ESSENTIALS.
HOUR 1: Getting to Know XML.
The What and Why of XML.
XML and Web Browsers.
HOUR 2: Creating XML Documents.
A Quick XML Primer.
Selecting an XML Editor.
Constructing Your First XML Document.
Viewing Your XML Document.
II: DEFINING XML DATA.
HOUR 3: Defining Data with DTD Schemas.
Creating Your Own Markup Languages.
Schemas and XML Data Modeling.
Comparing Schema Technologies.
The Importance of Document Validation.
DTD Construction Basics.
Digging Deeper into Elements.
Putting Attributes to Work.
A Complete DTD Example.
HOUR 4: Digging Deeper into XML Documents.
Leaving a Trail with Comments.
Characters of Text in XML.
The Wonderful World of Entities.
The Significance of Notations.
Working with CDATA.
Using XML to Create an Online Radio.
HOUR 5: Putting Namespaces to Use.
Declaring and Using Namespaces.
HOUR 6: Using SVG to Draw Scalable Graphics.
What Is SVG?
SVG and Related Technologies.
Inside the SVG Language.
Creating an SVG Drawing.
Embedding an SVG Drawing in a Web Page.
HOUR 7: Using XML Schema.
XML Schema Construction Basics.
Working with Simple Types.
Digging into Complex Types.
Namespaces and XSD Schemas.
A Complete XML Schema Example.
RELAX NG and the Future of XML Schema.
HOUR 8: Validating XML Documents.
Document Validation Revisited.
Repairing Invalid Documents.
III: FORMATTING AND DISPLAYING XML DOCUMENTS.
HOUR 9: XML Formatting Strategies.
Style Sheets and XML Formatting.
Leveraging CSS, XSLT, and XSL-FO.
Style Sheets in Action.
HOUR 10: Styling XML Content with CSS.
Getting to Know CSS.
Wiring a Style Sheet to an XML Document.
Your First CSS Style Sheet.
Inside CSS Positioning.
The Ins and Outs of Text Formatting.
Your Second Complete Style Sheet.
HOUR 11: Getting Started with XSL.
The Pieces and Parts of XSL.
An XSLT Primer.
Wiring an XSL Style Sheet to an XML Document.
Your First XSLT Style Sheet.
HOUR 12: Transforming XML with XSLT.
A Closer Look at XSLT.
Putting Expressions to Work.
A Complete XSLT Example.
Yet Another XSLT Example.
HOUR 13: Access Your iTunes Music Library via XML.
The Role of XML in iTunes.
Digging Into the iTunes Library File.
Linking to Tracks in the iTunes Store.
Building an iTunes Web Viewer.
HOUR 14: Formatting XML with XSL-FO.
What Is XSL-FO?
Working with the XSL-FO Language.
Validating an XSL-FO Document.
Converting an XSL-FO Document to PDF.
A More Complete XSL-FO Example.
HOUR 15: Using XML to Hack Google Maps.
Getting to Know Google Maps.
Google Maps Customization Basics.
Brainstorming a Custom Mapping Application.
Developing a Custom Map Document.
Hacking Together a Custom Google Map.
IV: PROCESSING AND MANAGING XML DATA.
HOUR 16: Parsing XML with the DOM.
What Is the DOM?
How the DOM Works.
Binding XML Data to a Web Page.
Using the DOM to Access XML Data.
A Complete DOM Example.
Updating the DOM Tree.
HOUR 17: SAX: The Simple API for XML.
What Is SAX?
Writing Programs That Use SAX Parsers.
Obtaining a SAX Parser.
Using SAX with Java.
Inside the SAX Sample Program.
HOUR 18: Querying XML Data with XQuery.
What Is XQuery?
XML Data Querying 101.
Processing XQuery Results.
Getting to Know Saxon.
Practical XML Querying with XQuery and Saxon.
HOUR 19: Using XML with Databases.
A Quick Relational Database Primer.
The World’s Shortest Guide to SQL.
Databases and XML.
Exporting an XML Document from a Database.
Accessing Data from a Database as XML.
HOUR 20: Using XML to Assist Search Engines.
Web Crawling Basics.
Getting to Know Google Sitemaps.
Inside the Google Sitemap Protocol.
Creating Your Own Sitemap.
Validating Your Sitemap.
Submitting Your Sitemap to Google.
Using an Automated Sitemap Tool.
V: XML’S IMPACT ON HTML.
HOUR 21: Adding Structure to the Web with XHTML.
XHTML: A Logical Merger.
Comparing XHTML and HTML.
Creating and Validating XHTML Documents.
Migrating HTML to XHTML.
HOUR 22: Addressing and Linking XML Documents.
Navigating a Document with XPath Patterns.
Using XPath Functions.
The Role of XPath.
HTML, XML, and Linking.
Addressing with XPointer.
Linking with XLink.
A Complete XLink Example.
HOUR 23: Going Wireless with WML and XHTML Mobile .
XML and the Wireless Web.
Creating WML Documents.
Blending WML with XHTML Mobile.
HOUR 24: Syndicating the Web with RSS News Feeds.
A Brief History of RSS.
Using an RSS News Aggregator.
Inside the RSS 2.0 Language.
Creating and Validating a News Feed.
Displaying a News Feed.
APPENDIX A: XML Resources.
General XML Resources.
Of all the software technologies that have come and gone in the relatively short time since we all plugged in to the Web, few have been as far-reaching yet misunderstood as XML. Even with its catchy name that conjures up images of extreme sports, the true nature of XML continues to elude many technical people. The reason has to do with the fact that XML is very much a behind-the-scenes technology that helps to ensure that data is structured in an orderly fashion. There are very few situations where an end-user can see XML at work in a practical application. In this way, XML is a lot like residential building codes. When a house is built, thousands of building codes are used to guide contractors so that the house goes up safe and sound. As a homeowner, it's difficult to look at a finished house and grasp how all these building codes impacted the wood, shingles, and brick that you can see and feel. The building codes are abstract in a sense that you can't touch them, but they play a critical role in the construction process all the same. XML plays a similar role in software, including web sites, operating systems, and distributed applications.
I often hear people describe XML as "the new HTML," which sounds good but is not very accurate. XML, unlike HTML, is an extremely broad data-structuring standard that has implications far beyond web pages. For example, consider this question: HTML is to web pages as XML is to what? This is a difficult question to answer because XML isn't really geared toward any one solution. Instead, XML provides the framework for creating customized solutions to a wide range of problems. This is made possible through XML-based markup languages, which are custom markup languages that you create using XML. If you want to chart the statistics of your child's baseball team, you could create your own Little League Markup Language, or LLML, which includes custom tags and attributes for keeping up with important stats such as hits, runs, errors, and parental outbursts. The high degree of structure in your Little League data would allow it to be easily sorted, manipulated, and displayed according to your needs; the data would have the mathematical flexibility of a spreadsheet along with the visual accessibility of a web page. XML makes all this possible.
Maybe you have bigger plans for your XML knowledge than just tracking stats for a Little League team. If so, you'll be glad to know that XML is the enabling technology behind all kinds of interesting software applications. Practically all of the big Internet players have invested heavily in XML. As an example, Amazon.com uses XML to expose its product data so that developers can build custom shopping applications. Another interesting application of XML that has caused quite a stir recently is Google Maps, which is Google's innovative online mapping application. Google Maps relies on XML for map data. In fact, in Hour 15 of this book, "Using XML to Hack Google Maps," you learn how to "hack" Google Maps to use your own XML-based maps. One last example of how XML may have sneakily entered your life already is iTunes, Apple's incredibly popular online music store. iTunes uses XML to store information about your music library locally on your computer. With a little bit of effort, you can access your iTunes music library via XML and view or manipulate it any way you choose. This task is covered in Hour 13, "Access Your iTunes Music Library via XML."
XML is worth learning because it is an excellent back-end technology for storing and sharing data in a highly structured manner. Another reason for learning XML has to do much more directly with the web: XML is very much shaping the future of HTML. As you may know, HTML is somewhat unstructured in the sense that web developers take great liberties with how they use HTML code. Although this isn't entirely HTML's fault, HTML shares a considerable amount of the blame because it doesn't have the structured set of rules that are part of XML. In an attempt to add structure and consistency to the Web, a reformulated version of HTML known as XHTML was created that adds the structure of XML to HTML. It may still be quite a while before XHTML fully unseats HTML, but web developers are busy making the move to a more structured Web thanks to XHTML.
This book, in many ways, is a testament to the fact that XML is a technology for both the present and the future. The majority of the book focuses on XML in the present and how it can be used to do interesting things today. My goal was to strike a careful balance between giving you practical knowledge for the present along with some foreshadowing of what might lie ahead for XML.
As the title suggests, this book is organized into 24 lessons that are intended to take about an hour each to digest. Don't worry, there are no penalties if you take more than an hour to finish a given lesson, and there are no special prizes if you speed through them faster! The hours themselves are grouped together into five parts, each of which tackles a different facet of XML:
This book assumes you have some familiarity with a markup language, such as HTML. You don't have to be an HTML guru by any means, but it definitely helps if you understand the difference between a tag and an attribute. Even if you don't, you should be able to tackle XML without too much trouble. It will also help if you have experience using a web browser. Even though there are aspects of XML that reach beyond the web, this book focuses a great deal on using web browsers to view and test XML code. For this reason, I encourage you to download and install the latest release of a major web browser such as Internet Explorer, Mozilla Firefox, Opera, or Safari.
In addition to web browsers, there are a few other tools mentioned throughout the book that you may consider downloading or purchasing based upon your individual needs. At the very least, you'll need a good text editor to edit XML documents. Windows Notepad is sufficient if you're working in a Windows environment, and I'm sure you can find a suitable equivalent for other environments. If you want to check into a more full-featured XML editor, it certainly won't hurt you. I mention several editors to consider in Hour 2 of the book, "Creating XML Documents." That's really all you need; a web browser and a trusty editor will carry you a long way toward becoming proficient in XML.
In code listings, line numbers have been added for reference purposes. These line numbers aren't part of the code. The code used in this book is also on this book's web site at http://www.samspublishing.com .
This book uses different typefaces to differentiate between code and regular English. Text that you type and text that appears on your screen is presented in monospace type.
It will look like this to mimic the way text looks on your screen .
Placeholders for variables and expressions appear in monospace italic font. You should replace the placeholder with the specific value it represents.
In addition, the following elements appear throughout the book:
Note - Notes provide you with comments and asides about the topic at hand.
© Copyright Pearson Education. All rights reserved.