XML:Managing data exchange - PowerPoint PPT Presentation

1 / 40
About This Presentation
Title:

XML:Managing data exchange

Description:

Like wayward electrons, they can spin away from their initial orbit and enter a ... Ella Fitzgerald, Verve, 2000 [D136705] 1 A tisket, a tasket 00:02:37 ... – PowerPoint PPT presentation

Number of Views:45
Avg rating:3.0/5.0
Slides: 41
Provided by: richar864
Category:

less

Transcript and Presenter's Notes

Title: XML:Managing data exchange


1
XMLManaging data exchange
  • Words can have no single fixed meaning. Like
    wayward electrons, they can spin away from their
    initial orbit and enter a wider magnetic field.
    No one owns them or has a proprietary right to
    dictate how they will be used.
  • David Lehman, End of the Word, 1991.

2
Central problems of data management
  • Capture
  • Storage
  • Retrieval
  • Exchange

3
EDI
  • Electronic exchange of standard documents
  • In use for some 20 years
  • Standards
  • ANSI X.12 (US and Canada)
  • EDIFACT (International)

4
EDI Advantages
  • Paper handling is reduced, saving time and money
  • Data can be exchanged in real time
  • There are fewer errors since data are keyed only
    once
  • Enhanced data sharing enables greater
    coordination of activities between business
    partners
  • Money flows are accelerated and payments received
    sooner

5
EDI Adoption
  • Much information flow is still on paper
  • Electronic exchange is the exception rather than
    the rule
  • The Internet is a lower cost solution than EDI
    using value added networks (VANs)

6
SGML
  • Document management consumes
  • 15 of company revenue
  • 25 of labor costs
  • 10 - 60 of an office workers time
  • Standard generalized markup language (SGML) was
    designed to reduce the cost of document management

7
Markup language
  • Embedded information within text about the
    meaning of the text
  • ltcdlinergtThis uniquely creative collaboration
    between Miles Davis and Gil Evans has already
    resulted in two extraordinary albumsltcdtitlegtMile
    s Aheadlt/cdtitlegtltcdidgtCL 1041gtlt/cdidgt and
    ltcdtitlegtPorgy and Besslt/cdtitlegt ltcdidgtCL
    1274lt/cdidgt.lt/cdlinergt

8
SGML
  • A vendor independent standard for publication of
    all media
  • Cross system
  • Portable
  • Defines the structure of a document
  • The parent of HTML and XML

9
SGML Advantages
  • Re-use
  • Same advantage as with word processing
  • Flexibility
  • Generate output for multiple media
  • Revision
  • Version control

10
SGML code
  • ltchaptergt
  • ltnogt16lt/nogt
  • lttitlegtXML Managing Data Exchangelt/titlegt
  • ltsectiongt
  • ltquotegtltemph type "2"gtWords can have no single
    fixed meaning. Like wayward electrons, they can
    spin away from their initial orbit and enter a
    wider magnetic field. No one owns them or has a
    proprietary right to dictate how they will be
    used.lt/emphgtlt/quotegt
  • lt/sectiongt
  • lt/chaptergt

11
HTML code
  • lthtmlgt
  • ltbodygt
  • lth1gtltbgt16lt/bgtlt/h1gt
  • lth1gtltbgtXML Managing Data Exchangelt/bgtlt/h1gt
  • ltpgt
  • ltigtWords can have no single fixed meaning. Like
    wayward electrons, they can spin away from their
    initial orbit and enter a wider magnetic field.
    No one owns them or has a proprietary right to
    dictate how they will be used.lt/igt
  • lt/pgt
  • lt/bodygt
  • lt/htmlgt

12
The problem with HTML
  • Presentation not meaning
  • Reader has to infer meaning
  • Machines are not very good at inferring meaning

13
XML
  • Extensible markup language
  • SGML for e- and m-commerce
  • A meta-language
  • A language to generate languages
  • Will steadily replace HTML

14
XML vs. HTML
  • Structured text
  • User-definable structure
  • Context-sensitive retrieval
  • Greater hypertext linkage
  • Formatted text
  • Pre-defined format
  • Limited retrieval
  • Limited hypertext linking

15
XML rules
  • Elements must have both an opening and closing
    tag
  • Elements must follow a strict hierarchy with only
    one root element
  • Elements may not overlap other elements
  • Element names must obey XML naming conventions
  • XML is case sensitive

16
HTML vs. XML
17
Processing shift
  • From server to browser
  • Browser can read meaning of the data
  • Less data transmitted

18
Searching
  • Search engines look for appropriate tags in the
    XML code
  • Faster
  • More precise

19
Expected gains
  • Store once and format many times
  • Hardware and software independence
  • Capture once and exchange many times
  • Accelerated targeted searching
  • Less network congestion

20
XML language design
  • Designers must define
  • Allowable tags
  • Rules for nesting tags
  • Which tagged elements can be processed

21
XML Schema
  • The schema defines
  • The names and contents of all elements that are
    permissible in a certain document
  • The structure of the document
  • How often an element might appear
  • The order in which the elements must appear
  • The type of data the element contains

22
DOM
  • Document object model
  • The data model for an XML document
  • A tree (1m)

23
Schema (cdlib.xsd)
  • XML declaration and root of all schema documents
  • lt?xml version"1.0" encoding"UTF-8"?gt
  • ltxsdschema xmlnsxsd'http//www.w3.org/2001/XMLS
    chema'gt

24
Schema (cdlib.xsd)
  • CD library definition
  • ltxsdelement name"cdlibrary"gt
  • ltxsdcomplexTypegt
  • ltxsdsequencegt
  • ltxsdelement name"cd" type"cdType
  • minOccurs"1 maxOccurs"unbounded"/gt
  • lt/xsdsequencegt
  • lt/xsdcomplexTypegt
  • lt/xsdelementgt

25
Schema (cdlib.xsd)
  • CD definition
  • ltxsdcomplexType name"cdType"gt
  • ltxsdsequencegt
  • ltxsdelement name"cdid" type"xsdstring"/gt
  • ltxsdelement name"cdlabel" type"xsdstring"/gt
  • ltxsdelement name"cdtitle" type"xsdstring"/gt
  • ltxsdelement name"cdyear" type"xsdinteger"/gt
  • ltxsdelement name"track" type"trackType"
    minOccurs"1"
  • maxOccurs"unbounded"/gt
  • lt/xsdsequencegt
  • lt/xsdcomplexTypegt

26
Schema (cdlib.xsd)
  • Track definition
  • ltxsdcomplexType name"trackType"gt
  • ltxsdsequencegt
  • ltxsdelement name"trknum" type"xsdinteger"/gt
  • ltxsdelement name"trktitle" type"xsdstring"/gt
  • ltxsdelement name"trklen" type"xsdtime"/gt
  • lt/xsdsequencegt
  • lt/xsdcomplexTypegt

27
Common datatypes
  • string
  • boolean
  • uriReference
  • decimal
  • float
  • integer
  • time
  • date

28
XML (cd.xml)
  • lt?xml version "1.0 encodingUTF-8?gt
  • ltcdlibrary xmlnsxsi"http//www.w3.org/2001/XMLSc
    hema-instance"
  • xsinoNamespaceSchemaLocation"cdlib.xsd"gt
  • ltcdgt
  • ltcdidgtA2 1325lt/cdidgt
  • ltcdlabelgtAtlanticlt/cdlabelgt
  • ltcdtitlegtPyramidlt/cdtitlegt
  • ltcdyeargt1960lt/cdyeargt
  • lttrackgt
  • lttrknumgt1lt/trknumgt
  • lttrktitlegtVendomelt/trktitlegt
  • lttrklengt230lt/trklengt
  • lt/trackgt
  • lt/cdgt
  • lt/cdlibrarygt

29
XSL
  • Extensible stylesheet language
  • Defines how an XML document is rendered
  • An XML file

30
XSL
  • Results of applying cd.xsl
  • Pyramid, Atlantic, 1960 A2 1325
  • 1 Vendome 000230
  • 2 Pyramid 001046
  • Ella Fitzgerald, Verve, 2000 D136705
  • 1 A tisket, a tasket 000237
  • 2 Vote for Mr. Rhythm 000225
  • 3 Betcha nickel 000252

31
  • lt?xml version"1.0" encoding"UTF-8?gt
  • ltxslstylesheet xmlnsxsl"http//www.w3.org/1999/
    XSL/Transform"gt
  • ltxsloutput encoding"UTF-8" indent"yes"
    method"html" version"1.0" /gt
  • ltxsltemplate match"/"gt
  • lthtmlgt
  • ltheadgt
  • lttitlegtComplete List of Songslt/titlegt
  • lt/headgt
  • ltbodygt
  • lth2gtComplete List of Songslt/h2gt
  • ltxslapply-templates select "cdlibrary" /gt
  • ltxslfor-each select"cd"gt
  • ltfont color"maroon"gt
  • ltxslvalue-of select"cdtitle" /gt ,
  • ltxslvalue-of select"cdlabel" /gt ,
  • ltxslvalue-of select"cdyear" /gt
  • ltxslvalue-of select"cdid" /gt
  • lt/fontgt
  • ltbr /gt

cd.xsl
32
cd.xsl (continued)
  • lttablegt
  • ltxslfor-each select "track"gt
  • lttrgt
  • lttd align"left"gt
  • ltxslvalue-of select "trknum" /gt
  • lt/tdgt
  • lttdgt
  • ltxslvalue-of select "trktitle" /gt
  • lt/tdgt
  • lttd align "center" gt
  • ltxslvalue-of select "trklen" /gt
  • lt/tdgt
  • lt/trgt
  • lt/xslfor-eachgt
  • lt/tablegt
  • ltbr /gt
  • lt/xslfor-eachgt
  • lt/bodygt
  • lt/htmlgt

33
Converting XML
  • Transformation and manipulation
  • XSLT
  • One XML vocabulary to another
  • FPML to finML
  • Re-ordering, filtering, and sorting
  • Rendering
  • XSLT
  • e.g., XML to WAP

34
XML and databases
  • XML is a data management tool
  • XML documents will have to be stored for the
    long-term
  • Need a DBMS

35
DBMS requirements
  • Store a large number of documents
  • Store large documents
  • Support access to portions of a document (e.g.,
    the data for a single CD in a library of 20,000
    CDs)
  • Concurrent access
  • Version control
  • Integrate data from other sources

36
RDBMS
  • Document-centric
  • Store as CLOB
  • Data-centric
  • Object-relational extensions to support element
    retrieval and update
  • Expect RDBMS vendors to offer extensions to
    support XML

37
Database to XML
  • A significant proportion of Web pages are
    generated from databases
  • Instead of converting to HTML these should be
    converted to XML
  • Render with XSL
  • Need tools for converting relational data to XML

38
OODBMS
  • A good fit to the DOM
  • Little development at this stage
  • Vendors have fewer resources

39
XML database
  • Special purpose XML database
  • Tamino
  • This is a new area and you will need to monitor
    developments

40
Conclusion
  • XML is a significant technological development
  • Its main purpose is to support data exchange
  • It will lower the cost of business transactions
  • It will be a critical data management technology
Write a Comment
User Comments (0)
About PowerShow.com