August 20061 Chapter 2 - Markup and Core Concepts Learning XML by Erik T. Ray Slides were developed by Jack Davis College of Information Science and Technology.

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 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.
History Leading to XHTML
XML Document Type Definitions ( DTD ). 1.Introduction to DTD An XML document may have an optional DTD, which defines the document’s grammar. Since the.
3 November 2008CIS 340 # 1 Topics To define XML as a technology To place XML in the context of system architectures.
Tutorial 9 Working with XHTML
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.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
Tutorial 11 Creating XML Document
Document Type Definitions. XML and DTDs A DTD (Document Type Definition) describes the structure of one or more XML documents. Specifically, a DTD describes:
Introducing XHTML: Module B: HTML to XHTML. Goals Understand how XHTML evolved as a language for Web delivery Understand the importance of DTDs Understand.
Jennifer Widom XML Data DTDs, IDs & IDREFs. Jennifer Widom DTDs, IDs & IDREFs “Well-Formed” XML Adheres to basic structural requirements Single root element.
Introduction to XML This material is based heavily on the tutorial by the same name at
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.
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.
1 herbert van de sompel CS 502 Computing Methods for Digital Libraries Cornell University – Computer Science Herbert Van de Sompel
XML 1 Enterprise Applications CE00465-M XML. 2 Enterprise Applications CE00465-M XML Overview Extensible Mark-up Language (XML) is a meta-language that.
1 XHTML محمد احمدی نیا 2 Of 19 HTML vs XHTML  XHTML is a stricter and cleaner version of HTML.  by combining the strengths of HTML.
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
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.
1 Chapter 10: XML What is XML What is XML Basic Components of XML Basic Components of XML XPath XPath XQuery XQuery.
XML Documents Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University Elements Attributes Comments PI Document.
XML Instructor: Charles Moen CSCI/CINF XML  Extensible Markup Language  A set of rules that allow you to create your own markup language  Designed.
17 Apr 2002 XML Syntax: Documents Andy Clark. Basic Document Structure Element tags – Elements have associated attributes Text content Miscellaneous –
Lecture 16 Introduction to XML Boriana Koleva Room: C54
1 Introduction to XML XML stands for Extensible Markup Language. Because it is extensible, XML has been used to create a wide variety of different markup.
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.
XML for Text Markup An introduction to XML markup.
XML Design Goals 1.XML must be easily usable over the Internet 2.XML must support a wide variety of applications 3.XML must be compatible with SGML 4.It.
INFSY 547: WEB-Based Technologies Gayle J Yaverbaum, PhD Professor of Information Systems Penn State Harrisburg.
Internet & World Wide Web How to Program, 5/e. © by Pearson Education, Inc. All Rights Reserved.2.
1 herbert van de sompel CS 502 Computing Methods for Digital Libraries Cornell University – Computer Science Herbert Van de Sompel
225 City Avenue, Suite 106 Bala Cynwyd, PA , phone , fax presents… XML Syntax v2.0.
Well Formed XML The basics. A Simple XML Document Smith Alice.
Introduction to XML XML – Extensible Markup Language.
Introduction to DTD A Document Type Definition (DTD) defines the legal building blocks of an XML document. It defines the document structure with a list.
XML DTD. XML Validation XML with correct syntax is "Well Formed" XML. XML validated against a DTD is "Valid" XML.
XP Tutorial 9New Perspectives on HTML and XHTML, Comprehensive 1 Working with XHTML Creating a Well-Formed Valid Document Tutorial 9.
XML blocks XML STRUCTURE The most basic building blocks of an XML file are elements, attributes and comments. Compiled based on Tutorial PhUSE 2008 XML.
Tutorial 9 Working with XHTML. New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 2 Objectives Describe the history and theory of XHTML.
XML CORE CSC1310 Fall XML DOCUMENT XML document XML document is a convenient way for parsers to archive data. In other words, it is a way to describe.
C Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Introduction to XML Standards.
Introduction to XML Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
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.
XML Introduction to XML Extensible Markup Language.
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.
CITA 330 Section 2 DTD. Defining XML Dialects “Well-formedness” is the minimal requirement for an XML document; all XML parsers can check it Any useful.
Unit 4 Representing Web Data: XML
Creating a Well-Formed Valid Document
Tutorial 9 Working with XHTML
Tutorial 9 Working with XHTML
The XML Language.
Session III Chapter 6 – Creating DTDs
Chapter 7 Representing Web Data: XML
Web Programming Maymester 2004
Tutorial 9 Working with XHTML
XML Data Introduction, Well-formed XML.
XML Data DTDs, IDs & IDREFs.
Session II Chapter 6 – Creating DTDs
Document Type Definition (DTD)
Review of XML IST 421 Spring 2004 Lecture 5.
XML IST 421.
Presentation transcript:

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 Radford University

August XML Syntax “Syntax” refers to the rules of a language Syntax is needed with any language so that the documents created with that language are consistent Programs that process documents expect the syntax rules to be followed, otherwise the document may not be interpreted correctly

August Components of an XML Document XML Declaration Elements Attributes Entities Comments

August Components: The XML Declaration The XML Declaration: –Tells the processing program that the document is an XML document, along with other optional information –The declaration is always the first line of an XML document –Attributes that can be used in the Declaration: version encoding standalone –Example:

August Document Type Declaration Document type declarations are used to define entities or default attribute values. Secondly, they are used to support validation, a special mode of parsing that checks grammar and vocabulary of markup. A validating parser needs to read a list of declarations for element rules before it can begin to parse. In both cases, this is done in document type declaration section. A document type declaration consists of: - delimeter <!DOCTYPE - element name identifies the type element - dtd id local path or url - entity decl optional list of entity declara. dtd identifier supports two methods of identification: system-specific and public

August XML Syntax “Syntax” refers to the rules of a language Syntax is needed with any language so that the documents created with that language are consistent Programs that process documents expect the syntax rules to be followed, otherwise the document may not be interpreted correctly

August Components: XML Elements Elements: –Used to describe the data. Consist of: A start tag Content An end tag –Example: Content –The “root” element of a document is the outermost element, and contains all of the other elements in the document. There can be only one root element in a single document An element that does not contain any content is known as an “empty element”

August Element Nesting The term “nesting” refers to the process of containing elements within other elements Terminology: –Child elements – elements that are contained within other elements –Parent elements – elements that contain other elements –Sibling elements – elements that share the same parent element

August Nesting Example 1 2 Sally 3 Joe 4 5 Larry 6 Curly 7 Mo 8 9

August Components: XML Attributes Attributes help to describe XML elements Attributes are always contained in the start tag of the element they are describing Attributes are known as “name-value pairs” Example: address=“123 Main Street”

August Components: XML Entities Two types of entities: –General – placeholders for information contained in the XML document –Parameter – used within a DTD to reference a grouping of elements Three types of general entities: –Character – used in place of special characters –Content – used for blocks of frequently used text –Unparsed – used for binary or non-text data, like image files

August Examples of Entities Character entity: –Character: > –Entity reference: > or > –Usage: x > y Content entity: –Declaration: –Usage: &address; Unparsed entity: –Declaration: –Usage: &aimage;

August Components: Comments An XML comment is ignored by applications that process XML Comments are commonly used for documentation, or to add information for others viewing the document The content of the comment is surrounded by special comment tags: Example:

August Well-Formed XML Documents A “well-formed” document is one which adheres to the syntax rules for XML: –An XML document contains one root element –All elements must have start and end tags, except for empty elements –Elements must be properly nested –All attributes must have a value –Attributes can only appear in the start tag and must be unique to that element –Element names are case-sensitive –Special characters must be written as entities –Names of element can start only with letters or an underscore, and can contain letters, numbers, hyphens, periods and underscores

August XML Parsers A “parser” is a program that checks the syntax of an XML document to ensure that the document is well-formed Two types of parsers: –Non-validating – only checks for syntax –Validating – checks syntax and verifies the document against a DTD or Schema