|
1
|
- And its Role for Application Development
|
|
2
|
- The need for a Document Object Model
- Brief explanation of the DOM model
- DOM and the system architecture
- Pros and Cons of the DOM model
- Decision Criteria
|
|
3
|
- Broad view
- Product definition
- Specifications …
- Implementation
- Product Life Cycle
- Narrow view
- Application Implementation
- Software Engineering Part
- Source Code Generation
- Product Definition
- Product Requirements
- Application Specification
- System Design
- System Architecture
- System Definition
- Functional Specification
- Implementation
- Maintenance
|
|
4
|
- Pre SGML era
- WinWord, RTF, AmiPro, MIF, Ventura Publisher, …
- Hard to reuse for developers
- Converter writing was/is an “art” – lack of documentation, proprietary
interfaces
- SGML/XML era:
- (X)HTML, DHTML, XML
- Support for scripting languages in dynamic web pages
- Document generation / production / publishing
- XML standards
- Science - Math XML, Astronomy …
- Publishing, technical documentation, DocBook
- Translation
- Data centric vs document centric XML
- Information exchange/control in and between applications
- Application control through ini/properties File
- Internet
- – http - enabled applications
- XML-RPC
- WebDAV
- SOAP, UDDI, OWL, WSDL, RDF …
- Tomcat - servlets
|
|
5
|
- Acronym: “Document Object Model”
- „The Document Object Model is a platform- and language-neutral
interface that will allow programs and scripts to dynamically access
and update the content, structure and style of documents. ...“
- The Document Object Model (DOM) is an application programming interface
(API) for valid HTML and well-formed XML documents. It defines the
logical structure of documents and the way a document is accessed and
manipulated.
- W3C - http://www.w3.org/DOM/
- Initially as tool for modeling for DHTML in browsers
- Several Levels
- 1 – 3
- Current Working Draft: DOM Level 3
|
|
6
|
- The DOM kernel is a set of APIs (definitions)
- Not an implementation
- Defined using IDL (OMG)
- Different programming languages need to realize those API definitions
- Provides an object-based interface
- Tree based
- In contrast to an event-based ones like SAX (Simple API for XML)
- DOM interface is specified in several modules
- Suppliers may support only some modules
- This is important when choosing a specific implementation!
|
|
7
|
|
|
8
|
- Represents the XML document as a tree based data structure
- One step parsing
- Whole XML document is kept in main memory
- Allows “(randomly) accessing/manipulating” of XML documents
- In contrast to other models like SAX
- Parser realizes the DOM model for applications
|
|
9
|
- Editors
- Tools which edit XML documents
- Web Browsers
- Publishing Tools
- Internet enabled applications
- Servlet Engines
- Configuration Management
- GUI Building
|
|
10
|
- XML logic is part of the application logic
|
|
11
|
- XML logic is separated using a DOM parser and API methods from the
application logic
|
|
12
|
- Standard
- No need to write own parser and complex data structures to hold the xml
data
- Easy to implement
- Several alternative implementations available for different programming
languages
- Immediate access to different parts of the document
- Memory Usage
- Computational efficiency
- Persistence needs to be handled manually
- Use of db’s like eXist, Xindice, Tamino
- Level 3 ?
|
|
13
|
- Dealing mainly with document or data centric XML objects?
- Address book, databases vs. technical documentation, articles, books
- Ideal for document centric applications
- Document size; > 10 MB??
- Complex DTD / XML data?
- For simple restricted data centric XML use SAX, JDOM, regular
expressions …
- Mixed content support
- Support of XML Schema required?
|
|
14
|
- Direct access to the various document parts needed?
- Choose DOM
- Random access to all document elements
- For sequential access SAX is more efficient
- Manipulating XML document?
- Use DOM
- Supports creating / changing content
|
|
15
|
- Intended document size supported?
- May require tests
- Dependency on main memory available
- Server / client architecture?
- “deferred DOM”
- PDOM as a commercial alternative (Infonyte)
- Necessity to handle huge documents or several documents at a time?
- May require a lot of memory if several documents are loaded at the same
time
- Example: Diff’s between several documents
|
|
16
|
- How is the DOM object serialized?
- Approaches
- DOM Level 3
- Simple file
- DB APIs
- XML databases
- Xindice
- eXist
- Tamino
- Relational databases …
|
|
17
|
- Availability for several programming languages
- Strength of DOM
- Xerces: Java, C++, Perl
- Java Script
- Through browsers – mostly built-in
- Java
- Many Open Source projects
- C++, C
- Perl
- Visual Basic
- …
|
|
18
|
- DOM is popular for scripting languages
- JavaScript, web sites
- built-in
- Performance
- DOM is not as memory / time efficient as SAX
|
|
19
|
- Which parser is used?
- Which level and modules are supported by a specific parser?
|
|
20
|
- Intuitive (tree based) standard model for document centric applications
- Object oriented representation
- Makes writing re-usable / multi-usable documents for application writing
a reality
- Simple way to access XML document structures
- Writing own parsers is complex
- Basic document model and access functions
- Based on a Component Approach
- Simply exchange the DOM parsers
- Internet enabled applications
- Greatly simplifies writing XML based applications
|