Document Object Model: Processing Structured Documents

Document Object Model: Processing Structured Documents

Document Object Model: Processing Structured Documents

Document Object Model: Processing Structured Documents

Paperback

$61.00 
  • SHIP THIS ITEM
    Qualifies for Free Shipping
  • PICK UP IN STORE
    Check Availability at Nearby Stores

Related collections and offers


Overview

Document Object Model Analogy: In many ways, the Document Object Model (DOM) can be compared to the schematic of a house. A house's schematic details the relation and placement of objects within a house. For instance, within a schematic, you are able to understand the relationship of the sink to the wall, as well as the corresponding plumbing. In other words, the schematic defines the relationship of one object to another and often, illustrates the rules by which they are governed. HTML and XML documents are also composed of objects, and although these objects may not be physical, like a sink, their organisation and interaction is still coordinated by a set of rules. In this case, the DOM acts as a foundation for the placement and interaction of objects within a document. Whether the object is a table, a piece of information, or a script, the DOM specifies a model for the interaction of these objects. For developers, a thorough understanding of these relationships is paramount, and often, it forms the basis for a system's development.

Product Details

ISBN-13: 9780072224368
Publisher: McGraw-Hill/Osborne Media
Publication date: 07/24/2002
Series: One-Off
Pages: 377
Product dimensions: 7.42(w) x 9.38(h) x 0.89(d)

Table of Contents

Acknowledgmentsxvii
Introductionxix
Part IOverview of the W3C Document Object Model
Chapter 1Introduction to the DOM3
What Is the Document Object Model?4
The DOM Philosophy6
Yet Another Standard?6
Design Philosophy7
Object-Oriented vs. Flat Views of the DOM Interfaces7
History of the DOM8
The DOM on the Client8
The DOM on the Server9
Levels of the DOM9
Level 110
Level 211
Level 312
Conventions Used in the DOM Specification12
What the DOM Isn't14
Conclusion15
Chapter 2How the DOM Represents Structured Documents17
Basic DOM Data Types18
The DOMString Type18
The DOMTimeStamp Type19
Handling Errors: The DOMException Interface19
The Document Tree Structure20
DOM Node Types22
The Fundamental Core DOM Interfaces24
DOMException Codes25
The DOM Node Interface26
Node Helper Interfaces: NodeList and NamedNodeMap31
The DOMImplementation Interface33
The Document Interface34
The DocumentFragment Interface37
The Element Interface37
The Attr Interface40
The CharacterData Interface41
The Comment Interface43
The Text Interface43
The Extended Core Interfaces44
CDATASection Interface44
DocumentType Interface44
Notation Interface45
Entity Interface46
EntityReference Interface46
ProcessingInstruction Interface46
Conclusion47
Chapter 3Navigating and Manipulating Structured Documents49
Working with Nodes50
A Word About Namespaces51
Obtaining Object References to Nodes52
Inspecting Nodes53
Manipulating Nodes56
Creating New Nodes62
Importing Nodes from Other Documents65
Traversing Documents67
Using the Node Interface Properties67
Using the DOM Level 2 Traversal Module68
Conclusion84
Part IIReal-World DOM
Chapter 4Algorithms87
DOM Algorithms88
Basic Node Traversal Algorithms88
Position-Based Algorithms91
Determining Whether a Node Has an Ancestor of a Given Type91
Determining Whether a Node Has a Sibling of a Given Type92
Content-Based Algorithms93
Determining Whether a Node Contains Another Node93
Better Versions of Node Interfaces: Retrieving Relative Nodes by Type95
Finding a Node by Attribute Value97
Conclusion99
Chapter 5Browsers101
DOM Support in the Major Browsers102
Microsoft Internet Explorer 6103
Netscape Navigator 6.x103
Opera 6104
Using the DOM in a Browser Environment104
Obtaining a Reference to the Document105
Examining the Structure and Content of a Page106
Creating and Modifying Page Elements110
Handling Events with the DOM Level 2 Events Interface116
Internet Explorer--Specific Methods and Properties127
Internet Explorer--Specific Properties127
Internet Explorer--Specific Methods128
Browser Quirks129
Internet Explorer130
Netscape Navigator130
Conclusion130
Chapter 6Applications133
DOM Implementations Aren't Just for Browsers134
Standalone vs. Embedded DOM Implementations135
The Apache Xerces Parser135
Where to Get Xerces136
Installing Xerces137
Getting to Know the API139
Using Xerces141
Where to Get More Information About Xerces152
The Microsoft MSXML Parser152
Where to Get MSXML4152
Installing MSXML4152
Getting to Know the API153
Using MSXML4153
Where to Get More Information About MSXML159
Macromedia Dreamweaver159
Where to Get Dreamweaver159
The DOM in Dreamweaver159
Getting to Know the API160
Using the Dreamweaver DOM162
Where to Get More Information About the Dreamweaver DOM167
Conclusion167
Chapter 7Debugging DOM Applications169
Importance of Good Debugging Skills170
Be Assertive: Use ASSERT()171
Defining ASSERT()171
Using ASSERT() Effectively173
Getting Fancy with ASSERT()177
Tracing Your Steps with TraceConsole179
Using the TraceConsole181
The TraceConsole Functions182
The DOMDumper192
DOMDumper Output193
DOMDumper Code195
Using the DOMDumper198
Conclusion201
Part IIIPractical Uses of the DOM
Chapter 8Providing Automatic Document Navigation205
Using the DOM to Provide Better Document Navigation206
Example: On-the-Fly Bookmarks207
Setting Up210
Creating the User Interface Elements211
Building the Bookmark List212
Inserting the Bookmark List into the Document213
Responding to the User's Bookmark Selection214
Example: Automatic Table of Contents215
Setting Up218
Scanning the Document's Nodes219
Building a TOC Destination219
Adding the TOC Entry220
Example: Document Placeholders221
Setting Up224
Handling Click Events225
Finding a Containing Paragraph Node226
Conclusion227
Chapter 9Dynamic User Interfaces229
Building Dynamic User Interfaces with the DOM230
Creating a Color Picker231
In-Place List Editing238
DOM-Based Pop-up Menus246
Conclusion254
Chapter 10Client Processing of Data-Driven Documents255
Processing Data-Driven Documents on the Client256
Client-Side Sorting257
Sorting a List257
Sorting a Table263
Post-Processing Server-Generated Documents271
Working with Embedded XML Data in Web Pages275
Data Islands in Internet Explorer276
Data Islands in Netscape Navigator281
Example: Joe's Cafe Menu Application283
The Menu Page283
The Menu XML Code285
Generating the Menu HTML287
Handling User Interaction295
Conclusion299
Chapter 11Future Directions for the DOM301
Where Is the DOM Headed?302
Proposed Changes in DOM Level 3303
General Changes303
Abstract Schema Support307
Error Handling308
Loading and Saving DOM Documents309
Attaching Application-Specific Data to Nodes313
Determining Relative Document Positions of Nodes316
XPath Support318
Other Potential Future DOM Enhancements326
XSLT Support in the DOM326
Transaction-Oriented Processing332
Conclusion334
AppendixDOM Core Level 1 API Reference337
DOM Interface Inheritance Tree338
Interface Attr338
Properties339
Methods339
Interface CDATA339
Properties340
Methods340
Interface CharacterData340
Properties340
Methods341
Interface Comment343
Properties343
Methods343
Interface Document343
Properties343
Methods344
Interface DocumentFragment347
Properties347
Methods347
Interface DocumentType347
Properties348
Methods348
Interface DOMImplementation348
Properties349
Methods349
Interface DOMException349
Constants349
Properties350
Methods350
Interface Element350
Properties350
Methods350
Interface Entity353
Properties353
Methods354
Interface EntityReference354
Properties354
Methods354
Interface NamedNodeMap354
Properties355
Methods355
Interface Node356
Constants357
Properties357
Methods359
Interface NodeList361
Properties361
Methods362
Interface Natation362
Properties362
Methods363
Interface ProcessingInstruction363
Properties363
Methods363
Interface Text363
Properties364
Methods364
Index365
From the B&N Reads Blog

Customer Reviews