Grenoble Ecole de Management MEDFORIST Workshop XML in Brief - PowerPoint PPT Presentation

1 / 29
About This Presentation
Title:

Grenoble Ecole de Management MEDFORIST Workshop XML in Brief

Description:

Yet, it has quickly become the fundamental instrument in the development of Web ... FTP, E-mail, Gopher. TCP/IP. Connectivity. Innovation. A. Dogac ... – PowerPoint PPT presentation

Number of Views:50
Avg rating:3.0/5.0
Slides: 30
Provided by: asuman9
Category:

less

Transcript and Presenter's Notes

Title: Grenoble Ecole de Management MEDFORIST Workshop XML in Brief


1
Grenoble Ecole de ManagementMEDFORIST
WorkshopXML in Brief
  • Asuman Dogac
  • Middle East Technical University
  • Ankara Turkey
  • asuman_at_srdc.metu.edu.tr

2
XML
  • Extensible Markup Language has become the
    universal standard for representing data
  • XML started out as a standard data exchange
    format for the Web
  • Yet, it has quickly become the fundamental
    instrument in the development of Web-based online
    information services and electronic commerce
    applications
  • Almost all recent electronic commerce standards
    are based on XML

3
XML
  • A subset of SGML (Standard Generalized Markup
    Language) it is defined by World Wide Web
    Consortium
  • HTML enables a universal method of displaying
    data XML provides a universal method of
    describing data
  • Provides the ability to describe data in an open
    text-based format and deliver it using standard
    http protocol

4
XML
  • At present, many applications on the Web use XML
    for hosting large amounts of structured and
    semi-structured data
  • Representation of information in XML documents
    has been increasing at an astonishing pace
  • According to Meta Group, by 2003, about 65 of
    corporate data will be stored in an XML format

5
XML The Unifying Technology
XML Messaging
Internet
6
Maturity of Web Infrastructure
Technology
Standard
Innovation
Browse the Web
Program the Web
7
XML helps address the challenge
  • The data is self-describing
  • e.g. the meaning of the data is included
    identifiers surround every bit of data,
    indicating what it means
  • Far more flexible method of representing
    transmitted information
  • e.g. batched orders sent together can have
    different fields and format without breaking apps
    on each end
  • Open, standard technologies for moving,
    processing and validating the data
  • e.g. the XML parser can automatically parse,
    validate, and feed the information to an
    application, instead of every application having
    to include this functionality

8
XML An Example
Data stream in a typical interface
Electronic Commerce, 100, Turban, 25,
Addison-Wesley
Same data stream in XML
ltBOOKgt ltTITLEgt Electronic Commerce
lt/TITLEgt ltQUANTITYgt 100 lt/QUANTITYgt ltAUTHORgtTurb
anlt/AUTHORgt ltPRICEgt25lt/PRICEgt ltPUBLISHERgtAddison
-Wesleylt/PUBLISHERgt lt/BOOKgt
9
Mark up (or Tagging)
  • XML uses textual markups to define data
  • An XML document is comprised of a collection of
    tagged elements each containing a start tag
    (lttagnamegt), an end tag (lt/tagnamegt), and the
    content between the two tags
  • Example
  • ltPONumbergt 1234ABCD lt/PONumbergt

10
Tagging Data in XML
  • ltPONumbergt 1234ABCD lt/PONumbergt
  • Considering the content only, it is not possible
    to understand what 1234ABCD stands for
  • The tag name PONumber intuitively tells that the
    content is a purchase order number
  • Similarly, an XML element might be tagged as
    name, gender, birth date, salary, price,
  • XML is extensible in the sense that users can
    create their own vocabularies, the tag names are
    neither predefined nor limited

11
Adding Structure to data
  • Tagged elements may be nested to any depth to
    provide structured data, or may be repeated to
    represent a list of values
  • A valid XML document usually contains a single
    root element, which constitutes the top-level of
    nesting
  • In other words, a valid XML document represents a
    tree of elements

12
Giving Meaning and Structure to Data
Start Tag
Start Tag
  • ltPurchaseOrderRequestgt
  • ltPONumbergt1234ABCD lt/PONumbergt
  • ltPurchaseOrderDategt20030601lt/PurchaseOrderDategt
  • ltLineItemgt
  • ltItemEAN_Identification no9344 /gt
  • ltQuantityOrderedgt 16 lt/QuantityOrderedgt
  • ltUnitPricegt 95 ltUnitPricegt
  • lt/LineItemgt
  • ltLineItemgt lt/LineItemgt
  • lt/PurchaseOrderRequestgt

An Element
Another Element
An Attribute
Data
End Tag
13
Giving Structure to Data
PurchaseOrderRequest
PurchaseOrderDate
LineItem
PONumber
ItemEAN_Identification
QuantityOrdered
UnitPrice
14
Document Type Definition (DTD)
  • The principle purpose of the DTD is to declare
    the hierarchy of document elements
  • A document type definition defines
  • The name of the elements,
  • The content model of each element,
  • How often and in which order elements may appear,
  • If the end-tags can be shortcut,
  • The possible presence of attributes and their
    default values,
  • The names of the entities

15
An Example DTD
  • lt?xml version1.0 encodingUTF-8?gt
  • lt!DOCTYPE simple
  • lt!ELEMENT PurchaseOrderRequest (PONumber,
    PurchaseOrderDate, LineItem)gt
  • lt!ELEMENT LineItem (ItemEAN_Identification,
    QuantityOrdered, UnitPrice)gt
  • lt!ELEMENT ItemEAN_Identification(PCDATA)gt
  • lt!ELEMENT QuantityOrdered (PCDATA)gt
  • lt!ELEMENT UnitPrice (PCDATA)gt
  • lt! --This is a comment line to state that the
    other elements are skipped --gt ...gt

16
DTDs
  • A DTD specifies the structure of an XML element
    by specifying the names of its sub-elements and
    attributes
  • Sub-element structure is specified using the
    operators
  • set with zero or more elements
  • set with one or more elements
  • ? optional
  • or
  • All values are assumed to be string values,
    unless the type is ANY in which case the value
    can be an arbitrary XML fragment

17
XML Namespaces
  • Namespaces are a simple and straightforward way
    to distinguish names used in XML documents, no
    matter where they come from
  • The only reason namespaces exist, is to give
    elements and attributes programmer-friendly names
    that will be unique across the whole Internet

18
Example
  • lthhtml xmlnsxdc"http//www.xml.com/books"
  • xmlnsh"http//www.w3.org/HTML/1998/html4"gt
  • lthheadgtlthtitlegtBook Reviewlt/htitlegtlt/hheadgt
  • lthbodygt ltxdcbookreviewgt ltxdctitlegtXML A
    Primerlt/xdctitlegt
  • lthtablegt lthtr align"center"gt
  • lthtdgtAuthorlt/htdgtlthtdgtPricelt/htdgt
  • lthtdgtPageslt/htdgtlthtdgtDatelt/htdgtlt/htrgt
  • lthtr align"left"gt
  • lthtdgtltxdcauthorgtSimon St. Laurentlt/xdcauthorgtlt/
    htdgt
  • lthtdgtltxdcpricegt31.98lt/xdcpricegtlt/htdgt
  • lthtdgtltxdcpagesgt352lt/xdcpagesgtlt/htdgt
  • lthtdgtltxdcdategt1998/01lt/xdcdategtlt/htdgt
  • lt/htrgt lt/htablegt lt/xdcbookreviewgt lt/hbodygt
    lt/hhtmlgt

19
XML Namespaces
  • The prefixes are linked to the full names using
    the attributes on the top element.whose names
    begin xmlns.
  • The prefixes are just shorthand placeholders for
    the full names
  • Those full names are URLs, i.e. Web addresses

20
Extensibility in XML
  • Anyone can invent new tags and attach a meaning
    to those tags
  • But if every user creates its own XML definition
    for describing his data, it is not possible to
    achieve interoperability
  • For example, one may prefer to use the tag name
    POR, while another prefers using the tag name
    PurchaseOrderReq
  • In other words, a tagged document is not very
    useful without some kind of agreement on the tags
    among inter-operating applications

21
Many Efforts for Standardized Tags
  • HL7 for healthcare
  • RosettaNet for supply chain integration in
    Information Technology and Electronic Components
    domain
  • ebXML for eBusiness
  • Common Business Library (CBL) for electronic
    catalogs, purchase orders, etc.

22
XML Parsers
  • A parser takes an XML document and makes its
    structure and content available to an application
    through an API
  • There are two main Application Programming
    Interfaces (APIs) for writing parsers
  • Document Object Model (DOM) and
  • Simple API for XML (SAX)
  • Today, many parsers are both DOM and SAX compliant

23
XML DOM Parser
A parser validates and makes the data contained
in an XML document available to the application
24
XSLT Processor
  • Converts an XML document to another form
  • An XSL style sheet is a set of transformation
    instructions for converting a source XML document
    to a target document

25
(No Transcript)
26
Why XML?
27
XML vs EDI
28
XML vs EDI
29
XML vs EDI
Write a Comment
User Comments (0)
About PowerShow.com