xml basics

25
XML Basics XML Basics Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University Extensible Meta Language Markup Language

Upload: hanne

Post on 02-Feb-2016

43 views

Category:

Documents


0 download

DESCRIPTION

XML Basics. Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University. Markup Language. Extensible Meta Language. Storage. Management. Search. Sharing. Retrieval. Interchange. Information Age. Processing. Information. Representation. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: XML Basics

XML BasicsXML BasicsChao-Hsien Chu, Ph.D.

School of Information Sciences and TechnologyThe Pennsylvania State University

Extensible

Meta Language

Markup

Language

Page 2: XML Basics

Information

Information AgeInformation Age

Processing

Representation

Storage

Retrieval

Search Sharing

Management

Interchange

Page 3: XML Basics

IS there

such a creation ?

The Needs for Information InterchangeThe Needs for Information Interchange

Power Flexibility Simplicity Fault tolerance Scalability Interoperability Open standard Extensible Character-based Human-readable

Page 4: XML Basics

IS There Such a Creation?

Power Flexibility Simplicity Fault tolerance Scalability Interoperability Open standard Extensible Character-based Human-readable

HTML SGML XML

X XX X

? XX XX X

? ? ?? ? ?

X XX X X

X X

Criteria

Page 5: XML Basics

Weaknesses of HTMLWeaknesses of HTML

HTML isn’t extensible – can’t define custom tags. HTML is display-centric. HTML isn’t usually directly reusable HTML only provide one view of data. HTML has little or no semantic structure. Getting bigger and slower! Not fault tolerance.

XML will complement, rather than replace, HTML

Page 6: XML Basics

The Buzz Words Around XMLThe Buzz Words Around XML SVG – Scalable Vector Graphics Language OFX – Open Financial Exchange SGML – Standard Generalized Markup Language DTD – Document Type Definition DSSSL – Document Style Semantics and

Specification Language CSS – Cascading Style Sheet XSL – XML Stylesheet Language DOM – Document Object Model.

. . .

Page 7: XML Basics

Basics of XMLBasics of XML

XMLXML

What?

Why?

Who

?

Where?

When?

How

?

Page 8: XML Basics

What is XML?What is XML?

XML stands for Extensible Markup Language. Markup is the code, embedded with the

document, which store the information required for electronic processing.

XML is extensible because it predefines no tag but lets the user create tags that are needed for application.

XML is a meta language because it can be used to define markup languages.

Page 9: XML Basics

Family of Markup LanguagesFamily of Markup Languages

GML – Generalized Markup Language SGML – Standard Generalized Markup Language HTML – Hyper Text Markup Language XML – Extensible Markup Language XHTML – Extensible Hyper-Text Markup Language CML - Chemistry Markup Language MathML – Mathematical Markup Language SVG – Scalable Vector Graphic SMIL – Synchronized Multimedia Integration Language HDML – Handheld Device Markup Language WML – Wireless Markup Language OEB – Open eBook Structure Specification

Page 10: XML Basics

Genealogy of Markup LanguagesGenealogy of Markup Languages

GML (1969)

SGML (1985)

XML (1998)

HTML (1993)

XHTML SVG SMIL HDML OEB

IBM

ISO 8879

W3C

CERN

Page 11: XML Basics

SGML

XML

Genealogy of Markup LanguagesGenealogy of Markup Languages

HTMLXSL

Page 12: XML Basics

Advantages of XMLAdvantages of XML

Common language for system-to-system communication

Enables loose connectivity, yet tight integration Relatively easy to implement conversion from an

RDB record to an XML message. Platform independent Scalable XML Signature provides message and party

authentication.

Page 13: XML Basics

Traditional vs. Nontraditional DocumentTraditional vs. Nontraditional Document

Information

Structure

Format

Traditional

Format

Information Structure

Nontraditional

Page 14: XML Basics

Ways of Displaying XMLWays of Displaying XML

Format

Information(Document)

Structure(DTD)

XSL

DHTML + CSS

DSSSL

CGI + Script

Page 15: XML Basics

Write One Publish Many IdeaWrite One Publish Many Idea

XMLDocument

Print out

CD ROM

Web

WAP, etc.

Process

Process

Process

Process

Page 16: XML Basics

XML for Information InterchangeXML for Information Interchange

CADPackage

WordProcessor

StatisticalProcessing

SpreadsheetPackage

XML

Page 17: XML Basics

Demand for Platform Independent TechnologyDemand for Platform Independent Technology

Internet XHTML

XML Java

Platform

Data Processing

Presentation

Page 18: XML Basics

Selected XML ApplicationsSelected XML Applications

Middle-Tier Servers: Personalized Frequent-Flyer Website Building an Online Auction Website Anatomy of an Information Server

E-Commerce: Electronic Data Interchange (EDI) Collaboration in an e-commerce Supply Web

Page 19: XML Basics

Selected XML ApplicationsSelected XML Applications

Portals: Enterprise Information Portals (EIP)

Syndication: Information and Content Exchange (ICE)

Publishing: PC World Online

Content Management: Enterprise Data Management

Page 20: XML Basics

Selected XML ApplicationsSelected XML Applications

Content Acquisition: Integrating Legacy Data

Schema: Building a Schema for a Product Catalog

Stylesheet: A Stylesheet-Driven Tutorial Generator.

Navigation – Application Integration: Application Integration Using Topic Map

Page 21: XML Basics

Components of XML SystemsComponents of XML Systems

XMLParser

(Processor)

XMLApplication

XMLDocument(Contents)

XMLDTD

(Rule)

Well-Formed(Syntax)

Validate(Structure)

Page 22: XML Basics

Well Formed DocumentWell Formed Document

Here are some general guidelines:

At least one root element. All elements must contain both start and end tags. Tags are case sensitive No overlapping tags. Elements must nest inside each other

properly. Attribute values must be enclosed in quotes. An empty element must end with “/>” The text characters (<), (>) and (“) must always be

represented by character entities.

Well formed XML documents are those documents that are syntactically correct.

Page 23: XML Basics

(optional)

How a Parser Interprets XML - ValidateHow a Parser Interprets XML - Validate

XMLDocument

Data TypeDefinition

IssueWarning/Stop

Processing

FurtherProcessing

WellFormed? DTD?

Valid?Issue

Warning/StopProcessing

no

no

no

yes

yes

yes

Page 24: XML Basics

Popular Parsers for XMLPopular Parsers for XML

MSXML – Microsoft’s IE Gecko – Netscape IBM XML Parser for Java

(http://alphaworks.ibm.com/tech/xml4j)

Data Channel XJ Parser (http://xdev.datachannel.com) SUN XML Parser for Java

(http://developer.java.sun.com/developer/earlyAccess/xml/index.html)

Page 25: XML Basics

Thank You?

Any Question?