Document Type Definitions - Database Systems - Lecture Slides, Slides of Database Management Systems (DBMS)

Some concepts of Database Systems are Algebra, Call-Level Interface, Concurrency, Concurrency Control, Constraints, Controlling Concurrent Behavior.Main points of this lecture are: Document Type Definitions , Conforms, Invent, Document, Normal Declaration, Balance, Components, Parenthesized, Description, Subtags

Typology: Slides

2012/2013

Uploaded on 04/26/2013

parina
parina 🇮🇳

4.4

(67)

222 documents

1 / 44

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
XML
Document Type Definitions
XML Schema
1
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c

Partial preview of the text

Download Document Type Definitions - Database Systems - Lecture Slides and more Slides Database Management Systems (DBMS) in PDF only on Docsity!

XML

Document Type Definitions

XML Schema

Well-Formed and Valid XML

  • Well-Formed XML allows you to invent your own tags.
  • Valid XML conforms to a certain DTD.

Tags

  • Tags are normally matched pairs, as .
  • Unmatched tags also allowed, as
  • Tags may be nested arbitrarily.
  • XML tags are case-sensitive.

Example: Well-Formed XML

Joe’s Bar Bud 2.50 Miller 3.00

5

A NAME subelement

A BEER subelement

Root tag

Tags surrounding a BEER element

DTD Elements

  • The description of an element consists of its name (tag), and a parenthesized description of any nested tags. - Includes order of subtags and their multiplicity.
  • Leaves (text elements) have #PCDATA ( Parsed Character DATA ) in place of nested tags.

Example: DTD

]>

8

A BARS object has zero or more BAR’s nested within.

A BAR has one NAME and one or more BEER subobjects.

A BEER has a NAME and a NAME and PRICE are text. PRICE.

Example: Element Description

  • A name is an optional title (e.g., “Prof.”), a first name, and a last name, in that order, or it is an IP address:
(TITLE?, FIRST, LAST) | IPADDR

)>

Use of DTD’s

  1. Set standalone = “no”.
  2. Either:

a) Include the DTD as a preamble of the XML document, or b) Follow DOCTYPE and the by SYSTEM and a path to the file where the DTD can be found.

Example: (b)

  • Assume the BARS DTD is in file bar.dtd.
Joe’s Bar Bud 2.50 Miller 3.00

13

Get the DTD from the file bar.dtd

Attributes

  • Opening tags in XML can have attributes.
  • In a DTD,

declares attributes for element E , along with its datatype.

Example: Attribute Use

  • In a document that allows BAR tags, we might see:

Homma’s Sapporo 5.00 ...

ID’s and IDREF’s

  • Attributes can be pointers from one object to another. - Compare to HTML’s NAME = ”foo” and HREF = ”#foo”.
  • Allows the structure of an XML document to be a general graph, rather than just a tree.

Creating IDREF’s

  • To allow elements of type F to refer to another element with an ID attribute, give F an attribute of type IDREF.
  • Or, let the attribute have type IDREFS, so the F -element can refer to any number of other elements.

Example: ID’s and IDREF’s

  • A new BARS DTD includes both BAR and BEER subelements.
  • BARS and BEERS have ID attributes name.
  • BARS have SELLS subelements, consisting of a number (the price of one beer) and an IDREF theBeer leading to that beer.
  • BEERS have attribute soldBy, which is an IDREFS leading to all the bars that sell it.