1 introduction to xml

26
Introduction to XML Atul Kahate [email protected]

Upload: gauravashq

Post on 16-May-2015

802 views

Category:

Education


3 download

DESCRIPTION

XML-XML

TRANSCRIPT

Page 1: 1   introduction to xml

Introduction to XML

Atul Kahate

[email protected]

Page 2: 1   introduction to xml

Roots of XML – EDI Technology

Page 3: 1   introduction to xml

Introduction to XML 3

EDI and XML XML is a data description language

It has its roots in EDI

EDI technology is still in use, but is being replaced with XML

Page 4: 1   introduction to xml

Introduction to XML 4

What is EDI? Electronic Data Interchange (EDI)

Related to the history of XML Document exchange standard

e.g. Purchase Order (PO), Sales Order (SO) Documents are inter-related

But their formats differ! Aims at:

Making formats uniform Document exchanges easier

Page 5: 1   introduction to xml

Introduction to XML 5

EDI Example Company A wants to buy spare

parts from company B Company A prepares a Purchase

Order (PO) Sends it to company B Company B sends the goods, and a

Sales Order (SO) to B Formats of the SO and the PO differ

Page 6: 1   introduction to xml

Introduction to XML 6

Sample EDI DocumentInterchange Control Header – Electronic Envelope

Functional Group Header – Purchase OrderTransaction Set Header – Purchase Order A100

Data Segment Header – SourceData Element – Terms of TransactionData Element – Date and Time

Data Segment Header – DetailsData Element – Item NumberData Element – Item DescriptionData Element – Item QuantityData Element – Item Price

Transaction Set Footer – Purchase Order A100Functional Group Footer – Purchase Order……

Interchange Control Header – Electronic Envelope

Page 7: 1   introduction to xml

Introduction to XML 7

EDI and the Internet

Web browser

XML

EDI VAN Provider

ASC X12

Page 8: 1   introduction to xml

XML Theory

Page 9: 1   introduction to xml

Introduction to XML 9

History of XML Extensible Markup Language (XML)

Based on Standard Generalized Markup Language (SGML)

Quite complex Defines markup to represent logical

structure of documents Independent of technologies and platforms Meta language (Language for describing

other languages)

Page 10: 1   introduction to xml

Introduction to XML 10

What was there before XML? Hyper Text Markup Language (HTML)

Tagging language Used for displaying text in Web browsers Quite simple to code Example

<H1> Fruit description </H1><P> Color = Red </P>…

Page 11: 1   introduction to xml

Introduction to XML 11

Problems with HTML – 1 No syntax checking

No provision for validating HTML documents

No structure Display-related characteristics are

considered and nothing else

Page 12: 1   introduction to xml

Introduction to XML 12

Problems with HTML – 2 Not content-aware

Use of tags such as <H3> instead of <Name>

Not international Based on ASCII, so limited language

support (XML is Unicode-based)

Page 13: 1   introduction to xml

Introduction to XML 13

Problems with HTML – 3 Not suitable for data interchange

Very little information inside a document is identified

Not object-oriented Programmers with OO skills find it

difficult to deal with HTML

Page 14: 1   introduction to xml

Introduction to XML 14

Why XML? Gels well with existing Web

protocols such as HTTP and MIME Supports a wide variety of

applications Has programming support Optional features are minimum XML documents are easier to read

for humans

Page 15: 1   introduction to xml

Introduction to XML 15

Problems with Data Exchange Application-related

Problems solved by EDI, but other problems raised (Cost, Infrastructure, etc)

Technology-related Incompatible technologies used

Page 16: 1   introduction to xml

Introduction to XML 16

Technology-related Problems

Organization X

Oracle

Organization Y

IMS

Page 17: 1   introduction to xml

Introduction to XML 17

Technology-related Problems

Organization X

Oracle

Organization Y

IMSText Text

Page 18: 1   introduction to xml

Introduction to XML 18

Technology-related Problems

Organization X

Oracle

Organization Y

IMSEDI EDI

Page 19: 1   introduction to xml

Introduction to XML 19

Technology-related Problems

Organization X

Oracle

Organization Y

IMSXML XML

Page 20: 1   introduction to xml

Introduction to XML 20

XML Features Modularity

Structure of XML documents can be decided based on needs

Extensibility Linking physically different

documents is possible Data orientation

Focus is on data, so is machine-friendly

Page 21: 1   introduction to xml

Introduction to XML 21

XML Example<?xml version=“1.0”?><address-book>

<entry><name>

<first> Ram </first><last> Joshi </last>

</name><address>

<building> Navi Peth </building><house-number> 304 </house-number><city> Pune </city><pin> 411001 </pin>

</address><res-phone> 27289103 </res-phone><mobile> 93292-91010 </mobile><email> [email protected]</email>

</entry></address-book>

Page 22: 1   introduction to xml

Introduction to XML 22

Hierarchy of Data XML presents data in the form of a

hierarchyBook

ChapterSectionParagraphSentenceWordCharacter

Page 23: 1   introduction to xml

Introduction to XML 23

Output of the XML Document

Page 24: 1   introduction to xml

Introduction to XML 24

In HTML, it would be …<HTML><HEAD>

<H3> Ram </H3><H3> Joshi </H3><H4> Navi Peth </H4><H4> 304 </H4><H4> Pune <H4><H4> 411001 </H4></Head>

</HTML>

Page 25: 1   introduction to xml

Introduction to XML 25

Another XML Example<?xml version="1.0" encoding="utf-8" ?><examination> <student> <roll_number>1</roll_number> <student_name>Harish</student_name> <course>Msc</course> <total_marks>275</total_marks> <out_of>400</out_of> <rank>5</rank> </student> <student> <roll_number>2</roll_number> <student_name>Jyotsna</student_name> <course>Msc</course> <total_marks>283</total_marks> <out_of>400</out_of> <rank>4</rank> </student> <student> <roll_number>3</roll_number> <student_name>Bhupendra</student_name> <course>Msc</course> <total_marks>251</total_marks> <out_of>400</out_of> <rank>7</rank> </student> <student> <roll_number>4</roll_number> <student_name>Senthil</student_name> <course>Msc</course> <total_marks>271</total_marks> <out_of>400</out_of> <rank>14</rank> </student></examination>

Page 26: 1   introduction to xml

Thank you!

Any Questions?