xml and databases exercise session 3 (courtesy of ghislain fourny/eth)
DESCRIPTION
XML and Databases Exercise Session 3 (courtesy of Ghislain Fourny/ETH). Good to know: XML Schema types. Simple type - predefined or user-defined - element or attribute type Complex type - user-defined - element type only Empty content Simple content Complex content Mixed content. - PowerPoint PPT PresentationTRANSCRIPT
Department of Computer Science
Good to know: XML Schema types
Simple type - predefined or user-defined - element or attribute type
Complex type - user-defined - element type only
Empty content Simple content Complex content Mixed content
2
Department of Computer Science
Good to know: XML Schema types
Types (can) have QNames: All predefined types
User-defined types (here simple)
3
Tags, attributes... XML Schema looks like XML... that's because it is XML!
Tags, attributes... XML Schema looks like XML... that's because it is XML!
Department of Computer Science
Good to know: XML Schema types
They can also be anonymous.
4
Anonymous types can be defined under any xs:element or xs:attribute. Non-anonymous types have a global scope and must be defined directly under xs:schema.
Anonymous types can be defined under any xs:element or xs:attribute. Non-anonymous types have a global scope and must be defined directly under xs:schema.
Department of Computer Science
Complex types in XML Schema
Empty content Simple content restricted to "" Or a complex content without any children
Mixed content As in complex content, with an additional attribute
mixed set to true in xs:complexType
7
Department of Computer Science
Exercises 1-3
Passenger: name, address, passport number
Flight: ID, number of seats, date, origin, dest
Airport: name, code, tax value
Booking: credit card, flight, passenger
9
Department of Computer Science
Exercise 2: XML Schema Modelling
14
Passport number name address
Passenger
Department of Computer Science
Exercise 2: XML Schema Modelling
15
code name tax
Passport number name address
Airport
Passenger
Department of Computer Science
Exercise 2: XML Schema Modelling
16
code name tax flightID seatNo date
Passport number name address
Airport Flight
Passenger
Department of Computer Science
Exercise 2: XML Schema Modelling
17
code name tax flightID seatNo date
Passport number name address
Airport Flight
Passenger
source
dest
Department of Computer Science
Exercise 2: XML Schema Modelling
18
code name tax flightID seatNo date
credit card
Passport number name address
Airport Flight
Passenger
source
dest
book
Department of Computer Science
Exercise 2: XML Schema Modelling
19
code name tax flightID seatNo date
credit card
Passport number name address
Airport Flight
Passenger
source
dest
book
1
1
N
N
N
M
Department of Computer Science
Exercise 2: A Schema for Passenger
26
Passport number name address
Passenger
Department of Computer Science
Exercise 2: A Schema for Passenger
27
Passport number name address
Passenger
Department of Computer Science
Exercise 2: A Schema for Flight
28
flightID seatNo date
Airport Flight
source
dest
Department of Computer Science
Exercise 2: A Schema for Flight
29
flightID seatNo date
Airport Flight
source
dest
Department of Computer Science
Exercise 2: A Schema for Flight
30
flightID seatNo date
Airport Flight
source
dest
Department of Computer Science
Exercise 2: A Schema for Flight
31
flightID seatNo date
Airport Flight
source
dest