Introduction To XML: Frank Tompa and Airi Salminen University of Waterloo (Fwtompa, Asalminen) @DB - Uwaterloo.ca
Introduction To XML: Frank Tompa and Airi Salminen University of Waterloo (Fwtompa, Asalminen) @DB - Uwaterloo.ca
Slide 0
July 11, 2001
Introduction to XML
Urgent need for a new, common data format for the Internet
Intro to XML
Slide 3
July 11, 2001
1. Why XML evolved
Needs:
• Simple, common rules that are easy to
understand by people with different
backgrounds (like HTML)
• Capability to describe Internet resources and
their relationships (like HTML)
• Capability to define information structures
for different kinds of business sectors (unlike
HTML, like SGML)
Intro to XML
Slide 4
July 11, 2001
1. Why XML evolved
Needs (cont’d):
• Format formal enough for computers and
clear enough to be human-legible (like
SGML)
• Rules simple enough to allow easy building
of software (unlike SGML)
• Strong support for diverse natural languages
(unlike SGML)
Intro to XML
Slide 5
July 11, 2001
2. What is XML?
XML = Extensible Markup Language
A set of rules for defining and representing
information as structured documents for applications
on the Internet; a restricted form of SGML
T. Bray, J. Paoli, and C. M. Sperberg-McQueen (Eds.), Extensible
Markup Language (XML) 1.0,
W3C Recommendation 10- February-1998,
http://www.w3.org/TR/1998/REC-xml-19980210/.
• Notations
• Entities
Intro to XML
Slide 13
July 11, 2001
3. XML 1.0 fundamentals
Conformance:
• Well-formed:
– syntactically correct tags
– matching tags
– nested elements
– all entities declared before they are used
• Valid:
– well-formed
– DTD + doctype matches DTD
– unique IDs
– no dangling IDREFs
Intro to XML
Slide 14
July 11, 2001
3. XML 1.0 fundamentals
XML
document
application
Intro to XML
Slide 15
July 11, 2001
3. XML 1.0 fundamentals
Example:
eXtensible Customer Information Language (xCIL)
• OASIS Customer Information Quality Committee
“… reliable and accurate customer information is now more
than ever essential in establishing effective customer
relationships ... need to develop a standard way of
describing Customers (e.g., Identity, Name, Address, etc.).”
• Built on
– eXtensible Name and Address Language (XNAL)
– two sub DTDs
eXtensible Name Language (xNL)
eXtensible Address Language (xAL)
Examples:
• XML Names: to allow qualified names
• XML Schema: extends the definition capabilities
• XPath: for addressing parts in XML documents
• XLink: to create hyperlinks between resources
Intro to XML
Slide 18
July 11, 2001
4. XML family of languages
XML Transducer
Examples:
• XSLT: for document transformations
• CSS: for rendering
• XQuery: for querying
Intro to XML
Slide 19
July 11, 2001
4. XML family of languages
XML Application
Defines constraints for a class of XML data
Intended for a specific application area
XML in an organization
Various ways XML might occur:
• Encoding format for uninterpreted data
• Format for data interchange
• Format for managing information assets
Intro to XML
Slide 21
July 11, 2001
5. How to use XML
Uninterpreted data
• Data accessed from the Internet and
forwarded with little or no processing to
another application
Intro to XML
Slide 22
July 11, 2001
5. How to use XML
Data interchange
• Encoding of data
– on import, useful for dissecting data
– for export, provides added value to users
• Encoding of protocols
– designating functions and marshalling arguments
Information assets
• Maintained in an XML document repository
• Requires either development of proprietary
procedures for accessing and maintaining
assets or adoption (and adaptation) of rules
developed elsewhere
• May require major changes in organization’s
work processes
Intro to XML
Slide 24
July 11, 2001
6. Naming conventions
Names play a key role
• For elements, attributes, entities and notations
• May be introduced (and limited) by a DTD
XML namespaces
Provides a method for qualifying element
and attribute names so that name collisions
can be avoided
Motivation: modularity and documentation
If a well-understood markup vocabulary for
element and attribute names exists, it should be
re-used rather than re-invented, especially if
there is also software available.
Intro to XML
Slide 27
July 11, 2001
6. Naming conventions
XML namespaces
Collection of names, identified by a URI
• No formal rules for defining names in a namespace
Example
• Namespace: http://uwaterloo.ca
• Element names: department, name, professor, student,
last_name, first_name, ...
• Global attribute names: id, ...
• Per-element-type attribute names: student: supervisor, ...
Intro to XML
Slide 28
July 11, 2001
6. Naming conventions
<a href="http://www.w3.org/TR/html401/struct/links.html#links">Introduction
to links and anchors</a>
descendant-or-self::node( ) / child::book[attribute::year=2000] /
child::price
//book[@year=2000]/price
Intro to XML
Slide 35
July 11, 2001
7. Hypertext facilities
XLink’s simple link
• One arc only
• From (implicit) local resource to remote resource
• May also include metadata
Example: <icr:attendees
xmlns:icr="http://icr.uwaterloo.ca/"
xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:type="simple"
xlink:href="students.xml"
xlink:role="http://icr.uwaterloo.ca/courses/attendees"
xlink:title="Attendee List for XML Short Course"
xlink:show="new"
xlink:actuate="onRequest">
Participants from Industry
</ icr:attendees >
Intro to XML
Slide 36
July 11, 2001
7. Hypertext facilities
XLink’s extended link
• Associates an arbitrary number of resources
• Any combination of remote and local resources
• Separate elements specify resources and arcs
– <… xlink:type="locator" xlink:label="..." …> for remote resources
– <… xlink:type="resource" xlink:label="..." …> for local resources
– <… xlink:type="arc" xlink:from="..." xlink:to="..." …> for arcs
Examples:
• eCatalog XML (eCX): a DTD for catalogs,
developed to address the problem of exchanging
product information between different catalog
systems; version 2.0 published May 2000.
• Open Catalog Protocol and Format (OCP/OCF) a
software protocol to exchange complex data between
product catalogs and a DTD for a catalog.
Intro to XML
Slide 43
July 11, 2001
9. Applications
• BASDA eBIS-XML: for exchange of standard
business documents; enables the direct exchange of
purchase orders and invoices and other business
documents between different software packages, via
e-mail and the Internet, without the need for EDI
(Electronic Data Interchange) middleware
• ebXML: to enable a global electronic marketplace
“where enterprises of any size and in any
geographical location can meet and conduct business
with each other through the exchange of XML based
messages”
Intro to XML
Slide 44
July 11, 2001
9. Applications
• Electronic Commerce Modeling Language (ECML):
a set of hierarchical payment oriented structures “to
enable automated software, including electronic
wallets, from multiple vendors to supply needed data
in a more uniform manner”; ECML v2 DTD
published in Feb. 2001
• VISA XML Invoice Specification: a DTD for VISA
invoices, “intended to increase a corporation's ability
to automate B2B purchasing functions and monitor
travel and entertainment expenses worldwide”
Intro to XML
Slide 45
July 11, 2001
9. Applications
Discussion