Databases and XML

A module of the BSc in Web Development

Niels Müller Larsen

2012-05-07


Table of Contents

Preface
Databases and XML?
This material
Who Am I
Introduction
Literature
Calendar
1. A Refresher on SQL and Databases
References for this Lesson
Database Reactivation
PHP - MySQL
Assignments
2. MySQL 5.0 Stored Procedures
References for this Lesson
Solutions to Last Weeks Assignments
Stored Procedures, Intro
Characteristics, Parameters
The First Procedure
Legal SQL in Procedure
Characteristics Clauses
Parameters
The New SQL Statements
Assignments
3. MySQL 5.0 Stored Procedures - II
References for this Lesson
Solutions to Last Weeks Assignments
Recap Loops
Error Handling
Cursor
Functions
DD
Style
Assignments
4. Triggers
References for this Lesson
Solutions to Last Weeks Assignments
MySQL 5.0 Triggers, Intro
Syntax
Privileges - Referring to OLD and NEW columns
Examples
Assignments
5. Views, Intro
References for this Lesson
MySQL 5.0 Views, Intro
SQL Schema Part, First Example
Views? What for?
Formalities
Views as Opposed to Tables, Updatability
Views and Insertability
Assignments
6. An Extra Mouthful of SQL
References for this Lesson
Solutions to Last Weeks Assignments
Relational Algebra
Assignments
7. Introduction to XML
References for this Lesson
References for Next Lesson
Solutions to Last Weeks Assignments
Introduction to XML
Toolchain Installation
Let's Try It
XML Family
XHTML, Familiar?
Namespaces
Applying CSS for Browser Display
Assignments
8. XML Grammars, DTDs and Schemas
References for this Lesson
References for Next Lesson
Solutions to Last Weeks Assignments
Creating Formal Rules
Using DTDs
Odds and Ends on Elements
Attributes
Entities
Applying the DTD
Using the XML Schema
Entities in Schemas
Applying the Schema
Assignments
9. XPath and XSLT
References for this Lesson
References for next Lesson
Solutions to Last Weeks Assignments
XPATH Briefly
XSLT in Practice
Assignments
10. XSLT Detailed
References for this Lesson
Solutions to Last Weeks Assignments
XPATH Again
XSLT Programmatically
Selections
Iterations
Assignments
11. XML and The DOM with JavaScript
References for this Lesson
Solutions to Last Weeks Assignments
Client Side Scripting
XSLT into the DOM with JavaScript
Variables into XSLT
Assignments
12. XML from PHP, Server Side
References for this Lesson
Solutions to Last Weeks Assignments
SAX, Simple Accessible XML
DOM, Document Object Model
SimpleXML
Differentiating Between Methods
A. Setting Up 3 Tier Client Server Environment
Apache, MySQL, PHP
B. Download, Installation and Setup of Java JDK
Download and Install
Path Setup
Search Path for Linux, and MAC
C. Download, Installation and Setup of the Eclipse SDK
Download, Install, and Test
D. Solutions to Assignments
Assignments From Chapter 1
Assignments From Chapter 2
Assignments From Chapter 3
Assignments From Chapter 4
Assignments From Chapter 5
Assignments From Chapter 6
Bibliography

List of Figures

1.1. A simple ER diagram
1.2. Degrees of Relationships
1.3. Attributes
1.4. An ER diagram
6.1. Schematical Overview
7.1. A Bit of language History
7.2. Well-formedness As The Browser Sees it
A.1. Windows environment setup
A.2. Path edit
A.3. Creation of One of the Databases
A.4. After the creation
B.1. Windows environment setup
B.2. Linux/Mac Path Check Succesfully
B.3. Linux/Mac Path Unsuccesfull Check
C.1. Eclipse Splash Screen
C.2. Eclipse Workspace Designation
C.3. Eclipse Welcome
D.1. An ER diagram

List of Tables

1.
7.1.
8.1.

List of Examples

3.1. Blueprint for t3/t13 and t4/t14
6.1.
6.2.
7.1. letter.xml
7.2. letter0.xsl
7.3. letter1.xsl
8.1. Embedded DTD
8.2. External DTD
8.3. An XML Schema is an XML document
8.4. Annotations are a Possibility
8.5. Declare Root Element
8.6. Declare Simple Type
8.7. Declare Complex Type A
8.8. Declare Complex Type B
8.9.
8.10. booksCanon.xml
10.1. browsere.xml
10.2. List: browsere.xsl
10.3. Sorted List: browsere1.xsl
10.4. Numbereded List: browsere2.xsl
10.5. Selection if: browsere3.xsl
10.6. Selection choose: browsere4.xsl
10.7. Iteration for: browsere5.xsl
11.1. AJaX - Check and Initiate
11.2. Get a File From the Server With AJaX
11.3. Do a Transformation in a Structured Methodical Way
11.4. Application of the Above
11.5. Variable in XSLT
11.6. JavaScript Aspect of Variable to XSLT
D.1. Declarations b.sql
D.2. Blueprint for t3/t13 and t4/t14
D.3. Experiment With IN and OUT Parameters
D.4. The Referential Integrity Check Procedure - refIntChk.sql
D.5. The Test Setup - assign122.sql
D.6. The Results - Mac 2,3 GHz
D.7. assE0.sql
D.8. assE0a.sql
D.9. assE1M.sql
D.10. assE2M.sql