enter - Carleton University
Download
Report
Transcript enter - Carleton University
Pervasive e-commerce with
XML
Babak Esfandiari
Carleton University
Ottawa, Canada
XML introduction
eXtensible Markup Language
“a markup language for documents
containing structured information” (Walsh)
this structure is defined mainly with a set of
tags
subset of SGML
HTML can be seen as an instance of XML (it is
not really though, but that is not important…)
XML example
<?xml version="1.0" ?>
<!-- a simple tagset for museums>
<Museum name="Louvre">
<city> Paris
</city>
</Museum>
DTD
Document Type Definition
Describes the XML tagset
<!DOCTYPE Museum [
<!ELEMENT Museum (city)>
<!ATTLIST Museum name CDATA #REQUIRED>
<!ELEMENT city (#PCDATA)>
]>
Not mandatory (!)
XML - what for?
content is independent from rendering
meta-data makes search easier
standard tags enable data interchange
across tools
format for data and object persistence,
human readable and editable
no need for a custom parser anymore
TourTags
“The purpose of TourTags.org is to
foster dialogue within the community in
order to arrive at open standards for
conducting electronic commerce by
settling on common tag sets and
methods in which they are to be used.”
supports IFITT’s RMSIG
XML and TourTags
derive a tagset from RMSIG specs
discuss/modify the tagset
use the tagset for B2B (ebXML)
allow device-neutral access to business
info
we have a process…
The Acronym Hell Diagram
our process is a series of transformations
UML
HTML
ebXML
XML
XMI
XML/
DTD
meta-data
Web
form
registration
WML
Voice
XML
document
display
Meta-data
UML
Why not directly model tags?
XMI
Tags are not for modeling!
Lack of a graphical notation
Semantically poor:
XML/
DTD
Hard to represent relationships
XML can be seen as one
possible mapping of a model
The RMSIG has chosen UML…
Meta-data
UML
UML: Unified Modeling
Language
XMI
XML/
DTD
Object-oriented
Graphical
Covers:
Requirements
Static representation
Activities and processes
Meta-data
A UML class diagram:
UML
Museum
XMI
XML/
DTD
-name : String
City
Meta-data
UML
XMI
But we need the tags!
Is it possible to transform
UML into XML?
We can use XMI
XML/
DTD
XMI is the direct textual
representation of UML using the
XML format
Most UML tools support XMI
Meta-data
A sample XMI document:
<Class>
<name>Museum</name>
<feature>
<Attribute>
<name>name</name>
</Attribute>
</feature>
</Class>
UML
XMI
XML/
DTD
Meta-data
UML
XMI
XML/
DTD
We still need to transform XMI
into our XML tagset
Since a DTD describes the
structure of an XML document, it
is the ideal target!
What is the easiest way to do the
concrete transformation?
Transformations
Different methods:
Parsing: use existing XML parsing libraries
based on standard APIs (SAX, DOM) with a
programming language
Transformations:
specify the transformations in a (yet another)
XML document called an XSLT stylesheet
Use an XSLT processor (Saxon, XT, …)
XSLT example (excerpt)
<xsl:stylesheet>
<xsl:template match="Class">
blah <xsl:value-of select="name"/> blah
<xsl:apply-templates select="feature/Attribute"/>
</xsl:template>
<xsl:template match="feature/Attribute">
<xsl:value-of select="name"/>
</xsl:template>
</xsl:stylesheet>
XSLT example
The XSLT in the previous slide, applied on
the Museum XMI, should generate
something like:
blah Museum blah name
Nothing exciting but you get the idea!
Meta-data
UML
XMI
Some of the issues in the
transformation from XMI to DTD:
XML/
DTD
Ambiguity in choice of attributes and
elements -> open for discussion!
Inheritance: compound the inherited
attributes
Composition: recursively add subelements, or use separate documents
DTDs support for primitive types is
limited… XML schema an alternative
Registration
ebXML
The resulting DTDs can now be
used for B2B e-commerce
Web
form
We now have a domain “ontology” to
base transactions on!
We can use this ontology to:
Publish/advertize a business
Search for a business
We need a registry to enable that
Registration
ebXML
ebXML is one of the leading
consortiums for e-business
Web
form
It describes a standard for B2B registries
Third parties (TourTags?) have the
opportunity to create and host such
registries
To access such registries and allow
publishing and search, Web forms are
an intuitive front-end interface
Guess what…
Registration
ebXML
Web
form
We can use the DTDs and XSLT to
generate such web forms!
The web forms for publishing and
search are very similar
Each leaf element or attribute
becomes a field to fill in
Better support (than DTDs) for data
types would allow for a better
customization of the data fields
Museum name:
Registration
ebXML
Different deployment scenarios are
possible for registries:
Web
form
Traditional Client/server
Peer to peer
Decentralized
Less resource intensive
Document rendering
HTML
XML
WML
Voice
XML
The result of a registry
search is an XML document
that follows the structure
specified by our DTD
Such a document does not
contain any instructions for
rendering (i.e. display)
This is a good thing!
Search and rendering
rendering adapted to device:
HTML
XML
WML
Voice
XML
XML -> HTML for web browser
XML -> WML for cell phones
XML -> VoiceXML for regular
phones
Yes, we can use XSLT again!
No duplication of data!
No need to maintain
redundant documents!
Conclusion
A completely XML-based process that
takes us from the inception of a domain
ontology to the delivery of business info
The process relies on a series of
transformations
References
xml.org
rmsig.org
tourtags.org
ebxml.org
It had to be on the web!