technology for e-commerce overview xml fall 2000c.watters2 outline introduction history and overview...
TRANSCRIPT
Technology for e-Commerce
Overview
XML
Fall 2000C.Watters 2
Outline
• Introduction• History and Overview• Show me the Code!• Applications• Protocols• Conclusions
Fall 2000C.Watters 3
Introduction
What is XML?• eXtensible Markup Language• Related to both SGML and HTML
“XML is like HTML with the training wheels off”-Dan Connolly, leader of XML activity at W3C
Fall 2000C.Watters 4
XMLUses tags to identify semantics of data• looks like HTML, but isn’t<slide><title>Introduction</title> <author><first>Carolyn</first>
<last>Watters</last> </author>
<content>XML this and that</content></slide>• is license free, platform-independent and well-
supported
Fall 2000C.Watters 5
SGML-HTML-XML??
The great ancestor of markup languages
SGML (Standardized General Markup Language)
Grammar is implemented using <tag>data</tag>
Grammar is defined by a Data Type Definition (DTD)
XML & HTML are cousins!
Fall 2000C.Watters 6
<HTML>
<TITLE>Statistics Canada</TITLE>
<BODY>
<H3>Welcome to Stats Canada</H3>
Statistics Canada ……. . <p> We like numbers…..
<img src=“mapleleaf.gif>
<ul>What we do
<li><a href=“census.html”>Census</a>
<li><a href=“special.html”>Special surveys</a>
<li>a href=“online.html”>Online data</a>
</ul>
</BODY>
</HTML>
Fall 2000C.Watters 7
HTMLHTML - Advantages• Simple - fixed set of tags• Portable - used with all browsers• Linking - within and to external documents
HTML - Disadvantages• Limited tag set• Can’t separate the definition from content• Can’t define structure of contents
Fall 2000C.Watters 8
XML
XML allows anyone to define a document structure separate from its display structure
• Explicit Definition - DTD
Fall 2000C.Watters 9
Some CodeSome Code
Schema• Entity
– Passport Details
• SubEntities– Last Name– First Name– Address
• Entity– Address
• SubEntities– Street– City– Town– State– Province– ……..
Fall 2000C.Watters 10
<!ELEMENT passport_details (last_name,first_name+,address)>
<!ELEMENT last_name (#PCDATA)>
<!ELEMENT first_name (#PCDATA)>
<!ELEMENT address (street,(city|town),(state|province),(ZIP|postal_code),country,contact_no?,email*)>
<!ELEMENT street (#PCDATA)>
<!ELEMENT city (#PCDATA)>
<!ELEMENT town (#PCDATA)>
<!ELEMENT state (#PCDATA)>
<!ELEMENT province (#PCDATA)>
<!ELEMENT ZIP (#PCDATA)>
<!ELEMENT postal_code (#PCDATA)>
<!ELEMENT country (#PCDATA)>
<!ELEMENT phone_home (#PCDATA)>
<!ELEMENT email (#PCDATA)>
DTD
Fall 2000C.Watters 11
Internal DTD and InstanceInternal DTD and Instance
<?xml version='1.0'?>
<!DOCTYPE passport_details [
<!ELEMENT passport_details (last_name,first_name+,address)>
<!ELEMENT last_name (#PCDATA)>
<!ELEMENT first_name (#PCDATA)>
<!ELEMENT address (street,(city|town),(state|province)
,(ZIP|postal_code),country,contact_no?,email*)>
<!ELEMENT street (#PCDATA)>
<!ELEMENT city (#PCDATA)>
<!ELEMENT town (#PCDATA)>
<!ELEMENT state (#PCDATA)>
<!ELEMENT province (#PCDATA)>
<!ELEMENT ZIP (#PCDATA)>
<!ELEMENT postal_code (#PCDATA)>
<!ELEMENT country (#PCDATA)>
<!ELEMENT phone_home (#PCDATA)>
<!ELEMENT email (#PCDATA)>
]>
<passport_details>
<last_name>Smith</last_name>
<first_name>Jo</first_name>
<first_name>Stephen</first_name>
<address>
<street>1 Great Street</street>
<city>GreatCity</city>
<state>GreatState</state>
<postal_code>1234</postal_code>
<country>GreatLand</country>
<email>[email protected]</email>
</address>
</passport_details>
Fall 2000C.Watters 12
Shared DTDShared DTD
XML Document specifies the DTD<?xml version='1.0'?>
<!DOCTYPE passport_details SYSTEM "PassportExt.dtd">
<passport_details>
<last_name>Smith</last_name>
<first_name>Jo</first_name>
<first_name>Stephen</first_name>
<address>
<street>1 Great Street</street>
<city>GreatCity</city>
<state>GreatState</state>
<postal_code>1234</postal_code>
<country>GreatLand</country>
<email>[email protected]</email>
</address>
</passport_details>
Fall 2000C.Watters 13
XML into HTML
• Need to convert XML tags into appropriate HTML tags for use in a browser!!
• <lastname>Smith</lastname>
• <b>Smith</b>
Fall 2000C.Watters 14
CSS and XSL
• CSS - Cascading Style Sheets– can predefined HTML display (font etc)– these are shared and reused
• XSL - XML Style language– predefine display characteristics for XML
entities– transform into CSS for browsers to use
Fall 2000C.Watters 15
Cascading Style SheetsCascading Style Sheets
CSSlast_name
{
font-family: verdana, arial;
font-size: 15pt;
font-weight:bold;
display: block;
margin-bottom: 5pt;
}
first_name
{
font-family: verdana, arial;
font-size: 15pt;
font-weight:bold;
display: block;
margin-bottom: 5pt;
}
street, city, town, state, province, ZIP, postal_code
{
font-family: verdana, arial;
font-size: 12pt;
font-weight:bold;
color:green;
display:block;
margin-bottom: 20pt;
margin-top: 40pt;
}
{
font-family: verdana, arial;
font-size: 12pt;
font-weight:bold;
color:blue;
display:block;
margin-top: 5pt;}
Fall 2000C.Watters 16
<?xml version='1.0'?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/TR/WD-xsl"
xmlns="http://www.w3.org/TR/REC-html40"
result-ns="">
<xsl:template><xsl:apply-templates/></xsl:template>
<xsl:template match="/">
<html>
<head>
<title><xsl:value-of select="/passport/last_name"/></title>
</head>
<body>
<H1><xsl:value-of select="/pastport/last_name, first_name"/></H1>
<H2>Address</H2>
<BLOCKQUOTE>
<xsl:apply-templates select="/passport/address"/>
</BLOCKQUOTE>
</body>
</html>
XSL (Style Language)
Fall 2000C.Watters 17
• Coordinating Heterogenous Databases
• Separation of Structure / Content / Display
• Document Validity Checking
• Potential Use in Standards
Importance of XML
Fall 2000C.Watters 18
Example
Boeing
• Boeing places a DTD on its site
• part purchasers use this DTD
• Boeing can use multiple XSL stylesheets
Fall 2000C.Watters 19
Boeing (cont’d)
• customer creates an order document, they can verify the validity of that document against the DTD.
• this ensures they are transmitting only type-valid orders.
• in turn, Boeing can ensure they are receiving only type-valid documents.
Fall 2000C.Watters 20
Examples of Evolving Industry XML Standards
• XML/EDI• Open Financial Exchange (OFE)• Open Trade Protocol (OTP)
• HL7 (Health Level 7) Kona Proposal
• Resource Description Format (RDF)
Industry-wide DTDsIndustry-wide DTDs
Fall 2000C.Watters 21
• A unified specification for the electronic exchange of financial data between financial institutions, businesses and consumers via the Internet.
• Supports consumer and small business banking, bill payment, bill presentment and investments, including stocks, bonds, and mutual funds.
Open Financial Exchange
Fall 2000C.Watters 22
• Global Standard for all forms of trade on the Internet
• Provides consistent consumer purchasing experience regardless of the payment instrument or software and hardware product used.
• Specifies how Internet transactions can occur, independent of the method of payment
Open Trade Protocol
Fall 2000C.Watters 23
• Differs from Secure Electronic Transaction (SET).
• OTP complements, but does not replace other protocols.
• Provides consumers with a record of purchases for tax purposes, make expense claims, etc.
• Provides the same factual transaction for the virtual world.
Open Trading Protocol
Fall 2000C.Watters 24
<!DOCTYPE Transaction [
<!-- ELEMENT CONTENT --><!ELEMENT Payment (CredCardPay / OtherPay),
Amount, Payer, Payee)
<!ELEMENT CredCardPay (Cardtype, CardNo, Expdate, CardHolder)
<!ELEMENT OtherPay ANY
<!ELEMENT Amount (CredCardPay / OtherPay), Amount, Payer, Payee)
<!ELEMENT Payer (Email, (Name)?, Address)?)
OTP DTD
Fall 2000C.Watters 25
• In the major Web Browser products.• In Microsoft Office 2000.• In every major database tool by end of 2000.• In every HTML tool by end of 2000.• CommerceNet believes that XML may just be
the “killer application” needed to open up the Worldwide Web for Electronic Commerce.
Is this for real?
Fall 2000C.Watters 26
XML - Advantages• Platform and system independent• User-defined tags• Doesn’t require explicit DTD• Display format and content are separate
XML - Disadvantages• Requires a processing application• “Pickier” than HTML• Must be converted to HTML to view in browser
Summary
Fall 2000C.Watters 27
• W3 Consortium: www.w3.com
• kazillions of XML books in every bookstore!
Resources