0% found this document useful (0 votes)
172 views10 pages

XML and Web Database

XML can be used to store and exchange data in a human-readable and machine-readable format. It uses tags to identify and organize data without specifying how to display it. XML is extensible, carries only data without presentation details, and is an open standard. XML can be used to simplify web page creation, exchange information between systems, offload/reload databases, and store and customize data handling. XML documents can be stored in databases as text or by extracting element data. Queries use XPath to specify node paths and XQuery for more complex queries across documents. Relational data can be converted to hierarchical XML views by breaking cycles to convert graphs to trees.

Uploaded by

Lucia Makwasha
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
Download as ppt, pdf, or txt
0% found this document useful (0 votes)
172 views10 pages

XML and Web Database

XML can be used to store and exchange data in a human-readable and machine-readable format. It uses tags to identify and organize data without specifying how to display it. XML is extensible, carries only data without presentation details, and is an open standard. XML can be used to simplify web page creation, exchange information between systems, offload/reload databases, and store and customize data handling. XML documents can be stored in databases as text or by extracting element data. Queries use XPath to specify node paths and XQuery for more complex queries across documents. Relational data can be converted to hierarchical XML views by breaking cycles to convert graphs to trees.

Uploaded by

Lucia Makwasha
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1/ 10

XML Data and WEB

database
 XML stands for Extensible Markup Language.
 It defines set of rules for encoding documents in a format that is both
human-readable and machine-readable.
 An XML database is a database that stores data in XML format. This type of
Definition database is suited for businesses with data in XML format and for situations
where XML storage is a practical way to archive data, metadata and other
digital resources.
 XML use tags.
 XML tags identify the data and are used to store and organize the
data, rather than specifying how to display it like HTML tags,
which are used to display the data
 There are three important characteristics of XML that make it
useful in a variety of systems and solutions −
 XML is extensible − XML allows you to create your own self-

Overview
descriptive tags, or language, that suits your application.
 XML carries the data, does not present it − XML allows you to
store the data irrespective of how it will be presented.
 XML is a public standard − XML was developed by an
organization called the World Wide Web Consortium (W3C) and is
available as an open standard.
• XML can work behind the scene to simplify the creation of HTML
documents for large web sites.
• XML can be used to exchange the information between organizations
and systems.
• XML can be used for offloading and reloading of databases.
XML Usage • XML can be used to store and arrange the data, which can customize
your data handling needs.
• XML can easily be merged with style sheets to create almost any
desired output.
• Virtually, any type of data can be expressed as an XML document.
Storing and  An XML document is a basic unit of XML information composed of
Extracting XML elements and other markup in an orderly package. An XML document can
contains wide variety of data. For example, database of numbers, numbers
Documents representing molecular structure or a mathematical equation.
from Databases
  Using a DBMS to store the documents as text. A relational or object DBMS can be used to store whole XML
documents as text fields within the DBMS records or objects. This approach can be used if the DBMS has a special
module for document processing, and would work for storing schemaless and documentcentric XML documents.

 Using a DBMS to store the document contents as data elements. This approach would work for storing a

Storing and
collection of documents that follow a specific XML DTD or XML schema. Because all the documents have the same
structure, one can design a relational (or object) database to store the leaf-level data elements within the XML

Extracting XML documents. This approach would require mapping algorithms to design a database schema that is compatible with the
XML document structure as specified in the XML schema or DTD and to recreate the XML documents from the

Documents from stored data.

 Designing a specialized system for storing native XML data. A new type of database system based on the
Databases hierarchical (tree) model could be designed and implemented. Such systems are being called Native XML DBMSs.
The system would include specialized indexing and querying techniques, and would work for all types of XML
documents. It could also include data compression techniques to reduce the size of the documents for storage. Tamino
by Software AG and the Dynamic Application Platform of eXcelon are two popular products that offer native XML
DBMS capability. Oracle also offers a native XML storage option.

 Creating or publishing customized XML documents from preexisting relational databases. Because there are
enormous amounts of data already stored in relational databases, parts of this data may need to be formatted as
documents for exchanging or displaying over the Web. This approach would use a separate middleware software
layer to handle the conversions needed between the XML documents and the relational database.
 There are two query language standards .
 The first is XPath, which provides language constructs for
specifying path expressions to identify certain nodes (elements)
XML language or attributes within an XML document that match specific
patterns.
 The second is XQuery, which is a more general query
language. XQuery uses XPath expressions but has additional
constructs.
 An XPath expression generally returns a sequence of items that
satisfy a certain pat-tern as specified by the expression. These items
1.XPath: are either values (from leaf nodes) or elements or attributes.

Specifying Path  The most common type of XPath expression returns a collection of
element or attribute nodes that satisfy certain patterns specified in
Expressions in the expression. The names in the XPath expression are node names
XML in the XML document tree that are either tag (element) names or
attribute names, possibly with additional qualifier conditions to
further restrict the nodes that satisfy the pattern.
 Two main separators are used when specifying a path: single slash
(/) and double slash (//). A single slash before a tag specifies that
the tag must appear as a direct child of the previous (parent) tag,
whereas a double slash specifies that the tag can appear as a
descendant of the previous tag at any level.
2. XQuery:
 XPath allows us to write expressions that select items from a tree-
Specifying structured XML document. XQuery permits the specification of more
Queries in XML general queries on one or more XML documents. The typical form of a
query in XQuery is known as a FLWR expression, which stands for the
four main clauses of Xquery.
Extracting XML  1. Creating Hierarchical XML Views over Flat or Graph-Based
documents from Data. XML uses a hierarchical (tree) model to represent

relational documents. The database systems with the most widespread use
follow the flat relational data model. When we add referential
Databases integrity constraints, a relational schema can be considered to
be a graph structure for example.
 2. Breaking Cycles to Convert Graphs into Trees
 3. ther Steps for Extracting XML Documents from Databases

You might also like