introduction to xml

19
Introduction to XML Eugenia Fernandez IUPUI

Upload: francis-frye

Post on 31-Dec-2015

11 views

Category:

Documents


0 download

DESCRIPTION

Introduction to XML. Eugenia Fernandez IUPUI. What is XML?. From the World Wide Web Consortium (W3C) The Extensible Markup Language (XML) is the universal format for structured documents and data on the web. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Introduction to XML

Introduction to XML

Eugenia FernandezIUPUI

Page 2: Introduction to XML

What is XML? From the World Wide Web

Consortium (W3C) The Extensible Markup Language (XML)

is the universal format for structured documents and data on the web.

It is a tag-based markup language that both describes data and is used to create markup languages for specific contexts.

Page 3: Introduction to XML

XML-derived Markup Languages

Open Financial Exchange (OFX) XML/EDI

Markup for Electronic Data Interchange Resource Description Framework

Markup for describing data about data (metadata) for cataloging and search purposes

Chemical markup Language (CML) Wireless Markup Language (WML)

Page 4: Introduction to XML

A Document Contains Data

Structure

Presentation

XML

Style sheets(CSS, XSL)

Page 5: Introduction to XML

Unstructured vs.Structured Data

diluvio m. Inundación causada por lluvias copiosas. Lluvia muy copiosa.

Unstructured

<word>diluvio</word><type>m.</type><definition>Inundación causada por lluvias copiosas. Lluvia muy copiosa.</definition>

Structured

Page 6: Introduction to XML

History of XML SGML (Standard Generalization Markup

Language) was developed as a way to express data in electronic texts

XML is simplified subset of SGML, designed to work across a limited-bandwidth network such as the Internet.

XML is in process of being standardized. It is currently at the recommendation stage.

Page 7: Introduction to XML

XML vs. HTML

<html><b>101 Main St.<br>Chicago, IL 60661</b></html>

<?xml version=”1.0” ?><address>

<street>101 Main St.</street><city>Chicago</city><state>IL</state><zip>60661</zip>

</address>

HTML = presentation format

XML = structured content

Page 8: Introduction to XML

Why XML? Readable format Distribute data to any machine on

any platform Easily combine multiple sources of

data Easier way to do data interchange

between applications

Page 9: Introduction to XML

Benefits of Using XML Describes content and structure Both machine- and human- readable Separates content from display Well-formed, follows rules Can be validated Open and extensible One source – multiple formats

Page 10: Introduction to XML

Conversion

One Source – Multiple Formats

Separating data from presentation and processing frees the data from any one use

Data becomes "use neutral"

XML

HTML

PDF

XML

Page 11: Introduction to XML

Processing XML into HTML

XSLStylesheet

XSLProcessor

HTML Document

XMLDocument

Page 12: Introduction to XML

Processing XML to XML

XSLStylesheet

XSLProcessor

NewXML

Document

XMLDocument

Page 13: Introduction to XML

How XML Can Be Used Enable business-to-business

communication Enable smart agents Enable smart searches XML data can be manipulated by

the browser reducing server & network load

Page 14: Introduction to XML

A Few XML Technologies Extensible Markup Language (XML) 1.0 Cascading Style Sheets (CSS) Extensible Style Language (XSL)

XML Document Transformation (renamed XSLT) XPath, a pattern matching syntax XSLFO, a formatting object interpretation, for

printing XML Pointer Language (XPointer) and

XML Linking Language (XLink) Document Type Definition (DTD) XML Schemas (XSD)

Page 15: Introduction to XML

Contents of XML Document

Processing instructions

Comments Elements

Root Element Child Element Empty

Element Attributes Text

<?xml version=“1.0“?>

<!-- Student Information -->

<student_list> <name>John Smith</name> <full_time/> <email type=“home”> [email protected] </email></student_list>

Page 16: Introduction to XML

XML Data is Hierarchical

<?xml version=“1.0”?>

<!-- Student Information -->

<student> <name>John Smith</name> <full_time/> <email type=“home”> [email protected] </email></student>

student

name

full_time

email

type

John Smith

[email protected]

home

Page 17: Introduction to XML

Well-formed Documents Contain single root element Match open and close tags Consistent capitalization Correctly nested elements All attributes enclosed in quotes No repeating attributes in an

element

Page 18: Introduction to XML

Validation of XML Documents Ensures that document is

grammatically correct Validation done via

Document Type Definition (DTD) XML Schema

validformedWell

Page 19: Introduction to XML

References MSDN DevSeries, Web 105:

Introduction to XML Microsoft Class Pack: Building XML-

Based Web Applications, Module 1: Overview of XML Documents

XML Seminar at Quilogy, May 9, 2001

Introduction to XML, a Barnes & Noble University Online Course