Вы находитесь на странице: 1из 26

Introduction to XML

Atul Kahate

akahate@gmail.com
Roots of XML – EDI Technology
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

Introduction to XML 3
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

Introduction to XML 4
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

Introduction to XML 5
Sample EDI Document
Interchange Control Header – Electronic Envelope
Functional Group Header – Purchase Order
Transaction Set Header – Purchase Order A100
Data Segment Header – Source
Data Element – Terms of Transaction
Data Element – Date and Time
Data Segment Header – Details
Data Element – Item Number
Data Element – Item Description
Data Element – Item Quantity
Data Element – Item Price
Transaction Set Footer – Purchase Order A100
Functional Group Footer – Purchase Order


Interchange Control Header – Electronic Envelope

Introduction to XML 6
EDI and the Internet
Web XML
browser
EDI VAN
Provider

ASC X12

Introduction to XML 7
XML Theory
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)

Introduction to XML 9
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>

Introduction to XML 10
Problems with HTML – 1
 No syntax checking
 No provision for validating HTML
documents

 No structure
 Display-related characteristics are
considered and nothing else

Introduction to XML 11
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)

Introduction to XML 12
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

Introduction to XML 13
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

Introduction to XML 14
Problems with Data Exchange
 Application-related
 Problems solved by EDI, but other
problems raised (Cost, Infrastructure, etc)

 Technology-related
 Incompatible technologies used

Introduction to XML 15
Technology-related Problems

Organization X Organization Y

Oracle IMS

Introduction to XML 16
Technology-related Problems

Organization X Organization Y

Text Text
Oracle IMS

Introduction to XML 17
Technology-related Problems

Organization X Organization Y

EDI EDI
Oracle IMS

Introduction to XML 18
Technology-related Problems

Organization X Organization Y

XML XML
Oracle IMS

Introduction to XML 19
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

Introduction to XML 20
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> ram@rediffmail.com</email>
</entry>
</address-book>

Introduction to XML 21
Hierarchy of Data
 XML presents data in the form of a hierarchy
Book
Chapter
Section
Paragraph
Sentence
Word
Character

Introduction to XML 22
Output of the XML Document

Introduction to XML 23
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>

Introduction to XML 24
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> Introduction to XML 25
Thank you!

Any Questions?

Вам также может понравиться