Internet & World Wide Web How to Program, 5/e. ©1992-2012 by Pearson Education, Inc. All Rights Reserved.2.

Slides:



Advertisements
Similar presentations
What is XML? a meta language that allows you to create and format your own document markups a method for putting structured data into a text file; these.
Advertisements

XML and Enterprise Computing. What is XML? Stands for “Extensible Markup Language” –similar to SGML and HTML –document “tags” are used to define content.
 Fundamentals of Web Design.  Describe the history and theory of XHTML  Understand the rules for creating valid XHTML documents  Apply a DTD to an.
An Introduction to XML Based on the W3C XML Recommendations.
XML 6.3 DTD 6. XML and DTDs A DTD (Document Type Definition) describes the structure of one or more XML documents. Specifically, a DTD describes:  Elements.
Tutorial 9 Working with XHTML
Document Type Definitions
XML Schemas Microsoft XML Schemas W3C XML Schemas.
 2002 Prentice Hall, Inc. All rights reserved. ISQA 407 XML/WML Winter 2002 Dr. Sergio Davalos.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic XML.
Tutorial 9 Working with XHTML. XP Objectives Describe the history and theory of XHTML Understand the rules for creating valid XHTML documents Apply a.
Creating a Well-Formed Valid Document. 2 Objectives Introducing XHTML Creating a Well-Formed Document Creating a Valid Document Creating an XHTML Document.
Tutorial 11 Creating XML Document
COS 381 Day 14. Agenda Questions?? Resources Source Code Available for examples in Text Book in Blackboard
Document Type Definitions. XML and DTDs A DTD (Document Type Definition) describes the structure of one or more XML documents. Specifically, a DTD describes:
Manohar – Why XML is Required Problem: We want to save the data and retrieve it further or to transfer over the network. This.
Copyright © 2003 Pearson Education, Inc. Slide 2-1 Created by Cheryl M. Hughes, Harvard University Extension School — Cambridge, MA The Web Wizard’s Guide.
ECA 228 Internet/Intranet Design I Intro to XML. ECA 228 Internet/Intranet Design I HTML markup language very loose standards browsers adjust for non-standard.
 2008 Pearson Education, Inc. All rights reserved XML.
XP New Perspectives on XML Tutorial 4 1 XML Schema Tutorial – Carey ISBN Working with Namespaces and Schemas.
XP New Perspectives on XML Tutorial 3 1 DTD Tutorial – Carey ISBN
XP Tutorial 9New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with XHTML Creating a Well-Formed Valid Document Tutorial 9.
XP The University of Akron Summit College Business Technology Department Computer Information Systems 2440: 140 Internet Tools Instructor: Enoch E. Damson.
XML CPSC 315 – Programming Studio Fall 2008 Project 3, Lecture 1.
XP 1 CREATING AN XML DOCUMENT. XP 2 INTRODUCING XML XML stands for Extensible Markup Language. A markup language specifies the structure and content of.
 2003 Prentice Hall, Inc. All rights reserved. Chapter 20 – Extensible Markup Language (XML) Outline 20.1 Introduction 20.2 Structuring Data 20.3 XML.
Introduction to XML 1. XML XML started out as a standard data exchange format for the Web Yet, it has quickly become the fundamental instrument in the.
1 © Netskills Quality Internet Training, University of Newcastle Introducing XML © Netskills, Quality Internet Training University.
XML 1 Enterprise Applications CE00465-M XML. 2 Enterprise Applications CE00465-M XML Overview Extensible Mark-up Language (XML) is a meta-language that.
August Chapter 2 - Markup and Core Concepts Learning XML by Erik T. Ray Slides were developed by Jack Davis College of Information Science and Technology.
XP 1 DECLARING A DTD A DTD can be used to: –Ensure all required elements are present in the document –Prevent undefined elements from being used –Enforce.
What is XML?  XML stands for EXtensible Markup Language  XML is a markup language much like HTML  XML was designed to carry data, not to display data.
Session IV Chapter 9 – XML Schemas
Chapter 27 The World Wide Web and XML. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.27-2 Topics in this Chapter The Web and the Internet.
Electronic Commerce COMP3210 Session 4: Designing, Building and Evaluating e-Commerce Initiatives – Part II Dr. Paul Walcott Department of Computer Science,
1 Tutorial 13 Validating Documents with DTDs Working with Document Type Definitions.
Avoid using attributes? Some of the problems using attributes: Attributes cannot contain multiple values (child elements can) Attributes are not easily.
 2002 Prentice Hall, Inc. All rights reserved. Chapter 6 – Document Type Definition (DTD) Outline 6.1Introduction 6.2Parsers, Well-formed and Valid XML.
XML Extensible Markup Language
Of 33 lecture 3: xml and xml schema. of 33 XML, RDF, RDF Schema overview XML – simple introduction and XML Schema RDF – basics, language RDF Schema –
New Perspectives on XML, 2nd Edition
An OO schema language for XML SOX W3C Note 30 July 1999.
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.
XML Instructor: Charles Moen CSCI/CINF XML  Extensible Markup Language  A set of rules that allow you to create your own markup language  Designed.
Lecture 16 Introduction to XML Boriana Koleva Room: C54
Web Technologies COMP6115 Session 4: Adding a Database to a Web Site Dr. Paul Walcott Department of Computer Science, Mathematics and Physics University.
1 Credits Prepared by: Rajendra P. Srivastava Ernst & Young Professor University of Kansas Sponsored by: Ernst & Young, LLP (August 2005) XBRL Module Part.
Chapter 27 The World Wide Web and XML. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.27-2 Topics in this Chapter The Web and the Internet.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Understanding How XML Works Ellen Pearlman Eileen Mullin Programming the.
XML Introduction. What is XML? XML stands for eXtensible Markup Language XML stands for eXtensible Markup Language XML is a markup language much like.
The eXtensible Markup Language (XML). Presentation Outline Part 1: The basics of creating an XML document Part 2: Developing constraints for a well formed.
XML Introduction. Markup Language A markup language must specify What markup is allowed What markup is required How markup is to be distinguished from.
XML 2nd EDITION Tutorial 4 Working With Schemas. XP Schemas A schema is an XML document that defines the content and structure of one or more XML documents.
1 Tutorial 14 Validating Documents with Schemas Exploring the XML Schema Vocabulary.
Tutorial 13 Validating Documents with Schemas
INFSY 547: WEB-Based Technologies Gayle J Yaverbaum, PhD Professor of Information Systems Penn State Harrisburg.
Chapter 15: XML TP2543 Web Programming Mohammad Faidzul Nasrudin.
XML CSC1310 Fall HTML (TIM BERNERS-LEE) HyperText Markup Language  HTML (HyperText Markup Language): December  Markup  Markup is a symbol.
XP Tutorial 9New Perspectives on HTML and XHTML, Comprehensive 1 Working with XHTML Creating a Well-Formed Valid Document Tutorial 9.
Tutorial 9 Working with XHTML. New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 2 Objectives Describe the history and theory of XHTML.
C Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Introduction to XML Standards.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
Tutorial 9 Working with XHTML. XP Objectives Describe the history and theory of XHTML Understand the rules for creating valid XHTML documents Apply a.
CHAPTER NINE Accessing Data Using XML. McGraw Hill/Irwin ©2002 by The McGraw-Hill Companies, Inc. All rights reserved Introduction The eXtensible.
XML Notes taken from w3schools. What is XML? XML stands for EXtensible Markup Language. XML was designed to store and transport data. XML was designed.
Tutorial 9 Working with XHTML
XML.
14 XML.
Review of XML IST 421 Spring 2004 Lecture 5.
New Perspectives on XML
Presentation transcript:

Internet & World Wide Web How to Program, 5/e

© by Pearson Education, Inc. All Rights Reserved.2

3

 XML is a portable, widely supported, open (i.e., nonproprietary) technology for data storage and exchange 4 © by Pearson Education, Inc. All Rights Reserved.

 XML permits document authors to create markup for virtually any type of information  Can create entirely new markup languages that describe specific types of data, including mathematical formulas, chemical molecular structures, music and recipes  XML describes data in a way that human beings can understand and computers can process.  An XML parser is responsible for identifying components of XML documents (typically files with the.xml extension) and then storing those components in a data structure for manipulation  An XML document can reference a Document Type Definition (DTD) or schema that defines the document’s proper structure  An XML document that conforms to a DTD/schema (i.e., has the appropriate structure) is valid  If an XML parser (validating or non-validating) can process an XML document successfully, that XML document is well- formed 5 © by Pearson Education, Inc. All Rights Reserved.

6

7

 An XML document begins with an optional XML declaration, which identifies the document as an XML document. The version attribute specifies the version of XML syntax used in the document.  XML comments begin with  An XML document contains text that represents its content (i.e., data) and elements that specify its structure. XML documents delimit an element with start and end tags  The root element of an XML document encompasses all its other elements  XML element names can be of any length and can contain letters, digits, underscores, hyphens and periods  Must begin with either a letter or an underscore, and they should not begin with “ xml ” in any combination of uppercase and lowercase letters, as this is reserved for use in the XML standards 8 © by Pearson Education, Inc. All Rights Reserved.

 When a user loads an XML document in a browser, a parser parses the document, and the browser uses a style sheet to format the data for display  Google Chrome places a down arrow and right arrow next to every container element; they’re not part of the XML document.  down arrow indicates that the browser is displaying the container element’s child elements  clicking the right arrow next to an element expands that element 9 © by Pearson Education, Inc. All Rights Reserved.

10

© by Pearson Education, Inc. All Rights Reserved.11

© by Pearson Education, Inc. All Rights Reserved.12

© by Pearson Education, Inc. All Rights Reserved.13

© by Pearson Education, Inc. All Rights Reserved.14

© by Pearson Education, Inc. All Rights Reserved.15

© by Pearson Education, Inc. All Rights Reserved.16

© by Pearson Education, Inc. All Rights Reserved.17

© by Pearson Education, Inc. All Rights Reserved.18

© by Pearson Education, Inc. All Rights Reserved.19

© by Pearson Education, Inc. All Rights Reserved.20

© by Pearson Education, Inc. All Rights Reserved.21

© by Pearson Education, Inc. All Rights Reserved.22

© by Pearson Education, Inc. All Rights Reserved.23

© by Pearson Education, Inc. All Rights Reserved.24

 XML namespaces provide a means for document authors to prevent naming collisions  Each namespace prefix is bound to a uniform resource identifier (URI) that uniquely identifies the namespace  A URI is a series of characters that differentiate names  Document authors create their own namespace prefixes  Any name can be used as a namespace prefix, but the namespace prefix xml is reserved for use in XML standards  To eliminate the need to place a namespace prefix in each element, authors can specify a default namespace for an element and its children  We declare a default namespace using keyword xmlns with a URI (Uniform Resource Identifier) as its value  Document authors commonly use URLs (Uniform Resource Locators) for URIs, because domain names (e.g., deitel.com ) in URLs must be unique 25 © by Pearson Education, Inc. All Rights Reserved.

26

© by Pearson Education, Inc. All Rights Reserved.27

© by Pearson Education, Inc. All Rights Reserved.28

 DTDs and schemas specify documents’ element types and attributes, and their relationships to one another  DTDs and schemas enable an XML parser to verify whether an XML document is valid (i.e., its elements contain the proper attributes and appear in the proper sequence)  A DTD expresses the set of rules for document structure using an EBNF (Extended Backus-Naur Form) grammar  In a DTD, an ELEMENT element type declaration defines the rules for an element. An ATTLIST attribute-list declaration defines attributes for a particular element 29 © by Pearson Education, Inc. All Rights Reserved.

30

© by Pearson Education, Inc. All Rights Reserved.31

© by Pearson Education, Inc. All Rights Reserved.32

© by Pearson Education, Inc. All Rights Reserved.33

© by Pearson Education, Inc. All Rights Reserved.34

© by Pearson Education, Inc. All Rights Reserved.35

 Unlike DTDs  Schemas use use XML syntax not EBNF grammar  XML Schema documents can specify what type of data (e.g., numeric, text) an element can contain  An XML document that conforms to a schema document is schema valid  Two categories of types exist in XML Schema: simple types and complex types  Simple types cannot contain attributes or child elements; complex types can  Every simple type defines a restriction on an XML Schema- defined schema type or on a user-defined type  Complex types can have either simple content or complex content  Both can contain attributes, but only complex content can contain child elements  Whereas complex types with simple content must extend or restrict some other existing type, complex types with complex content do not have this limitation 36 © by Pearson Education, Inc. All Rights Reserved.

37

© by Pearson Education, Inc. All Rights Reserved.38

© by Pearson Education, Inc. All Rights Reserved.39

© by Pearson Education, Inc. All Rights Reserved.40

© by Pearson Education, Inc. All Rights Reserved.41

© by Pearson Education, Inc. All Rights Reserved.42

© by Pearson Education, Inc. All Rights Reserved.43