12-07-2012, 11:08 AM
Document Object Model
dom presentatn.pptx (Size: 173.69 KB / Downloads: 38)
Introduction
DOM are standards for XML parsers--program APIs to read and interpret XML files
DOM is a W3C standard
An object-based, language-neutral API for XML and HTML documents
Allows programs and scripts to build documents, navigate their structure, add, modify or delete elements and content
Provides a foundation for developing querying, filtering, transformation, rendering etc. applications on top of DOM implementations
Structure of Dom-Level 1
DOM Core Interfaces
Fundamental interfaces
basic interfaces to structured documents
Extended interfaces
XML specific: CDATASection, DocumentType, Notation, Entity, EntityReference, ProcessingInstruction
II: DOM HTML Interfaces
more convenient to access HTML documents
(we ignore these)
Preorder Traversal
The DOM is stored in memory as a tree
An easy way to traverse a tree is in preorder
You should remember how to do this from your course in Data Structures
The general form of a preorder traversal is:
Visit the root
Traverse each subtree, in order