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

Slides:



Advertisements
Similar presentations
1 eXtensible Markup Language. XML is based on SGML: Standard Generalized Markup Language HTML and XML are both based on SGML 2 SGML HTMLXML.
Advertisements

Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Introduction to XHTML Programming the World Wide Web Fourth edition.
1
1 Copyright © 2002 Pearson Education, Inc.. 2 Chapter 2 Getting Started.
Copyright © 2003 Pearson Education, Inc. Slide 7-1 Created by Cheryl M. Hughes, Harvard University Extension School Cambridge, MA The Web Wizards Guide.
Copyright © 2003 Pearson Education, Inc. Slide 3-1 Created by Cheryl M. Hughes The Web Wizards Guide to XML by Cheryl M. Hughes.
© 2008 Pearson Addison Wesley. All rights reserved Chapter Seven Costs.
Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
Copyright © 2003 Pearson Education, Inc. Slide 5-1 Created by Cheryl M. Hughes The Web Wizards Guide to XML by Cheryl M. Hughes.
Copyright © 2003 Pearson Education, Inc. Slide 4-1 Created by Cheryl M. Hughes, Harvard University Extension School Cambridge, MA The Web Wizards Guide.
Copyright © 2003 Pearson Education, Inc. Slide 6-1 Created by Cheryl M. Hughes, Harvard University Extension School Cambridge, MA The Web Wizards Guide.
Copyright © 2003 Pearson Education, Inc. Slide 7-1 Created by Cheryl M. Hughes The Web Wizards Guide to XML by Cheryl M. Hughes.
Chapter 1 The Study of Body Function Image PowerPoint
BASIC SKILLS AND TOOLS USING ACCESS
Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 6 Author: Julia Richards and R. Scott Hawley.
Author: Julia Richards and R. Scott Hawley
1 Copyright © 2013 Elsevier Inc. All rights reserved. Appendix 01.
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 3 CPUs.
Properties Use, share, or modify this drill on mathematic properties. There is too much material for a single class, so you’ll have to select for your.
UNITED NATIONS Shipment Details Report – January 2006.
Document #07-2I RXQ Customer Enrollment Using a Registration Agent (RA) Process Flow Diagram (Move-In) (mod 7/25 & clean-up 8/20) Customer Supplier.
18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services.
Library 1 Electronic Resources in the EUI Library Veerle Deckmyn, Library Director Aimee Glassel, Electronic Resources Librarian September 2, 2009.
Introduction to HTML, XHTML, and CSS
Properties of Real Numbers CommutativeAssociativeDistributive Identity + × Inverse + ×
Exit a Customer Chapter 8. Exit a Customer 8-2 Objectives Perform exit summary process consisting of the following steps: Review service records Close.
Create an Application Title 1D - Dislocated Worker Chapter 9.
Create an Application Title 1A - Adult Chapter 3.
Custom Statutory Programs Chapter 3. Customary Statutory Programs and Titles 3-2 Objectives Add Local Statutory Programs Create Customer Application For.
FACTORING ax2 + bx + c Think “unfoil” Work down, Show all steps.
10. Juni 1998reto ambühler ( WELCOME TO THE GATHERING PLACE.
1 Click here to End Presentation Software: Installation and Updates Internet Download CD release NACIS Updates.
Solve Multi-step Equations
REVIEW: Arthropod ID. 1. Name the subphylum. 2. Name the subphylum. 3. Name the order.
EU market situation for eggs and poultry Management Committee 20 October 2011.
Microsoft Access.
EIS Bridge Tool and Staging Tables September 1, 2009 Instructor: Way Poteat Slide: 1.
XML and Databases Exercise Session 3 (courtesy of Ghislain Fourny/ETH)
VOORBLAD.
Copyright © 2013, 2009, 2006 Pearson Education, Inc.
Copyright © 2012, Elsevier Inc. All rights Reserved. 1 Chapter 7 Modeling Structure with Blocks.
Factor P 16 8(8-5ab) 4(d² + 4) 3rs(2r – s) 15cd(1 + 2cd) 8(4a² + 3b²)
Basel-ICU-Journal Challenge18/20/ Basel-ICU-Journal Challenge8/20/2014.
1..
1/7 ITApplications XML Module Session 8: Introduction to Programming with XML.
CONTROL VISION Set-up. Step 1 Step 2 Step 3 Step 5 Step 4.
© 2012 National Heart Foundation of Australia. Slide 2.
Understanding Generalist Practice, 5e, Kirst-Ashman/Hull
Model and Relationships 6 M 1 M M M M M M M M M M M M M M M M
25 seconds left…...
Analyzing Genes and Genomes
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
Essential Cell Biology
Intracellular Compartments and Transport
PSSA Preparation.
Essential Cell Biology
Immunobiology: The Immune System in Health & Disease Sixth Edition
Energy Generation in Mitochondria and Chlorplasts
Benchmark Series Microsoft Excel 2013 Level 2
Steffen Staab 1WeST Web Science & Technologies University of Koblenz ▪ Landau, Germany Structured Data on the Web Introduction to.
Introduction Peter Dolog dolog [at] cs [dot] aau [dot] dk Intelligent Web and Information Systems September 9, 2010.

Copyright © 2003 Pearson Education, Inc. Slide 1-1 Created by Cheryl M. Hughes, Harvard University Extension School — Cambridge, MA The Web Wizard’s Guide.
August Chapter 1 - Introduction Learning XML by Erik T. Ray Slides were developed by Jack Davis College of Information Science and Technology Radford.
XML Extensible Markup Language
XML Related Technologies
Presentation transcript:

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

Copyright © 2003 Pearson Education, Inc. Slide 8-2 CHAPTER 8 XML Programs and Programming

Copyright © 2003 Pearson Education, Inc. Slide 8-3 XML Programming Some applications for processing XML: Parsers Document Object Model (DOM) The Simple Application Programming Interface for XML (SAX) Programming languages (ie – Java) Databases

Copyright © 2003 Pearson Education, Inc. Slide 8-4 XML Parsers Two types of parsers: Validating – checks document against a document model Non-validating – only checks syntax Parsers are code libraries written in a programming language The XML parser that comes with Internet Explorer is called the MSXML parser

Copyright © 2003 Pearson Education, Inc. Slide 8-5 The Document Object Model (DOM) The first DOM specification was released by the W3C in October of 1998 Three levels of the recommendation: Level 1 - provides the core document models Level 2 - includes Level 1 and adds a model for style sheets, Level 3 - includes Level 1 and adds a model for content (DTD or schema) What DOM does: takes an XML document as input and creates an object structure in memory, which can then be accessed by programs DOM creates a tree-like structure, with branches and leaves to represent the hierarchy of the document

Copyright © 2003 Pearson Education, Inc. Slide 8-6 DOM Example – Microsofts XMLDOM XMLDOM is a COM component that is included with the Internet Explorer 5.0 The DOM creates an object in memory that can then be accessed by programs Some DOM object properties: childNodes firstChild lastChild Some DOM object methods: Load() CreateNode() Save()

Copyright © 2003 Pearson Education, Inc. Slide 8-7 DOM Example – XML file Job Title: Web master 4 We are looking for a Web master to oversee the management 5 of our company Web site. The Web master will be responsible for 6working with other staff members to collect information for the 7Web site, and for creating and maintaining the Web 8pages Basic writing skills 11 good communication skills 12 HTML 13 14

Copyright © 2003 Pearson Education, Inc. Slide 8-8 DOM Example – HTML file with Javascript Microsoft DOM Example Using Javascript 4 5 6/* This is a comment in JavaScript */ 7/* Create a new DOM object for our document */ 8var xmlDocument = new ActiveXObject("Microsoft.XMLDOM"); 9xmlDocument.async="false"; 10/* Use the "load" method to read our XML document into memory */ 11xmlDocument.load("job-posting.xml"); 12/* Print some HTML code */ 13document.write(" Using the Microsoft DOM "); 14/* BEGIN THE EXAMPLES */ 15/* 1. Prints the value of the first child node */ 16document.write(" 1. firstChild is: "); 17document.write(xmlDocument.documentElement.firstChild.text); 18document.write(" ");

Copyright © 2003 Pearson Education, Inc. Slide 8-9 DOM Example – HTML file with Javascript (cont.) 19/* 2. Prints the value of the last child node */ 20document.write(" 2. lastChild is: "); 21document.write(xmlDocument.documentElement.lastChild.text); 22document.write(" "); 23/* 3. Prints the name of the lastChild element */ 24document.write(" 3. lastChild node name is: "); 25document.write(xmlDocument.documentElement.lastChild.nodeName); 26document.write(" "); 27/* 4. Prints the name of the child node stored in item(1) */ 28/* Then, it checks to see if the node has child elements */ 29document.write(" 4. item(2) is: "); 30document.write(xmlDocument.documentElement.childNodes.item(2).nodeName); 31document.write(" Does this node have child elements? "); 32document.write (xmlDocument.documentElement.childNodes.item(2).hasChildNodes()); 33document.write(" "); 34/* End the examples */

Copyright © 2003 Pearson Education, Inc. Slide 8-10 The Simple Application Programming Interface for XML (SAX) The SAX 1.0 recommendation was released by the W3C in May 1998 SAX is an event-based API that reads the document in a serial fashion Sax is much faster than DOM, and does not store information in memory

Copyright © 2003 Pearson Education, Inc. Slide 8-11 SAX Example XML File: The Web Wizards Guide to XML C. Hughes SAX processor events: 1 Start document 2 Start element (book) 3 Attribute (id=1234) 4 Start element (title) 5 Text (The Web Wizards Guide to XML) 6 End element (title) 7 Start element (author) 8 Text (C. Hughes) 9 End element (author) 10 End element (book) 11 End document

Copyright © 2003 Pearson Education, Inc. Slide 8-12 Comparing SAX and DOM When to use SAX: Processing large documents Searching Stopping the program When to use DOM: Accessing cross-referenced data Modifying the XML document Creating new XML documents

Copyright © 2003 Pearson Education, Inc. Slide 8-13 XML and Programming Languages XML has become popular with object- oriented programming languages DOM created objects that can be easily accessed Some popular languages that are embracing XML: Java Perl C++

Copyright © 2003 Pearson Education, Inc. Slide 8-14 XML and Databases XMLs structure makes it a good technology for storing data XML can support relationships among pieces of data that relational databases can not XML Query Language (XQuery) – being developed as a standardized query language that will span all types of XML documents and data sources

Copyright © 2003 Pearson Education, Inc. Slide 8-15 Examples of XML Programs Distributed Authoring and Versioning on the World Wide Web (WebDAV) Wireless Application Protocol (WAP) Scalable Vector Graphics (SVG) Open Financial Exchange (OFX) Mathematical Markup Language (MathML) Chemical Markup Language (CML) Extensible Hypertext Markup Language (XHTML) Resource Description Framework (RDF)

Copyright © 2003 Pearson Education, Inc. Slide 8-16 MathML Examples Equation: Equation: ab 1 2 x 3 ⁢ 4 b 5