prof. sheizaf rafaeli e-commerce xml in e-commerce prof. sheizaf rafaeli e-commerce

74
Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Upload: erika-pope

Post on 15-Jan-2016

239 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

XML in E-CommerceXML in E-Commerce

Prof. Sheizaf RafaeliE-Commerce

Page 2: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

So what's wrong with HTML?

• HTML has been a very successful vehicle for the Web - powerful, yet simple, and easy to use. Why do we need a new language?

• For many purposes we don't. But: Mix of structure and presentation information.

Different views? Cannot define new data formats/constructs - new

tags lead to proprietary variants, browser wars. Structure too weak - for example for good searching,

reuse, exchange. Links hard to manage - dead link problem. Syntax checking too free - browser bloat.

Page 3: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

IMAGINEXML is expected to do and be for data

the same thing Java is and does for programs:

Write once, run anywhere

Page 4: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

XML is important becauseXML is important because

• Content really isn’t king (unless…)Content really isn’t king (unless…)

• XML helps separate content from styleXML helps separate content from style

• Works with CSS or XSL and off web tooWorks with CSS or XSL and off web too

• Used in Used in Microsoft's Channel Definition Format (CDF) in the Resource Definition Format (RDF) and the Open Software Description (OSD).

• Speeds and eases internationalization

Page 5: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

XMLXML• XML is a meta-languageXML is a meta-language

• Used for creating new markup languagesUsed for creating new markup languages

• Business import is in the ability to create Business import is in the ability to create new element typesnew element types

• Is central to business-to-business and Is central to business-to-business and internal communicationinternal communication

• Has roots in EDIHas roots in EDI

Page 6: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

New Meta LangaugesNew Meta Langauges

• New meta-languages are used in a New meta-languages are used in a variety of contexts: variety of contexts:

Music, Chemistry, Mathematics, Music, Chemistry, Mathematics, Linguistics, Geology, etc.Linguistics, Geology, etc.

Now.. ebXML for Electronic BusinessNow.. ebXML for Electronic Business

Page 7: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

Page 8: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

MathMLMathML (Math markup (Math markup

Language)Language) as an exampleas an example

Rendering algebraic notation using MathML (and

Amaya)

Note use of

Math Operators <mo>

and Math Notation <mn>

Page 9: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

Business Transactions prior Business Transactions prior to EDIto EDI

Page 10: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

Lack of standardization sometimesLack of standardization sometimes led to disagreementsled to disagreements between partnersbetween partners

Page 11: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

Computerized systems reduced some of the Computerized systems reduced some of the confusion, but problems remained becauseconfusion, but problems remained becauseof the different software and platforms used of the different software and platforms used by suppliers and manufacturers.by suppliers and manufacturers.

Page 12: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

EDI reduced the confusion by requiring direct EDI reduced the confusion by requiring direct connections between suppliers and vendorsconnections between suppliers and vendorsand by requiring standardized software.and by requiring standardized software.

Page 13: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

What is EDI?What is EDI?• ““Electronic Data Interchange”Electronic Data Interchange”

• Ensures data transfer compatibilityEnsures data transfer compatibility

• Reduces human delaysReduces human delays

• Requires complete trust from both partiesRequires complete trust from both parties

• Uses dedicated communication linesUses dedicated communication lines

• Very secureVery secure

Page 14: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

Standardized formats led to smoother Standardized formats led to smoother data interchanges and to the formation data interchanges and to the formation of business partnerships betweenof business partnerships betweensuppliers and manufacturers.suppliers and manufacturers.

Page 15: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

Disadvantages of EDIDisadvantages of EDI• Requires complete trust from both partiesRequires complete trust from both parties

• Requires proprietary softwareRequires proprietary software

• Typically limited use to large companiesTypically limited use to large companies

• Dedicated communication linesDedicated communication lines

• Very expensiveVery expensive

• Locked out competitorsLocked out competitors

Page 16: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

What is XML?What is XML?• ““eXtensible Markup Language”eXtensible Markup Language”

• Derived from SGML (“Standard Generalized Derived from SGML (“Standard Generalized Markup Language”)Markup Language”)

• XML is free, non-proprietary, not copyrighted, not XML is free, non-proprietary, not copyrighted, not patented, not trade secret protectedpatented, not trade secret protected

• Governed by W3CGoverned by W3C

• Not locked into a single software solution or vendor Not locked into a single software solution or vendor

• Can change programs that access the dataCan change programs that access the data

• First standard approved by W3C in Feb. 1998First standard approved by W3C in Feb. 1998

Page 17: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

XML objectivesXML objectives

• XML shall be straightforwardly usable over the Internet.

• XML shall support a wide variety of applications.

• XML shall be compatible with SGML.

• It shall be easy to write programs which process XML documents.

• The number of optional features in XML is to be kept to the absolute minimum, ideally zero.

• XML documents should be human-legible and reasonably clear.

Page 18: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

The basic ideaThe basic idea

• The basic idea here is called The basic idea here is called descriptive markupdescriptive markup: the tags around : the tags around a chunk of text don't say how to a chunk of text don't say how to format it, or what to do when people format it, or what to do when people click on it; they just say what it is.click on it; they just say what it is.

Page 19: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

Document typesDocument types• XML documents end with the XML documents end with the .xml.xml extension extension

• DTD (Document Type Definition) documents define the DTD (Document Type Definition) documents define the grammatical rules for the document. End with the grammatical rules for the document. End with the .dtd.dtd extensionextension

• The parser (processor) combines the XML and DTD The parser (processor) combines the XML and DTD documents to form content and structure. Explorer 5.0 documents to form content and structure. Explorer 5.0 has such a parser has such a parser (msxml). (msxml). Windows 2000 has even more Windows 2000 has even more elaborate implementations.elaborate implementations.

• XSL XSL (e(eXXtensibletensible S Styletyle L Language) defines the layout. An anguage) defines the layout. An XSL style sheet defines the rules for displaying and XSL style sheet defines the rules for displaying and organizing the data, and is interpreted on the client.organizing the data, and is interpreted on the client.

Page 20: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

XML examples, in real-life XML examples, in real-life use:use:• CML (Chemical Markup Language): SGML/XML-DTD for defining

chemical formulas.

• MathML (Mathematical Markup Language): XML-DTD for defining mathematical expressions and formulas

• PGML (Precision Graphics Markup Language)

• MUSICML

• OFX - Open Financial Exchange

• SMIL - Markup for describing multimedia collections (audio, video, text, etc)

Page 21: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

Page 22: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

Page 23: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

Main pointsMain points1. XML is a method for putting structured data in a text file 1. XML is a method for putting structured data in a text file

2. XML looks a bit like HTML but isn't HTML 2. XML looks a bit like HTML but isn't HTML

3. XML is text, but isn't meant to be read 3. XML is text, but isn't meant to be read

4. XML is a family of technologies 4. XML is a family of technologies

5. XML is verbose, but that is not a problem 5. XML is verbose, but that is not a problem

6. XML is new, but not that new 6. XML is new, but not that new

• XML is license-free, platform-independent and well-XML is license-free, platform-independent and well-supported supported

• Uses DTDs == Document Type DefinitionsUses DTDs == Document Type Definitions

Page 24: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

Version 2.0?Version 2.0?Proposed XML-only StandardsProposed XML-only Standards• Schema Repoitories: Schema Repoitories:

Microsoft - Grouped many of these technologies under Microsoft - Grouped many of these technologies under BiztalkBiztalkOrganization for the Advancement of Structured Information Standards (OASIS) Organization for the Advancement of Structured Information Standards (OASIS) XML.ORGXML.ORG

• CommerceNet - Business consortium developing ECOCommerceNet - Business consortium developing ECO

• RosettaNet - Consortium working on XML standards for catalogsRosettaNet - Consortium working on XML standards for catalogs

• Commerce ONE - Created Common Business Library (CBL)Commerce ONE - Created Common Business Library (CBL)

• Ariba - Has organized several companies to develop commerce Ariba - Has organized several companies to develop commerce XML (eXML)XML (eXML)

Page 25: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

Major PlayersMajor Players

• MicrosoftMicrosoft

• NetscapeNetscape

• Sun MicrosystemsSun Microsystems

• OracleOracle

• IBMIBM

• Numerous smaller firmsNumerous smaller firms

Page 26: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

HistoryHistory

• SGMLSGML– Powerful but complicatedPowerful but complicated

Can do it allCan do it all

• HTMLHTML– Basic and Easy, but LimitationsBasic and Easy, but Limitations

Need for extensionsNeed for extensions

• XMLXML– The compromise, providing a unified powerful but The compromise, providing a unified powerful but

manageable frameworkmanageable framework

Page 27: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

XML & Aspects of a XML & Aspects of a DocumentDocument

• ContentContent– XMLXML

• PresentationPresentation– XSL XSL

• StructureStructure– DTD DTD

Page 28: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

StructureStructure

• Document Type Definition (DTD)Document Type Definition (DTD)– HTMLHTML

• DTD fixed internally in the browserDTD fixed internally in the browser

– XMLXML• defined in DTD associated with the defined in DTD associated with the

documentdocument

• Languages: DTD, DDML, DCDLanguages: DTD, DDML, DCD

Page 29: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

MarkupMarkup

• TAGSTAGS– HTMLHTML

• Tags fixed internally in the browserTags fixed internally in the browser

– XMLXML• Tags can be user definedTags can be user defined

Page 30: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

ProcessingProcessing

• Dynamic Dynamic – HTMLHTML

• HTML Extensions like DHTMLHTML Extensions like DHTML

– XMLXML

• Also DHMTLAlso DHMTL

• HTCHTC

Page 31: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

Other ...Other ...

• LinkingLinking

• QueryingQuerying

• MetadataMetadata

Page 32: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

XML DocumentXML Document

• StartStart<?xml version=“1.0”?><?xml version=“1.0”?> (required!)(required!)

<!DOCTYPE mydoc SYSTEM “mydoc.dtd”><!DOCTYPE mydoc SYSTEM “mydoc.dtd”> (optional!)(optional!)

• CommentsComments<!-- This is my comment --><!-- This is my comment -->

• SyntaxSyntax– Like HTML (Like HTML (<TAG> … </TAG><TAG> … </TAG>) but …) but …

• All tags must closeAll tags must close• XML is case sensitiveXML is case sensitive• Tags must be nested properlyTags must be nested properly• Quote attribute valuesQuote attribute values

Page 33: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

XML Document - 1XML Document - 1

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

<BOOK><BOOK>

<TITLE>A Guide to XML</TITLE><TITLE>A Guide to XML</TITLE>

<AUTHOR>Xavier M. Leblanc</AUTHOR><AUTHOR>Xavier M. Leblanc</AUTHOR>

<CHAPTER ChapNum=“1” ><CHAPTER ChapNum=“1” >

<P><P>

This book is an intro to developing XML documents …This book is an intro to developing XML documents …

</P></P>

<P><P>

… … and this is it!and this is it!

</P></P>

</CHAPTER></CHAPTER>

</BOOK></BOOK>

Page 34: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

XML Document - 2XML Document - 2

<?xml version=“1.0” standalone=“no” encoding=“UTF-8”?><?xml version=“1.0” standalone=“no” encoding=“UTF-8”?>

thenthen

<!DOCTYPE mydoc SYSTEM “mydoc.dtd”><!DOCTYPE mydoc SYSTEM “mydoc.dtd”>

or or

<!DOCTYPE mydoc PUBLIC “htpp://www.xml.com/dtd1.dtd”><!DOCTYPE mydoc PUBLIC “htpp://www.xml.com/dtd1.dtd”>

oror

<!DOCTYPE mydoc [ <!DOCTYPE mydoc [ embedded DTD hereembedded DTD here ]> ]>

thenthen

<BOOK><BOOK>

<TITLE>A Guide to XML</TITLE><TITLE>A Guide to XML</TITLE>

<AUTHOR>Xavier M. Leblanc</AUTHOR><AUTHOR>Xavier M. Leblanc</AUTHOR>

<CHAPTER ChapNum=“1” > … </CHAPTER><CHAPTER ChapNum=“1” > … </CHAPTER>

</BOOK></BOOK>

Page 35: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

XML Document - 3XML Document - 3

<?xml version=“1.0” standalone=“no” encoding=“UTF-8”?><?xml version=“1.0” standalone=“no” encoding=“UTF-8”?>

<?xml-stylesheet href=“mystyle.xsl” type=“text/xsl”?><?xml-stylesheet href=“mystyle.xsl” type=“text/xsl”?>

<!DOCTYPE mybook SYSTEM “mybook.dtd”><!DOCTYPE mybook SYSTEM “mybook.dtd”>

<BOOK><BOOK>

<TITLE>A Guide to XML</TITLE><TITLE>A Guide to XML</TITLE>

<AUTHOR>Xavier M. Leblanc</AUTHOR><AUTHOR>Xavier M. Leblanc</AUTHOR>

<CHAPTER ChapNum=“1” > … </CHAPTER><CHAPTER ChapNum=“1” > … </CHAPTER>

</BOOK></BOOK>

Page 36: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

Document Type Definition Document Type Definition (DTD)(DTD)

• ExternalExternal– SYSTEMSYSTEM

• on local computeron local computer

– PUBLICPUBLIC• on remote computeron remote computer

• EmbeddedEmbedded

Page 37: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

DTDDTD

• Mybook.dtdMybook.dtd

<!ELEMENT BOOK (TITLE, AUTHOR, CHAPTER+)><!ELEMENT BOOK (TITLE, AUTHOR, CHAPTER+)>

<!ELEMENT TITLE (#PCDATA)><!ELEMENT TITLE (#PCDATA)>

<!ELEMENT AUTHOR (#PCDATA)><!ELEMENT AUTHOR (#PCDATA)>

<!ELEMENT CHAPTER (#PCDATA)><!ELEMENT CHAPTER (#PCDATA)>

<!ATTLIST CHAPTER ChapNumber CDATA <!ATTLIST CHAPTER ChapNumber CDATA #REQUIRED>#REQUIRED>

Page 38: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

Presentation (CSS & XSL)Presentation (CSS & XSL)

• CSS1 & CSS2CSS1 & CSS2– HTML, XML supportHTML, XML support

– Does not transform objectsDoes not transform objects

• XSLXSL– Only XML supportOnly XML support

– Transforms objectsTransforms objects

Page 39: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

Presentation (CSS & XSL)Presentation (CSS & XSL)

• CSS ExampleCSS ExampleTitle {Title {

display: block;display: block;

font-weight: bold;font-weight: bold;

color: blue;color: blue;

text-decoration: underline;text-decoration: underline;

cursor: pointercursor: pointer

}}

Author {Author {

display: block;display: block;

font-style: italic;}font-style: italic;}

Page 40: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

Presentation (HTC)Presentation (HTC)

• HTC - BehaviorsHTC - Behaviors– Similar to DHTMLSimilar to DHTML

• but separates content and presentation!but separates content and presentation!

– XML/HTML XML/HTML XSL/CSS XSL/CSS HTC HTC

Page 41: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

HTML vs. XMLHTML vs. XML• HTML specifies appearance; XML specifies contentHTML specifies appearance; XML specifies content

• XML programs will not run with errorsXML programs will not run with errors

• XML allows you to define your own “tags”XML allows you to define your own “tags”

• XML allows you to combine DTDs from various XML allows you to combine DTDs from various sourcessources

• XML allows you to split up the processing on the client XML allows you to split up the processing on the client or server side or server side

Page 42: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

Example 1 of XML codeExample 1 of XML code

<?xml version=“1.0” standalone=”yes”?>

<MyGreeting>

Hello

</MyGreeting>

Page 43: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

Example 2 of XML codeExample 2 of XML code<email>

<head>

<from> <name>John Doe</name> <address>[email protected]</address> </from>

<to> <name>John Public</name> <address>[email protected]</address> </to>

<subject> Greetings </subject>

</head>

<body>

<P>Greetings from the wonderful world of CIS745</P>

<attach encoding="mime" name="xml-draft.html"/>

</body>

</email>

Page 44: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

Process of creating XML Process of creating XML Applications:Applications:

1) Write XML program with DTDs1) Write XML program with DTDs

2) Translate the program using XML parser2) Translate the program using XML parser

3) Use the DTD templates in a browser, application 3) Use the DTD templates in a browser, application program (such as inventory or accounts payable), or program (such as inventory or accounts payable), or databasedatabase

Page 45: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

Example 1 of a simple Example 1 of a simple DTDDTD

<?xml version=1.2” standalone=”yes”?>

<!DOCTYPE document [

<ELEMENT document ANY>

<ELEMENT FirstName (#PCDATA)]

<ELEMENT LastName (#PCDATA)]

<ELEMENT Address (#PCDATA)]

<ELEMENT City (#PCDATA)]

<ELEMENT State (#PCDATA)]

<ELEMENT ZipCode (#PCDATA)] ]>

ELEMENT specifies a new element

PCDATA specifies parsed character data

Page 46: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

DTD example 2DTD example 2<!element email (head, body)>

<!element head (from, to+, cc*, subject)>

<!element from (name?, address)>

<!element to (name?, address)>

<!element name (#PCDATA)>

<!element address (#PCDATA)>

<!element subject (#PCDATA)>

<!element body (p | attach)*>

<!element p (#PCDATA)>

<!element attach EMPTY>

<!attlist attach encoding (mime|binhex) "mime" name CDATA #REQUIRED>

Page 47: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

Using the templateUsing the template(a simplified view)(a simplified view)

DATA DTDDATA DTD

Browser(Netscape or Explorer)

Database(Oracle, Access, etc)

Application Program(Inventory, Financials, etc)

Page 48: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

Using the templateUsing the template(enhanced view)(enhanced view)

BrowserBrowser

Database DTDDatabase DTD

ApplicationApplication

ProgramProgram

Browser(Netscape or Explorer)

Database(Oracle, Access, etc)

Application Program(Inventory, Financials, etc)

Page 49: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

Browser SupportBrowser Support• Internet Explorer 5.0 Internet Explorer 5.0

• Netscape 5.0Netscape 5.0

• Mozilla 6.0 (by Netscape)Mozilla 6.0 (by Netscape)

• Doczilla (by Citec)Doczilla (by Citec)

• Multidoc Pro (by Citec)Multidoc Pro (by Citec)

• Link (Java Platform)Link (Java Platform)

• XML Viewer (Java Platform by IBM)XML Viewer (Java Platform by IBM)

• InDelv XML Browser (Java platform)InDelv XML Browser (Java platform)

• HyBrick (by Fujitsu)HyBrick (by Fujitsu)

• JUMBO (Java Platform)JUMBO (Java Platform)

Page 50: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

Where is the PO# EDIWhere is the PO# EDIISA*00* *00* *08*61112500TST *01*DEMO WU000003*970911*1039*U00302000009561*0*P?GS*PO*6111250011*WU000003 *970911*1039*9784*X*003020ST*850*397822BEG*00*RE*194743**970911REF*AH*M109REF*DP*641REF*IA*000100685DTM*010*970918N1*BY*92*1287N1*ST*92*87447N1*ZZ*992*1287PO1*1*1*EA*13.33**CB*80211*IZ*364*UP*718379271641PO1*1*2*EA*13.33**CB*80211*IZ*382*UP*718379271573PO1*1*3*EA*13.33**CB*80213*IZ*320*UP*718379271497PO1*1*4*EA*13.33**CB*80215*IZ*360*UP*718379271848PO1*1*5*EA*13.33**CB*80215*IZ*364*UP*718379271005

Page 51: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

Where is the PO# XMLWhere is the PO# XML

<?xml version="1.0" ?><?xml:stylesheet?><purchase-order><header><po-number>1234</po-number><date>1999-02-08</date><time>14:05</time></header><billing><company>XMLSolutions</company><address><street>601 Pennsylvania Ave. NW</street><street>Suite 900</street><city>Washington</city><st>DC</st><postcode>20004</postcode></address></billing>

Page 52: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

Comparison of EDI and Comparison of EDI and XMLXML• EDI e-commerce solution • Optimized for compressed messages

• Requires dedicated EDI server costing $10,000 to $100,000

• Uses value-added network (VAN) charging $1 to $20 per message or more

• EDI message format takes months to master

• Requires highly trained C++ programmers

• XML e-commerce solution

• Optimized for easy programming

• Requires webserver costing $0 to $5000

• Uses your existing Internet connection

• XML message format learned in hours

• Only requires JavaScript, Visual Basic, Python or Perl script writers

Page 53: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

Traditional EDI vs. XML Traditional EDI vs. XML Based EDIBased EDI

With traditional EDI:

• Buyer and supplier are locked in

• Communications are very

secure(use dedicated lines)

• Requires extensive customization

• Very expensive

• Proprietary code

• Usually excludes smaller

companies

With XML Based EDI

• Easy to switch partners

• Internet based open communications

• Very Flexible

• Low cost

• Open format

• Feasible for any size firm

Page 54: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

Best Price Best Price ShoppingShopping

Page 55: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

XML Application ExampleXML Application Example

Page 56: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

CDF: Channel Definition CDF: Channel Definition FormatFormat

• CDF is an XML vocabulary for describing Web channels. A Web channel is a conduit for Web content, but it puts a different twist on the way Web content is delivered. Usually if you want to view Web content you have to seek it out yourself. You request a page from a Web server and the server sends it to your Web browsers. This is called pulling data from a server.

Page 57: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

• XML's role in all of this is to describe the Web channel itself. A CDF document simply defines the channel and related information, such as how often it is updated, what logo goes with it, and other basic information. The actual content the channel sends to a Web browser is standard Web fare -- usually HTML, graphics, and other multimedia like that you'd expect to find in other Web pages.

• CDF is a nice, simple XML vocabulary that combines with other kinds of data (from HTML documents to Microsoft Office files)

Page 58: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

XML, XSLXML, XSLhttp://www.umich.edu/~sheizaf/xml/grocerylist/grocery-http://www.umich.edu/~sheizaf/xml/grocerylist/grocery-list.xmllist.xml

Page 59: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

Sorting example at : Sorting example at : http://www.umich.edu/~sheizaf/xml/portfohttp://www.umich.edu/~sheizaf/xml/portfolioliohttp://gsb.haifa.ac.il/~sheizaf/xml/http://gsb.haifa.ac.il/~sheizaf/xml/portfolioportfolio

Page 60: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

XML and the Web serverXML and the Web server

Page 61: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

Unifying all (most) of Unifying all (most) of commercecommerce

Page 62: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

OFX - Open Financial OFX - Open Financial ExchangeExchange

• Wouldn't it be nice if there was one format for all financial data that every financial application and Web browser could display? Meeting that need is the goal of OFX.

• The Open Financial Exchange is a set of markup developed by Microsoft, Intuit, and CheckFree to facilitate the exchange of financial data among banks, consumers, and software. While both Microsoft and Intuit have built-in tools to convert Money data to Quicken data and back again, and some banks can convert their data to both Money and Quicken, it makes more sense (and saves time) for everyone to have the same data format.

• CheckFree is interested in a common format for financial information because it is an electronic check system that works with both Quicken and Money, as well as several online banking systems. Even if there are conversion tools available, if everyone is using a different format for data there's always a risk that some data will be lost or not shared correctly. A single XML vocabulary for describing industry data is the best solution.

• OFX is a good example of how competitors (Microsoft and Intuit) realized that a proprietary file format impedes information sharing, and that users want their information available to them in as many ways as possible. The two competitors are working together with others in their industry to find a standard way to describe data. Once they come to an agreement on data description, they will focus their energies on building a software tool that provides their users the best interface to that data.

• OFX documents provide only the financial information. A total OFX solution includes a user interface to the information and a server to house and disseminate that information. The interface can be Web-based or not (a bank's Web site or the Quicken interface), and there are several service bureaus that already support OFX solutions. In the end, OFX is simply an industry-specific common data format for use by a variety of companies who have data they need to exchange in a consistent manner.

• Open Financial Exchange Resources

OFX Site: http://www.ofx.net

Page 63: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

XML Schema Repositories

• many argue that centralized collections of DTDs, called schema repositories , have a definite place in the XML world. (In this context schema refers to DTDs and XML vocabularies).

BizTalk.org from Microsoft XML.org from the Organization for the

Advancement of Structured Information Standards (OASIS)

Page 64: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

XHTMLXHTML

XHTML 1.0 is nothing more than a reformulation of HTML using the rules of XML. In a nutshell this means that XHTML documents use the same tags that were included in HTML 4.01, but they must be well-formed documents.

Page 65: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

Potential PitfallsPotential Pitfalls

• Insecure linesInsecure lines

• TrustTrust

• Low switching costsLow switching costs

• AcceptanceAcceptance

• Investment in EDIInvestment in EDI

• Elimination of price discriminationElimination of price discrimination

Page 66: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

Opportunities Opportunities • Low cost allows easy switching of suppliersLow cost allows easy switching of suppliers

• Greater integration of supply chainGreater integration of supply chain

• Possible disintermediation/re-Possible disintermediation/re-intermediationintermediation

• Opportunities for distributorsOpportunities for distributors

• Low entry cost for small/mid-sized firmsLow entry cost for small/mid-sized firms

• Importance of differentiation/brandingImportance of differentiation/branding

Page 67: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

Tools for XMLTools for XML

• What do XML tools do?What do XML tools do?– Read an XML document and make the

information in it available to programming interfaces, Web browsers, or other processing devices

Display it or converting it to another XML markup language

Build style sheets, convert to other markup languages

Database for storing data (described with XML or not)

Page 68: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

Tools for XMLTools for XML

Building XML DTDs Writing XML documents Creating style sheets

for XML display or transformation

Storing data in databases

Reading and processing XML documents

Browsing XML

Page 69: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

Tools for XMLTools for XML

• Tools are rapidly becoming available. A few examples:

Parsers: Lark, XP, Ælfred, MSXML, NXP, IBM XML...

Jumbo - the first browser. Microsoft IE4 and higher DataChannel XML Development Environment

(DXDE). Rivcom XML Netscape plugin. JavaBeans implementation from Sun. Netscape Communicator 5 and higher

Page 70: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

Additional examplesAdditional examples

• Grocery list (1,2)Grocery list (1,2)

• ChessChess

• Product listProduct list

• PortfolioPortfolio

• LanguageLanguage

• AuctionsAuctions

Page 71: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

ResourcesResources• The XML industry portal:The XML industry portal:

http://www.xml.orghttp://www.xml.orghttp://www.xml.comhttp://www.xml.comhttp://www.w3.org/XML/ http://www.w3.org/XML/

• The XML FAQThe XML FAQhttp://www.ucc.ie/xmlhttp://www.ucc.ie/xml

• http://www.xmlsoftware.comhttp://www.xmlsoftware.comhttp://www.xmlbooks.http://www.xmlbooks. Com Com

• The Project Cool GuideThe Project Cool Guideto XML for Web Designersto XML for Web Designershttp://www.projectcool.com/guide/xml/http://www.projectcool.com/guide/xml/

Page 72: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

ResourcesResources

• Most information can be found via the W3C Web Pages:

http://www.w3.org/XML/

• Including how to get recommendations and draft recommendations.

• Also useful: http://www.xmlinfo.com http://www.sil.org/sgml/xml.html

Page 73: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

ResourcesResources

• XMLsoftware.com is maintained by James Tauber and groups XML software by functionality.

• . The XML Cover Pages (http://xdev.datachannel.com/directory/xml_101/checklist.html)http://xdev.datachannel.com/directory/xml_101/checklist.html) lists a variety of freely available XML packages.

• XML.com often spotlights specific XML tools and includes a products and services directory.

Page 74: Prof. Sheizaf Rafaeli E-Commerce XML in E-Commerce Prof. Sheizaf Rafaeli E-Commerce

Prof. Sheizaf RafaeliE-Commerce

ConclusionsConclusions

Check out: http://www.xml.org

http://www.oasis-open.org/cover/