Using XML in Database Applications - PowerPoint PPT Presentation

1 / 16
About This Presentation
Title:

Using XML in Database Applications

Description:

HTML tags elements in web pages for presentation by a browser, ... Well-Formed and Valid XML Document. Well-formed XML allows you to invent ... Well-Formed XML ... – PowerPoint PPT presentation

Number of Views:84
Avg rating:3.0/5.0
Slides: 17
Provided by: Guo90
Category:

less

Transcript and Presenter's Notes

Title: Using XML in Database Applications


1
Using XML in Database Applications
2
  • Overview
  • Oracle Solutions to Database Applications

3
Overview
  • XML stands for eXensible Markup Language.
  • HTML vs. XML
  • HTML tags elements in web pages for presentation
    by a browser, while XML tags elements as content
    or data.

4
Example
  • HTML Example
  • lttablegt
  • lttrgt
  • lttdgtEMPNOlt/tdgtlttdgtENAMElt/tdgtlttdgtJOBlt/tdgtlttdgtSALlt/t
    dgt
  • lt/trgt
  • lttrgt
  • lttdgt7654lt/tdgtlttdgtMARTINlt/tdgtlttdgtSALESMANlt/tdgtlttdgt1
    250lt/tdgt
  • lt/trgt
  • lttrgt
  • lttdgt7788lt/tdgtlttdgtSCOTTlt/tdgtlttdgtANALYSTlt/tdgtlttdgt300
    0lt/tdgt
  • lt/trgt
  • lt/tablegt

5
Example Cont
  • lt?xml version"1.0"?gt
  • ltEMPLISTgt
  • ltEMPgt
  • ltEMPNOgt7654lt/EMPNOgt
  • ltENAMEgtMARTINlt/ENAMEgt
  • ltJOBgtSALESMANlt/JOBgt
  • ltSALgt1250lt/SALgt
  • lt/EMPgt
  • ltEMPgt
  • ltEMPNOgt7788lt/EMPNOgt
  • ltENAMEgtSCOTTlt/ENAMEgt
  • ltJOBgtANALYSTlt/JOBgt
  • ltSALgt3000lt/SALgt
  • lt/EMPgt
  • lt/EMPLISTgt

6
Benefit
  • Presentation is separate from its structure and
    content. The XML data defines the structure and
    content, and then a stylesheet is applied to it
    to define the presentation.
  • XML leaves the specification of tags and how they
    can be used by users. Tags may be defined by
    using them in an XML document or formally defined
    in a Document Type Definition (DTD).

7
XSL
  • The eXtensible Stylesheet Language, XSL, provides
    for stylesheets that allow you to transform XML
    into HTML or other text-based formats, rearrange
    or filter data, or convert it to XML that
    conforms to another DTD-an important capability
    for allowing different applications to share
    data.

8
Well-Formed and Valid XML Document
  • Well-formed XML allows you to invent your own
    tags.
  • Valid XML involves a DTD (Document
  • Type Definition) that tells the labels and
  • gives a grammar for how they may be
  • nested.

9
Well-Formed XML Document Rules
  • The document must start with the XML declaration
    lt?xml version"1.0"gt
  • All elements must be contained within one root
    element
  • Elements must be nested in a tree structure
    without overlapping
  • All non-empty elements must have start and end
    tags

10
Example DTD
  • lt!DOCTYPE EMPLISTgt
  • lt!ELEMENT EMPLIST (EMP)gt
  • lt!ELEMENT EMP (EMPNO, ENAME, JOB, SAL)gt
  • lt!ELEMENT EMPNO (PCDATA)gt
  • lt!ELEMENT ENAME (PCDATA)gt
  • lt!ELEMENT JOB (PCDATA)gt
  • lt!ELEMENT SAL (PCDATA)gt
  • gt

11
Oracle Solutions to Database Applications
  • Key Oracle products that support XML in database
    applications include
  • Oracle8i and interMedia
  • XML Parsers and XSL Processors (Java, C, C, and
    PL/SQL)
  • XML Class Generators (Java and C)
  • XML SQL Utility for Java

12
Oracle Solutions Cont.
  • XSQL Servlet
  • XML Transviewer Beans
  • The XML Parsers, XSL Processors, XML Class
    Generator, and XML Transviewer Beans are packaged
    together in the Oracle XML Developer's Kit (XDK).
    You can run the these components in the Oracle8i
    server, on a middle tier such as Oracle
    Application Server, or on the client.

13
DOM and SAX
  • DOM
  • Document Object Model is tree-based API, which
    needs to build in-memory tree representation of
    XML document.
  • SAX
  • Simple API for XML is event-based and event
    handlers are used to deal with event like start
    and end of elements and characters.

14
XML SQL Utility for Java
15
Cont.
16
XSQL Sevlet
Write a Comment
User Comments (0)
About PowerShow.com