Title: XML Technology in ECommerce
1XML Technology in E-Commerce
- Lecture 1
- WWW, HTML, CSS, XML, Meta-modeling
2Lecture Outline
- World Wide Web - facts, architecture
- HTML
- CSS
- XML
- Markups
- Well-formedness
- Meta-modeling
3World Wide Web
- WWW
- Global hypertext project at CERN
- Proposed by Tim Berners-Lee in 1989
- Web Consortium (W3C) - www.w3.org
- Founded in 1994
- Three hosts - MIT, INRIA, Keio University
- Leads the evolution of the Web
- More than 20 web-related specifications
4World Wide WebArchitecture
HTTP request for Web Resource
Web Browser
Web Server
HTTP response - usually a Web page
- HTTP - Hypertext Transport Protocol
- HTML - Hypertext Markup Language
- URI - Uniform Resource Identifier - a naming
scheme for resources on the Web
5HTMLExample
lthtmlgt ltheadgt lttitlegt XML Technology in
E-Commercelt/titlegt lt/headgt ltbodygt
lth1gtLecture 1lt/h1gt ltpgt Example of HTMLlt/Pgt
ltpgt Resources lta hrefhttp//www.w3.orggt W3C
lt/agt Web Consortiumlt/pgt lt/bodygt lt/htmlgt
Other Examples - Deitel 2.4, page 26 3.2, page
47
6HTMLForms
- Enable development of web applications - user
interface is presented by the browser - Web server handles form data through server
extensions - Opens a possibility for dynamic web pages
- CGI (Common Gateway Interface) - protocol for
data exchange between the server and its
extensions (CGI scripts) - Popular languages for CGI programming - Perl, C,
Python, Java, VBScript, JavaScript
Examples - Deitel 3.4, page 52
7HTMLLinks
Web Resource
Web page
- Link has two ends (anchors) and direction
- A element - sets up an anchor
- lta hrefhttp//java.sun.comgtJava Homelt/agt sets
up a source anchor. href attribute contains an
URI - lta namedestgt TOC lt/agt - sets up a destination
anchor - Link behavior - destination resource is retrieved
and displayed
8HTMLltmetagt tags usage
- Meta data about the document
- ltmeta nameauthor contentJohn Smithgt
- ltmeta nameaddress contentan addressgt
- HTTP response headers
- ltmeta http-equivrefresh content1000
http//www.foo.comgt - Data for search agents
- ltmeta namekeywords contentXML, WEBgt
9HTMLMultimedia, extra functionality, editors
- Multimedia content - plug-in and ActiveX
technology - Scripts - dynamic and interactive web pages on
the client side - Java Applets - programs executed in the browser
environment - HTML editors - FrontPage, Dreamweaver, NetObjects
Fusion, Adobe GoLive - Demo Editing web pages with FrontPage
10CSSCascading Style Sheets
- Purpose - specify the layout of web pages
- Benefits
- Separate structure from presentation
- Impose consistent look and feel to the entire
site - Promotes reusability
- Specifications
- CSS level 1 and 2
- CSS level 3 - work in progress
11CSSDeclaration
- Inline styles
- ltp stylefont-size 20 pt color bluegt some
text lt/pgt - style element
- ltstyle typetext/cssgt
- p font-size 20pt color blue
- lt/stylegt
- External style sheets
- ltheadgt
- ltlink relstylesheet typetext/css
hrefaStyle.cssgt - lt/headgt
12CSSCascading and Inheritance
- Style origin
- User agent (browser) default style sheet
- User style
- Author style
- Cascading order - how to resolve conflicts
between style rules - Inheritance - an element inherits style
properties from its ancestors
More info - Deitel 4.4, page 84
13XMLXML, HTML, SGML
- HTML Drawbacks
- Fixed Tags Set
- Poor Linking
- Does not support validation
- Simple structures
- Specifies only presentation
Relations between SGML, HTML and XML
14XMLIdea
ltaddressgt
Sherlock Holmes
ltnamegt
lt/namegt
Baker Street 221b
ltstreetgt
lt/streetgt
London
ltcitygt
lt/citygt
England
ltcountrygt
lt/countrygt
lt/addressgt
15XMLBasic terms
Annotated XML Specification http//www.xml.com/ax
ml/testaxml.htm
16XMLCharacters and Markups
- Characters in the XML document form markups and
character data - Markups
- start, end and empty element tags
- entity and character references
- comments
- CDATA delimiters
- Document type declarations
- Processing Instructions
- All other characters form character data
17XMLElements and elements content
- ltname attr1value1 gt..Content..lt/namegt
Elements content
Attribute specification
End tag
Start tag
ltimg srcanImage.gif /gt - Empty element
- Elements content
- Only elements
- Empty
- Mixed (character data and other elements)
18XMLExample
- ltperson age45gt
- ltnamegtSherlock Holmeslt/namegt
- ltaddressgt
- ltstreetgtBaker Street 221blt/streetgt
- ltzipgt1111lt/zipgt
- ltcitygtLondonlt/citygt
- ltcountrygtEnglandlt/countrygt
- lt/addressgt
- lthomepage hrefhttp//www.sherlock-holmes.co.u
k//gt - ltnotegtltemgtSherlock Holmeslt/emgt and ltemgtDoctor
Watsonlt/emgt lived at 221b Baker Street between
1881-1904, according to the stories written by
ltemgtSir Arthur Conan Doylelt/emgt.lt/notegt - lt/persongt
19XMLProcessing Instructions and CDATA Sections
- Processing Instructions
- lt?xmlstylesheet type"text/css"
href"bach.css"?gt - lt?cocoon-process type"xslt"?gt
- CDATA Sections
- lt!CDATA ltH1gt Hello World! lt/H1gt gt
- lt!CDATA
- if((x0) (y lt2)) System.out.print
ln(Ok!) - gt
20XMLNamespaces
- Purpose - resolve name collisions in a single XML
document - Definition - Set of names uniquely identified by
URI, used for element types and attribute names - Namespace declaration
- lthtmlhtml xmlnshtmlhttp//www.w3.org/TR/REC-ht
ml40gt - lthtmlheadgt.lt/htmlheadgt
- lthtmlbodygt.lt/htmlbodygt
- lt/htmlhtmlgt
Examples - Deitel 5.8, page 123
21XML Meta-modelling - well-formedness
EBNF
EBNF
Defines
Defines
Pascal Grammar
XML Grammar
WF Constraints
Defines
Defines
a Pascal Program
an XML Document
22XML Meta-modelling - validity
23XML Tool Support
- Browser support
- Netscape - XML, CSS1, CSS2 (partly)
- IE 5 - XML, CSS1, CSS2 (partly), XSLT
- Opera - XML, CSS1, CSS2(partly)
- XML Editors
- XML Spy 3.5
- XMetal
- Epic
- FrameMaker
- Demo Visualizing XML files in IE5, editing with
XML Spy
24Summary
- Todays Web - HTTP, URI, HTML, CSS
- XML is a technology for creating markup
languages - XML documents contain character data and markups
- Elements are the main building blocks for the
document structure - Document well-formedness means conformance to the
XML grammar and constraints
Read Deitel 1..5, Well-formedness and Validity
of XML Documents Skip Deitel 3.3, 3.5, 3.7, 3.9,
3.10, 4.6 .. 4.10 Assignment Deitel Ex 5.4 and
Ex 5.7, pages 132, 133