Cover image for Document object model : processing structured documents
Title:
Document object model : processing structured documents
Personal Author:
Publication Information:
New York : McGraw-Hill/Osborne, 2002
ISBN:
9780072224368

Available:*

Library
Item Barcode
Call Number
Material Type
Item Category 1
Status
Searching...
30000010019057 TK5105.888 M36 2002 Open Access Book Book
Searching...

On Order

Summary

Summary

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.


Author Notes

Joe Marini is a senior engineer at Panscopic Corporation


Table of Contents

Acknowledgmentsp. xvii
Introductionp. xix
Part I Overview of the W3C Document Object Model
Chapter 1 Introduction to the DOMp. 3
What Is the Document Object Model?p. 4
The DOM Philosophyp. 6
Yet Another Standard?p. 6
Design Philosophyp. 7
Object-Oriented vs. Flat Views of the DOM Interfacesp. 7
History of the DOMp. 8
The DOM on the Clientp. 8
The DOM on the Serverp. 9
Levels of the DOMp. 9
Level 1p. 10
Level 2p. 11
Level 3p. 12
Conventions Used in the DOM Specificationp. 12
What the DOM Isn'tp. 14
Conclusionp. 15
Chapter 2 How the DOM Represents Structured Documentsp. 17
Basic DOM Data Typesp. 18
The DOMString Typep. 18
The DOMTimeStamp Typep. 19
Handling Errors: The DOMException Interfacep. 19
The Document Tree Structurep. 20
DOM Node Typesp. 22
The Fundamental Core DOM Interfacesp. 24
DOMException Codesp. 25
The DOM Node Interfacep. 26
Node Helper Interfaces: NodeList and NamedNodeMapp. 31
The DOMImplementation Interfacep. 33
The Document Interfacep. 34
The DocumentFragment Interfacep. 37
The Element Interfacep. 37
The Attr Interfacep. 40
The CharacterData Interfacep. 41
The Comment Interfacep. 43
The Text Interfacep. 43
The Extended Core Interfacesp. 44
CDATASection Interfacep. 44
DocumentType Interfacep. 44
Notation Interfacep. 45
Entity Interfacep. 46
EntityReference Interfacep. 46
ProcessingInstruction Interfacep. 46
Conclusionp. 47
Chapter 3 Navigating and Manipulating Structured Documentsp. 49
Working with Nodesp. 50
A Word About Namespacesp. 51
Obtaining Object References to Nodesp. 52
Inspecting Nodesp. 53
Manipulating Nodesp. 56
Creating New Nodesp. 62
Importing Nodes from Other Documentsp. 65
Traversing Documentsp. 67
Using the Node Interface Propertiesp. 67
Using the DOM Level 2 Traversal Modulep. 68
Conclusionp. 84
Part II Real-World DOM
Chapter 4 Algorithmsp. 87
DOM Algorithmsp. 88
Basic Node Traversal Algorithmsp. 88
Position-Based Algorithmsp. 91
Determining Whether a Node Has an Ancestor of a Given Typep. 91
Determining Whether a Node Has a Sibling of a Given Typep. 92
Content-Based Algorithmsp. 93
Determining Whether a Node Contains Another Nodep. 93
Better Versions of Node Interfaces: Retrieving Relative Nodes by Typep. 95
Finding a Node by Attribute Valuep. 97
Conclusionp. 99
Chapter 5 Browsersp. 101
DOM Support in the Major Browsersp. 102
Microsoft Internet Explorer 6p. 103
Netscape Navigator 6.xp. 103
Opera 6p. 104
Using the DOM in a Browser Environmentp. 104
Obtaining a Reference to the Documentp. 105
Examining the Structure and Content of a Pagep. 106
Creating and Modifying Page Elementsp. 110
Handling Events with the DOM Level 2 Events Interfacep. 116
Internet Explorer--Specific Methods and Propertiesp. 127
Internet Explorer--Specific Propertiesp. 127
Internet Explorer--Specific Methodsp. 128
Browser Quirksp. 129
Internet Explorerp. 130
Netscape Navigatorp. 130
Conclusionp. 130
Chapter 6 Applicationsp. 133
DOM Implementations Aren't Just for Browsersp. 134
Standalone vs. Embedded DOM Implementationsp. 135
The Apache Xerces Parserp. 135
Where to Get Xercesp. 136
Installing Xercesp. 137
Getting to Know the APIp. 139
Using Xercesp. 141
Where to Get More Information About Xercesp. 152
The Microsoft MSXML Parserp. 152
Where to Get MSXML4p. 152
Installing MSXML4p. 152
Getting to Know the APIp. 153
Using MSXML4p. 153
Where to Get More Information About MSXMLp. 159
Macromedia Dreamweaverp. 159
Where to Get Dreamweaverp. 159
The DOM in Dreamweaverp. 159
Getting to Know the APIp. 160
Using the Dreamweaver DOMp. 162
Where to Get More Information About the Dreamweaver DOMp. 167
Conclusionp. 167
Chapter 7 Debugging DOM Applicationsp. 169
Importance of Good Debugging Skillsp. 170
Be Assertive: Use ASSERT()p. 171
Defining ASSERT()p. 171
Using ASSERT() Effectivelyp. 173
Getting Fancy with ASSERT()p. 177
Tracing Your Steps with TraceConsolep. 179
Using the TraceConsolep. 181
The TraceConsole Functionsp. 182
The DOMDumperp. 192
DOMDumper Outputp. 193
DOMDumper Codep. 195
Using the DOMDumperp. 198
Conclusionp. 201
Part III Practical Uses of the DOM
Chapter 8 Providing Automatic Document Navigationp. 205
Using the DOM to Provide Better Document Navigationp. 206
Example: On-the-Fly Bookmarksp. 207
Setting Upp. 210
Creating the User Interface Elementsp. 211
Building the Bookmark Listp. 212
Inserting the Bookmark List into the Documentp. 213
Responding to the User's Bookmark Selectionp. 214
Example: Automatic Table of Contentsp. 215
Setting Upp. 218
Scanning the Document's Nodesp. 219
Building a TOC Destinationp. 219
Adding the TOC Entryp. 220
Example: Document Placeholdersp. 221
Setting Upp. 224
Handling Click Eventsp. 225
Finding a Containing Paragraph Nodep. 226
Conclusionp. 227
Chapter 9 Dynamic User Interfacesp. 229
Building Dynamic User Interfaces with the DOMp. 230
Creating a Color Pickerp. 231
In-Place List Editingp. 238
DOM-Based Pop-up Menusp. 246
Conclusionp. 254
Chapter 10 Client Processing of Data-Driven Documentsp. 255
Processing Data-Driven Documents on the Clientp. 256
Client-Side Sortingp. 257
Sorting a Listp. 257
Sorting a Tablep. 263
Post-Processing Server-Generated Documentsp. 271
Working with Embedded XML Data in Web Pagesp. 275
Data Islands in Internet Explorerp. 276
Data Islands in Netscape Navigatorp. 281
Example: Joe's Cafe Menu Applicationp. 283
The Menu Pagep. 283
The Menu XML Codep. 285
Generating the Menu HTMLp. 287
Handling User Interactionp. 295
Conclusionp. 299
Chapter 11 Future Directions for the DOMp. 301
Where Is the DOM Headed?p. 302
Proposed Changes in DOM Level 3p. 303
General Changesp. 303
Abstract Schema Supportp. 307
Error Handlingp. 308
Loading and Saving DOM Documentsp. 309
Attaching Application-Specific Data to Nodesp. 313
Determining Relative Document Positions of Nodesp. 316
XPath Supportp. 318
Other Potential Future DOM Enhancementsp. 326
XSLT Support in the DOMp. 326
Transaction-Oriented Processingp. 332
Conclusionp. 334
Appendix DOM Core Level 1 API Referencep. 337
DOM Interface Inheritance Treep. 338
Interface Attrp. 338
Propertiesp. 339
Methodsp. 339
Interface CDATAp. 339
Propertiesp. 340
Methodsp. 340
Interface CharacterDatap. 340
Propertiesp. 340
Methodsp. 341
Interface Commentp. 343
Propertiesp. 343
Methodsp. 343
Interface Documentp. 343
Propertiesp. 343
Methodsp. 344
Interface DocumentFragmentp. 347
Propertiesp. 347
Methodsp. 347
Interface DocumentTypep. 347
Propertiesp. 348
Methodsp. 348
Interface DOMImplementationp. 348
Propertiesp. 349
Methodsp. 349
Interface DOMExceptionp. 349
Constantsp. 349
Propertiesp. 350
Methodsp. 350
Interface Elementp. 350
Propertiesp. 350
Methodsp. 350
Interface Entityp. 353
Propertiesp. 353
Methodsp. 354
Interface EntityReferencep. 354
Propertiesp. 354
Methodsp. 354
Interface NamedNodeMapp. 354
Propertiesp. 355
Methodsp. 355
Interface Nodep. 356
Constantsp. 357
Propertiesp. 357
Methodsp. 359
Interface NodeListp. 361
Propertiesp. 361
Methodsp. 362
Interface Natationp. 362
Propertiesp. 362
Methodsp. 363
Interface ProcessingInstructionp. 363
Propertiesp. 363
Methodsp. 363
Interface Textp. 363
Propertiesp. 364
Methodsp. 364
Indexp. 365