xml
Shared by: ajizai
-
Stats
- views:
- 50
- posted:
- 9/18/2012
- language:
- Unknown
- pages:
- 31
Document Sample


XML
A brief introduction
---by Yongzhu Li
SUNY Albany Computer Science Department
XML
eXtensible Markup Language
designed to describe data.
a family of technologies
platform-independent
free and extensible
CSI668
XML 2
Topics in System Architecture --- a brief introduction
SUNY Albany Computer Science Department
Basic Concept
a markup language is a mechanism to
identify structures in a document.
the XML specification defines a
standard way to add markup to
documents.
a meta-language for describing markup
languages
provides a facility to define tags and
the structural relationships between
CSI668
them
Topics in System Architecture
XML
--- a brief introduction 3
SUNY Albany Computer Science Department
Background
SGML
Standard Generalized Markup Language (ISO
8879)
provides arbitrary structure, but too difficult to
implement just for a web browser.
HTML
A subset of SGML with a fixed tag semantics
and set, lack of flexibility and extensibility
Lack of extensibility
CSI668
XML 4
Topics in System Architecture --- a brief introduction
SUNY Albany Computer Science Department
Background II
XML
simplified SGML, extensible
looks like HTML but isn't HTML
any fully conformant SGML system will
be able to process XML documents
but, XML documents does not require a
system that is capable of the full
conformance of SGML
CSI668
XML 5
Topics in System Architecture --- a brief introduction
SUNY Albany Computer Science Department
Evolving History
W3 Consortium began work in Aug.
1996
XML 1.0
Released by W3C on Jan. 10, 1998
XML 2.0
Introduced on Oct. 6, 2000
XML 3.0
Under drafting and evaluating
CSI668
XML 6
Topics in System Architecture --- a brief introduction
SUNY Albany Computer Science Department
What XML looks like
prolog --- XML file declaration
<?xml version=“1.0”?>
comment
<!-- any comments -->
processing instruction, PI
<?xml-stylesheet type="text/css"
href="first.css"?>
element and its attribute
<price currency ="$">15.50</price>
CSI668
XML 7
Topics in System Architecture --- a brief introduction
SUNY Albany Computer Science Department
First Sample
a single XML document
single XML file
only provide
structured data
No formatting
information
browser don’t
know how to
display
CSI668
XML 8
Topics in System Architecture --- a brief introduction
SUNY Albany Computer Science Department
CSS
Cascading Style Sheets
also work well with HTML
delaring CSS within XML file
<?xml-stylesheet type="text/css"
href="first.css"?>
separate data content with its form
only provide formatting information,
lack of manipulation on data
CSI668
XML 9
Topics in System Architecture --- a brief introduction
SUNY Albany Computer Science Department
First Sample II
Formated Source CSS file
CSI668
XML 10
Topics in System Architecture --- a brief introduction
SUNY Albany Computer Science Department
Interesting CSS
Cascading layers sample
z-index XML
CSS
position
CSI668
XML 11
Topics in System Architecture --- a brief introduction
SUNY Albany Computer Science Department
Interesting CSS II
Filter sample
filter:glow(color=blue, Strength=5); XML
CSS
CSI668
XML 12
Topics in System Architecture --- a brief introduction
SUNY Albany Computer Science Department
XSL
eXtensible Stylesheet Language
declaring XSL within XML
<?xml-stylesheet type="text/xsl" href="first.xsl"?>
transform XML to HTML file
defining and formating XML parts
and patterns
far more sophisticated but powerful
than CSS
CSI668
XML 13
Topics in System Architecture --- a brief introduction
SUNY Albany Computer Science Department
XSL by Sample
Data Sorting XSL Source
Data Filter XSL Source
CSI668
XML 14
Topics in System Architecture --- a brief introduction
SUNY Albany Computer Science Department
Namespace
a collection of element type
and attribute names
distinguish between
duplicate element type and
attribute names
CSI668
XML 15
Topics in System Architecture --- a brief introduction
SUNY Albany Computer Science Department
Namespace Samples
<books xmlns:book=“books.dtd”
xmlns:journal =“journal.dtd”>
<book:title>
…..
</book:title>
<journal:title>
…..
</journal:title>
CSI668
XML 16
Topics in System Architecture --- a brief introduction
SUNY Albany Computer Science Department
Name Space Sample II
<html
xmlns:html=“http://www.w3.org/TR/R
EC-html40”>
<html:h1>some message</html:h1>
<html:a href=
mailto:yongzhu@cs.albany.edu>
email me</html:a>
CSI668
XML 17
Topics in System Architecture --- a brief introduction
SUNY Albany Computer Science Department
DTD
Documents Type Definition
a model for describing the
structure of information.
Well formed XML and Valid
XML
A valid XML must follow a
specific DTD
CSI668
XML 18
Topics in System Architecture --- a brief introduction
SUNY Albany Computer Science Department
Why DTD
Independent organizations
use a common DTD for
interchanging data.
applications use DTD to
verify the data received from
the outside world is valid.
CSI668
XML 19
Topics in System Architecture --- a brief introduction
Eric: SUNY Albany Computer Science Department
Parsable
DTD II
Character Data
Declaring DTD within XML
<!DOCTYPE books SYSTEM
“book.dtd”>
Element Declaration within DTD
<!Element title (#PCDATA)>
<!Element book (title,author+, press,
price)>
<!Element books (book*)>
Attribute Declaration
<!ATTLIST price currency ($|€|¥)’$’>
CSI668
XML 20
Topics in System Architecture --- a brief introduction
SUNY Albany Computer Science Department
DTD Weakness
written in a different (non-XML)
syntax.
don’t support namespace
only offer extremely limited data
types.
have a complex and fragile
extension mechanism
CSI668
XML 21
Topics in System Architecture --- a brief introduction
SUNY Albany Computer Science Department
Schema
replacement of DTDs for XML
more primitive data types
namespace support.
itself is a well formed XML
and validated by Schema
DTDs
CSI668
XML 22
Topics in System Architecture --- a brief introduction
SUNY Albany Computer Science Department
XML Application Domain
Electronic Data Interchange
search engine
web application
distributed documentation
and computing
CSI668
XML 23
Topics in System Architecture --- a brief introduction
SUNY Albany Computer Science Department
Some other XML
applications
WML, Wireless Markup Language
CML, Chemistry Markup Language
and MathML
OSD, Open Software Description
OFX, Open Financial Exchange
CSI668
XML 24
Topics in System Architecture --- a brief introduction
SUNY Albany Computer Science Department
XML Application Structure
CSS/ XSL
Viewer #1 translation
Viewer #2
e.g. Retail Agent
e.g. Customer
CSS/ XSL XML Processor
translation Other process
Application Server
DB 1 DB 2 DB .. DB n
May be heterogeneous DBs
CSI668
XML 25
Topics in System Architecture --- a brief introduction
SUNY Albany Computer Science Department
DOM
Document Object Model
program interface for XML
represents a tree view of the XML
documentElement as a root
childNode for other branch
each node is an object
Node Interface Model
CSI668
XML 26
Topics in System Architecture --- a brief introduction
SUNY Albany Computer Science Department
SAX
the Simple API for XML
another programming interface for
XML
event-based API
use call-back functions to handle
parsing event
SAX and DOM are two major APIs for
XML application development.
CSI668
XML 27
Topics in System Architecture --- a brief introduction
SUNY Albany Computer Science Department
SVG
Scalable Vector Graphic
XML application
describe two-dimensional vector
graphic shapes, images and text
reduced the network traffic
reduced server overload
VML by Microsoft and PGML by
Adobe
CSI668
XML 28
Topics in System Architecture --- a brief introduction
SUNY Albany Computer Science Department
XHTML
eXtensible HTML
HTML defined by XML
well-formed HTML
tag names must be in lowercase
CSI668
XML 29
Topics in System Architecture --- a brief introduction
SUNY Albany Computer Science Department
Things under going…
Xlink and Xpointer
allows elements to be inserted into XML in order
to create and describe links between resources
provide multi-directional hypertext and hypermedia
support
proposal recommendation on Dec. 20, 2000
XML Protocol
to develop technologies which allow two or more
peers to communicate in a distributed
environment, using XML as its encapsulation
language.
requirement draft on Dec. 19, 2000
CSI668
XML 30
Topics in System Architecture --- a brief introduction
Thank You
谢谢
Get documents about "