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



The Hypertext Markup Language (HTML) and the World Wide Web altered the face of the Internet and of personal computing forever. One time regarded as the province of universities and government organizations, the Internet has grown to touch more and more lives every day. In addition, the multimedia content that can be provided via HTML (and its successor XHTML) and Web technologies such as JavaScript, Java, XML, CGI, and others makes the Web an exciting place to be.

Through the efforts of standards organizations such as the World Wide Web Consortium, and companies such as Netscape, Microsoft, Macromedia, and Sun Microsystems, HTML and the other languages and technologies used to present information over the Web have continued to develop and evolve. The number of possibilities for providing information content over the Web is astounding, and it's growing every day.

That is where Platinum Edition Using XHTML, XML, and Java 2 steps in to help. This book is the only source you need to quickly get up to speed and greatly enhance your skill and productivity in providing information on the World Wide Web.

How to Use This Book

This book was designed and written from the ground up with two important purposes:

  1. First, Platinum Edition Using XHTML, XML, and Java 2 makes it easy for you to find the most effective means of accomplishing any task or presenting almost any kind of information on the Web.

  2. Second, this book covers the major Web technologies—not only HTML, XHTML, XML, and Java, but also JavaScript, Microsoft's VBScript scripting language, CGI, and both Microsoft and Netscape's implementations of Dynamic HTML—in a depth and breadth that you won't find anywhere else. There is also a Web site that goes with the book, where you can find links to Web software, helpful documentation, and code from the examples in this book, at www.mcp.com.

With these goals in mind, how do you use this book?

If you are familiar with HTML and with setting up Web pages and Web sites, you can probably skim through the first chapter to see what some of the issues in page and site design are, and you can glance through the basic XHTML elements discussed in the other chapters in the first part of the book. If you are familiar with HTML, a lot of the information in this part will be new to you, as it discusses XHTML, the XML-compliant implementation of the HTML 4.0 standard. You can then read the advanced chapters on XHTML, as well as the sections on other Web technologies, such as JavaScript and Java, XML, ASP, CGI, and Dynamic HTML, to determine which of those elements you want to include in your Web pages.

Platinum Edition Using XHTML, XML, and Java 2 was written with the experienced HTML programmer in mind. Your experience might be limited to a simple Web home page you threw together, or you might be designing and programming professional Web sites. Either way, you will find comprehensive coverage of HTML and other Web technologies. Throughout the book, techniques are described for creating quality, effective Web pages and Web sites.

How This Book Is Organized


Chapter 1, "Web Site and Web Page Design," discusses the issues concerning how to establish a consistent look-and-feel and how to organize your Web pages so they come together to form a coherent whole. It also gives you an overview of some of the issues that need to be considered when designing and laying out your Web pages.

Chapter 2, "Introduction to XHTML," lets you know just what XHTML is, why it is needed, and the differences between XHTML and HTML.

Chapter 3, "XHTML 1.0 Element Reference," gives you a quick reference to all the XHTML 1.0 elements in a format that is easy to understand and use.

Chapter 4, "Image Maps," shows how graphics can be used as image maps—graphic navigation aids formatted to enable the user to link to other URLs by clicking sections of the graphic. The chapter discusses both server-side and client-side image maps.

Chapter 5, "Advanced Graphics," talks about the basic XHTML elements used to include graphics in an XHTML document and discusses the graphics formats and display options supported. The chapter also discusses some of the many uses of graphics.

Chapter 6, "Tables," discusses the use of XHTML tables, both to present data and information in a tabular format and also to achieve greater control of the relative placement and alignment of XHTML text, images, and other objects.

Chapter 7, "Frames," shows you how to split the Web browser window into frames and how to use each frame to display a different XHTML document. Some of the potential uses of frames are also shown and discussed.

Chapter 8, "Forms," discusses XHTML forms—the primary way that user input and interactivity is currently supported in Web pages.

Chapter 9, "Style Sheets," takes a look at a recommended and increasingly popular formatting option available for use with XHTML: Cascading Style Sheets. Style sheets are a way of setting up a custom document template that gives the Web page author a great deal more control over how Web pages will look to those viewing the pages.

Part II: XML

Chapter 10, "Introducing XML," introduces you to XML (and its supporting technologies)—a new markup language that has the potential to provide increased capabilities for formatting information for the Web, the Internet, and beyond.

Chapter 11, "Creating XML Files for Use," describes the component parts of an XML document, so you can create well-formed and valid XML.

Chapter 12, "Parsing and Navigating XML—SAX, DOM, XPath, XPointer, and XLink," describes important technologies that allow you to navigate an XML document or manipulate its content.

Chapter 13, "Transforming XML—XSLT," discusses the important concept of transforming XML documents so that they can be used or displayed in a variety of contexts.

Chapter 14, "Constraining XML—DTDs and XML Schemas," explores the importance of ensuring that the structure of XML documents conforms to the desired format for a particular purpose.

Chapter 15, "Formatting and Displaying XML," shows you some simple techniques for displaying XML using Cascading Style Sheets or XSL Formatting Objects.

Chapter 16, "Exploiting XML—XML and e-Commerce," takes a look at how XML technologies can be used when exchanging data and information between businesses.

Chapter 17, "Moving Forward with XML," looks at some of the exciting XML-related technologies that are currently under development at the World Wide Web Consortium and looks at how you can develop the skills to use them to their full potential.

Part III: JavaScript

Chapter 18, "Introduction to JavaScripting," discusses Netscape's JavaScript Web browser scripting language and shows some ways to use it in a Web page.

Chapter 19, "The Document Object Model," discusses the object model included with Netscape Navigator and Microsoft Internet Explorer. That object model enables you to use scripting languages to interact with XHTML documents.

Chapter 20, "Manipulating Windows and Frames with JavaScript," shows you how to use JavaScript to create and use Web browser windows, dynamically generate XHTML documents, and manipulate and cross-communicate between multiple windows and frames.

Chapter 21, "Using JavaScript to Create Smart Forms," shows you how you can use JavaScript to pre-process information entered into XHTML forms and thus ensure that only valid data is submitted to the Web server.

Chapter 22, "Cookies and State Maintenance," shows you how to interface with and manipulate Web browser cookies with JavaScript. This enables you to remember information from one page to another in a Web site and across multiple visits to a Web site from a single user.

Chapter 23, "Using JavaScript to Control Web Browser Objects," shows you how you can use Netscape's LiveConnect and Microsoft's ActiveX technologies to access and manipulate Java applets, plug-in content, ActiveX Controls, and other objects through JavaScript.

Part IV: Dynamic HTML

Chapter 24, "Introduction to Dynamic HTML," introduces you to the Dynamic HTML implementations of Netscape and Microsoft—two very different ways of adding increased animation and interactivity to Web pages.

Chapter 25, "Advanced Microsoft Dynamic HTML," explores the set of Web technologies that Microsoft has dubbed Dynamic HTML, including extensions to Microsoft's Document Object Model and the use of ActiveX Controls and other Web browser objects to implement new capabilities to Microsoft's Web browser.

Chapter 26, "Advanced Netscape Dynamic HTML," goes into greater depth to show you more of Netscape's two versions of Dynamic HTML. The version of Dynamic HTML in pre-version 6 browsers centers around Netscape's use of manipulating style sheet attributes, the nonstandard <LAYER> element, and Netscape's downloadable font technology. For Navigator version 6, the focus is on implementing the W3C standard Document Object Model.

Chapter 27, "Cross-Browser Dynamic HTML," discusses the increasingly complex techniques required to create Dynamic HTML Web pages that can be successfully viewed using multiple versions of either Netscape Navigator or Microsoft Internet Explorer.

Part V: Server-Side Processing

Chapter 28, "Programming CGI Scripts," describes the basics of the Common Gateway Interface (CGI) and how you can use programs, scripts, and processes that can be run on the Web server with Web browsers.

Chapter 29, "Server-Side Includes," explains server-side includes (SSI)—what they are, how they are used, and some sample applications that show them in action.

Chapter 30, "Server-Side Security Issues," discusses in much greater depth the security issues involved with running and using server-side processing. The discussion also examines what to do with bad data and how to help ensure the safety of your server against malevolent attacks.

Chapter 31, "Survey of Web Databases," discusses some of the tools and utilities you can use to set up databases for access over the Web.

Chapter 32, "Writing Active Server Pages," discusses the Active Server Pages component of Microsoft's Internet Information Server Web server, and how you can use it to dynamically configure and tailor the output of your Web site according to the capabilities of your clients. It also discusses Microsoft's VBScript scripting language, which can be used with the ASP technology.

Chapter 33, "Using ColdFusion," covers Allaire's ColdFusion, a development tool for writing Web-based applications that communicate with server-side, ODBC-compliant databases.

Chapter 34, "Using PHP," discusses PHP, an XHTML-embedded scripting language used to allow Web developers to write dynamically generated pages quickly.

Part VI: Java 2

Chapter 35, "Introduction to Java," gives you an overview of the latest on Java and the technologies that support it. It includes a discussion of all the new features in Java, as well as security and performance enhancements.

Chapter 36, "Developing Java Applets," discusses the basics of designing, writing, and debugging Java applets by using a variety of software development tools.

Chapter 37, "User Input and Interactivity with Java," examines how you can use Java applets to add another way of soliciting user input and adding interactivity between Web pages and users.

Chapter 38, "Graphics and Animation," shows some of the graphics capabilities of Java and how you can use Java to create both static and dynamic images within a Web page.

Chapter 39, "Network Programming," explains how you can use Java sockets to interface Java applets with other sources of data and information anywhere on the Internet.

Chapter 40, "Security," explains some of the special security issues related to writing, providing, and running Java applets over the Web.

Chapter 41, "Server-Side Java," discusses the uses of server-side Java applets, called servlets, in providing greater interactivity and capabilities for Web pages and other applications.

Chapter 42, "Java and XML," talks about the different ways of interfacing Java and XML, and how the combination can be used for many different applications.

Part VII: Appendixes

Appendix A, "JavaScript Language Reference," provides a reference to the most useful properties, functions, and statements included in the JavaScript language.

Appendix B, "General Reference Resource," contains a list of links to Web resources where you can get more information on all the technologies discussed in this book.

Special Features in the Book

Que has more than a decade of experience in writing and developing the most successful computer books available. With that experience, Que has learned which special features help readers most. Look for the following special features throughout the book to enhance your learning experience.


Notes present interesting or useful information that isn't necessarily essential to the discussion. This secondary track of information enhances your understanding of the material being discussed, but you can safely skip Notes and not be in danger of missing crucial information. Notes look like the following:


Because XHTML 1.0 is HTML 4.01 with syntax rules enforced, any HTML 4.01-compliant browser should render your XHTML code without a problem. Such a browser might not validate your code to make sure that all the syntax rules are followed, though.


Tips present advice on quick or often overlooked procedures. These include shortcuts that save you time. A Tip looks like the following:


Using an asterisk (*) as the value of your ALT attribute gives users with nongraphical browsers a bulletlike character in front of each list item.


Cautions warn you about potential problems that a procedure might cause, about unexpected results, and mistakes to avoid. Cautions look like the following:


Don't let an animation run indefinitely. An animation that's running constantly can be a distraction from the rest of the content on your page.

Cross References

Throughout the book, you will see references to other sections, chapters, and pages in the book. These cross references point you to related topics and discussions in other parts of the book and look like the following:

▸ For more information about the Web browser objects, see "Web Browser Object Model,"

Other Features

In addition to the previous special features, several conventions are used in this book to make it easier to read and understand.

Typefaces This book uses the following typeface enhancements to indicate special text, as shown in the following table:

Typeface Description
italic Italic is used to indicate new terms.
computer type This typeface is used for onscreen messages, commands, and code. It is also used to indicate text you type and locators in the online world.
computer italic type This typeface is used to indicate placeholders in code and commands.

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint