1 Document Object Model (DOM) MV4920 – XML 24 September 2001 Simon R. Goerger MAJ, US Army

Slides:



Advertisements
Similar presentations
Copyright © 2003 Pearson Education, Inc. Slide 8-1 Created by Cheryl M. Hughes, Harvard University Extension School Cambridge, MA The Web Wizards Guide.
Advertisements

JAXB Java Architecture for XML Binding Andy Fanton Khalid AlBayat.
XML Parsing Using Java APIs AIP Independence project Fall 2010.
Chapter Concepts Review Markup Languages
ModelicaXML A Modelica XML representation with Applications Adrian Pop, Peter Fritzson Programming Environments Laboratory Linköping University.
©Silberschatz, Korth and Sudarshan10.1Database System Concepts W3C Activities HTML: is the lingua franca for publishing on the Web XHTML: an XML application.
Introduction to SVG & Batik Presented by Shang-Ming Huang.
Supervised by Prof. LYU, Rung Tsong Michael Department of Computer Science & Engineering The Chinese University of Hong Kong Prepared by: Chan Pik Wah,
XML DOM and SAX Parsers By Omar RABI. Introduction to parsers  The word parser comes from compilers  In a compiler, a parser is the module that reads.
XML A brief introduction ---by Yongzhu Li. XML --- a brief introduction 2 CSI668 Topics in System Architecture SUNY Albany Computer Science Department.
CS 898N – Advanced World Wide Web Technologies Lecture 15: Dynamic HTML Chin-Chih Chang
Chapter 14 Database Connectivity and Web Technologies
W3C Activities HTML: is the lingua franca for publishing on the Web XHTML: an XML application with a clean migration path from HTML 4.01 CSS: Style sheets.
September 15, 2003Houssam Haitof1 XSL Transformation Houssam Haitof.
1st Project Introduction to HTML.
XP New Perspectives on Microsoft Access 2002 Tutorial 71 Microsoft Access 2002 Tutorial 7 – Integrating Access With the Web and With Other Programs.
HTML 1 Introduction to HTML. 2 Objectives Describe the Internet and its associated key terms Describe the World Wide Web and its associated key terms.
Chapter ONE Introduction to HTML.
The Document Object Model (DOM) & Asynchronous Javascript And XML (AJAX) : an introduction UFCEKG-20-2 : Data, Schemas and Applications.
DHTML. What is DHTML?  DHTML is the combination of several built-in browser features in fourth generation browsers that enable a web page to be more.
INTRODUCTION TO DHTML. TOPICS TO BE DISCUSSED……….  Introduction Introduction  UsesUses  ComponentsComponents  Difference between HTML and DHTMLDifference.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Creating a Basic Web Page
XML eXtensible Markup Language by Darrell Payne. Experience Logicon / Sterling Federal C, C++, JavaScript/Jscript, Shell Script, Perl XML Training XML.
XP New Perspectives on XML, 2 nd Edition Tutorial 10 1 WORKING WITH THE DOCUMENT OBJECT MODEL TUTORIAL 10.
Lecture 2 : Understanding the Document Object Model (DOM) UFCFR Advanced Topics in Web Development II 2014/15 SHAPE Hong Kong.
Chapter 1 Understanding the Web Design Environment Principles of Web Design, 4 th Edition.
ITCS 6010 SALT. Speech Application Language Tags (SALT) Speech interface markup language Extension of HTML and other markup languages Adds speech and.
Working with Objects Creating a Dynamic Web Page.
HTML, XHTML, and CSS Sixth Edition Chapter 1 Introduction to HTML, XHTML, and CSS.
Intro. to XML & XML DB Bun Yue Professor, CS/CIS UHCL.
Working with the XML Document Object Model ©NIITeXtensible Markup Language/Lesson 7/Slide 1 of 44 Objectives In this lesson, you will learn to: *Identify.
XML A web enabled data description language 4/22/2001 By Mark Lawson & Edward Ryan L’Herault.
Web Services for Satellite Emulation Development Kathy J. LiszkaAllen P. Holtz The University of AkronNASA Glenn Research Center.
WEB BASED DATA TRANSFORMATION USING XML, JAVA Group members: Darius Balarashti & Matt Smith.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Scripting with the DOM Ellen Pearlman Eileen Mullin Programming the Web.
Sheet 1XML Technology in E-Commerce 2001Lecture 3 XML Technology in E-Commerce Lecture 3 DOM and SAX.
Building Rich Web Applications with Ajax Linda Dailey Paulson IEEE – Computer, October 05 (Vol.38, No.10) Presented by Jingming Zhang.
Introduction to XML This presentation covers introductory features of XML. What XML is and what it is not? What does it do? Put different related technologies.
Introduction to Programming the WWW I CMSC Winter 2003 Lecture 10.
1 Dr Alexiei Dingli XML Technologies SAX and DOM.
SDPLNotes 3.2: DOM1 3.2 Document Object Model (DOM) n How to provide uniform access to structured documents in diverse applications (parsers, browsers,
User Profiling using Semantic Web Group members: Ashwin Somaiah Asha Stephen Charlie Sudharshan Reddy.
Kemal Baykal Rasim Ismayilov
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 4 1COMP9321, 15s2, Week.
TOPIC II Dynamic HTML Prepared by: Nimcan Cabd Cali.
Architecture View Models A model is a complete, simplified description of a system from a particular perspective or viewpoint. There is no single view.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Plug-in Architectures Presented by Truc Nguyen. What’s a plug-in? “a type of program that tightly integrates with a larger application to add a special.
©Silberschatz, Korth and Sudarshan10.1Database System Concepts W3C - The World Wide Web Consortium W3C - The World Wide Web Consortium.
HTML Concepts and Techniques Fifth Edition Chapter 1 Introduction to HTML.
Chapter 1 Introduction to HTML, XHTML, and CSS HTML5 & CSS 7 th Edition.
XML DOM  XML Document Object Model provides a robust international standard for XML Documents.  DOM Level 1 is a Dec 11, 1998 W3C recommendation.  XML.
Ganga/Dirac Data Management meeting October 2003 Gennady Kuznetsov Production Manager Tools and Ganga (New Architecture)
XML DOM Week 11 Web site:
I Copyright © 2004, Oracle. All rights reserved. Introduction.
1 Survey of Profiles from Other Domains XMSF Profile SG 13 January 2004 Curt Blais and NPS MV3250 (Introduction to XML, 1st Quarter 2005) Katherine L.
HTML PROJECT #1 Project 1 Introduction to HTML. HTML Project 1: Introduction to HTML 2 Project Objectives 1.Describe the Internet and its associated key.
DHTML.
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
4.01B Authoring Languages and Web Authoring Software
Chapter 1 Introduction to HTML.
Sabri Kızanlık Ural Emekçi
Project 1 Introduction to HTML.
Prepared for Md. Zakir Hossain Lecturer, CSE, DUET Prepared by Miton Chandra Datta
Week 11 Web site: XML DOM Week 11 Web site:
4.01B Authoring Languages and Web Authoring Software
Introduction to Programming the WWW I
Why use Web Standards?.
XML DOM and CSS Instructors: Geoffrey Fox and Bryan Carpenter
Presentation transcript:

1 Document Object Model (DOM) MV4920 – XML 24 September 2001 Simon R. Goerger MAJ, US Army

Outline Goal DOM Description DOM Basics Tree Levels DOM Examples DOM Demo DOM Resources Summary

Goal The goal of the DOM group is to define a programmatic interface for XML and HTML.

What is a DOM? Document Object Model (DOM) A programming interface for XML documents It defines the way an XML document can be accessed and manipulated. 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 can be further processed and the results of that processing can be incorporated back into the presented page.

What a DOM is NOT Although the Document Object Model was strongly influenced by "Dynamic HTML", in Level 1, it does not implement all of "Dynamic HTML". In particular, events have not yet been defined. Level 1 is designed to lay a firm foundation for this kind of functionality by providing a robust, flexible model of the document itself. The Document Object Model is not a binary specification. DOM programs written in the same language will be source code compatible across platforms, but the DOM does not define any form of binary interoperability. The Document Object Model is not a way of persisting objects to XML or HTML. Instead of specifying how objects may be represented in XML, the DOM specifies how XML and HTML documents are represented as objects, so that they may be used in object oriented programs.

What a DOM is NOT The Document Object Model is not a set of data structures, it is an object model that specifies interfaces. Although this document contains diagrams showing parent/child relationships, these are logical relationships defined by the programming interfaces, not representations of any particular internal data structures. The Document Object Model does not define "the true inner semantics" of XML or HTML. The semantics of those languages are defined by W3C Recommendations for these languages. The DOM is a programming model designed to respect these semantics. The DOM does not have any ramifications for the way you write XML and HTML documents; any document that can be written in these languages can be represented in the DOM.

What a DOM is NOT The Document Object Model, despite its name, is not a competitor to the Component Object Model (COM). COM, like CORBA, is a language independent way to specify interfaces and objects; the DOM is a set of interfaces and objects designed for managing HTML and XML documents. The DOM may be implemented using language-independent systems like COM or CORBA; it may also be implemented using language-specific bindings like the Java or ECMAScript bindings specified in this document.

What can a DOM do? With the XML DOM, a programmer can create an XML document, navigate its structure, and add, modify, or delete its elements.

DOM Tree The DOM represents a tree view of the XML document. The documentElement is the top-level of the tree. This element has one or many childNodes that represent the branches of the tree.

Why the Document Object Model? "Dynamic HTML" is a term used by some vendors to describe the combination of HTML, style sheets and scripts that allows documents to be animated. The W3C has received several submissions from members companies on the way in which the object model of HTML documents should be exposed to scripts. These submissions do not propose any new HTML tags or style sheet technology. The W3C DOM WG is working hard to make sure interoperable and scripting-language neutral solutions are agreed upon.

DOM Level (Architecture) The DOM is separated into three parts: Core, HTML, and XML. The Core DOM provides a low-level set of objects that can represent any structured document. While by itself this interface is capable of representing any HTML or XML document, the core interface is a compact and minimal design for manipulating the document's contents. Depending upon the DOM's usage, the core DOM interface may not be convenient or appropriate for all users. The HTML and XML specifications provide additional, higher-level interfaces that are used with the core specification to provide a more convenient view into the document. These specifications consist of objects and methods that provide easier and more direct access into the specific types of documents.

DOM Level (Architecture) The DOM Architecture is divided in four module levels. Each module addresses or specializes an existing module for a particular domain. Domains covered by the current DOM API are XML, HTML, CSS, and events. DOM Level 0 Functionality equivalent to that exposed in Netscape Navigator 3.0 and Microsoft Internet Explorer 3.0 is referred to as "Level 0". There is no W3C specification for this Level.

DOM Level 1 (Architecture) DOM Level 1 The first Level of the DOM specifications (DOM Level 1) was completed in October Level 1 provides support for XML 1.0 and HTMLDOM Level 1XML 1.0HTML

DOM Level 2 (Architecture) DOM Level 2 The second Level of the DOM specifications (DOM Level 2) was completed in November Level 2 extends Level 1 with support for XML 1.0 with namespaces and adds supports for Cascading Style Sheets (CSS), events (user interface events and tree manipulation events), and enhances tree manipulations (tree ranges and traversal mechanisms).DOM Level 2 namespacesCascading Style Sheets

DOM Level 3 (Architecture) DOM Level 3 The third Level of the DOM specifications, DOM Level 3, is under development. Level 3 will extend Level 2 by finishing support for XML 1.0 with namespaces (alignment with the XML Infoset and support for XML Base) and will extend the user interface events (keyboard). It will also add abstract schemas support (for DTDs, XML Schema,...), the ability to load and save a document or an abstract schema, explore further mixed markup vocabularies and the implications on the DOM API ("Embedded DOM"), and will support XPath.DOM Level 3XML InfosetXML BaseDTDsXML Schema XPath

DOM Level Future Further Levels. These may specify some interface with the possibly underlying window system, including some ways to prompt the user. They may also contain a query language interface, and address multithreading and synchronization, security, and repository.

Example Simple example of DOM usage (input) DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance (); documentBuilderFactory.setNamespaceAware (true); documentBuilderFactory.setValidating (true); DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder (); Document document = documentBuilder.newDocument (); try { document = documentBuilder.parse (fileName); } // end try catch (Exception badParse) { … }

Example Simple example of DOM usage (output) Writer writer = new OutputStreamWriter(file); switch (node.getNodeType()) { case Node.CDATA_SECTION_NODE: writer.write ("<![CDATA[" + node.getNodeValue() + "]]>\n"); break; } // end switch

Demo Problem: read incomplete XML document, merge with DTD to identify missing attributes, read directory structure to locate information to update default values, and output new XML document with updates. Demo XMLtoDOMtoXML.bat XML Document DTD Document DOM Directories (access with Java code) Updated Dom Updated XML Document

Resources Some resources related to the DOM are to be found at Robin Cover's DOM pages the Open Directory Project W3C DOM pages Directory Project W3C DOM pages Some related DOM-based APIs are being developed as well, for example in the specifications for Mathematical Markup Language Markup Language Scalable Vector Graphics Vector Graphics Synchronized Multimedia Integration Language Multimedia Integration Language NOTE: Placing the following *.jar files from JAXP in your jdk*.*.*/jre/lib/ext directory, maybe required for use of the DOM: crimson.jar, jaxp.jar, and xalan.jar

Summary DOM is a programming interface for XML documents that defines the way an XML document can be accessed and manipulated.