12
SENG 422 Lab 5 An Introduction to XML Time: ELW B220 from (4:00 - 6:50) every Tuesday TA: Philip Baback Alipour Ph.D. Candidate in Electrical, Computer Engineering and Quantum Physics, Dept. of Electrical and Computer Engineering, University of Victoria, CA Email: [email protected] Office: ELW Room # A358

SENG 422 Lab 5 An Introduction to XML Time: ELW B220 from (4:00 - 6:50) every Tuesday TA: Philip Baback Alipour Ph.D. Candidate in Electrical, Computer

Embed Size (px)

Citation preview

Page 1: SENG 422 Lab 5 An Introduction to XML Time: ELW B220 from (4:00 - 6:50) every Tuesday TA: Philip Baback Alipour Ph.D. Candidate in Electrical, Computer

SENG 422 Lab 5 An Introduction to XML

Time: ELW B220 from (4:00 - 6:50) every TuesdayTA: Philip Baback Alipour

Ph.D. Candidate in Electrical, Computer Engineering and Quantum Physics,Dept. of Electrical and Computer Engineering, University of Victoria, CA

Email: [email protected] Office: ELW Room # A358

Page 2: SENG 422 Lab 5 An Introduction to XML Time: ELW B220 from (4:00 - 6:50) every Tuesday TA: Philip Baback Alipour Ph.D. Candidate in Electrical, Computer

SENG 422 Lab 5 An Introduction to XML

- XML, or Extensible Markup Language is a markup language using which you can create your own tags.

- XML was created to overcome the shortcomings of HTML

Page 3: SENG 422 Lab 5 An Introduction to XML Time: ELW B220 from (4:00 - 6:50) every Tuesday TA: Philip Baback Alipour Ph.D. Candidate in Electrical, Computer

WHY XML?

-HTML was designed for humans not machines (high level representation of data).

-In HTML browser just follows the instructions and does not understand the content (information traversing across www).

Page 4: SENG 422 Lab 5 An Introduction to XML Time: ELW B220 from (4:00 - 6:50) every Tuesday TA: Philip Baback Alipour Ph.D. Candidate in Electrical, Computer

WHY XML?

- XML Separates Data from HTML

- XML Simplifies Data; SharingXML Simplifies Data Sharing

- XML Simplifies Platform Changes

Page 5: SENG 422 Lab 5 An Introduction to XML Time: ELW B220 from (4:00 - 6:50) every Tuesday TA: Philip Baback Alipour Ph.D. Candidate in Electrical, Computer

A Comparison

XML Separates Data from HTML

Page 6: SENG 422 Lab 5 An Introduction to XML Time: ELW B220 from (4:00 - 6:50) every Tuesday TA: Philip Baback Alipour Ph.D. Candidate in Electrical, Computer

An Example

- A tag is the text between the brackets (<) and (>).

Such as <greeting> and </greeting>)

- An element is the starting tag, the ending tag,

and everything in between.

- An attribute is a name-value pair inside the starting tag

of an element. In this example, state is an attribute of

the <city> element.

Page 7: SENG 422 Lab 5 An Introduction to XML Time: ELW B220 from (4:00 - 6:50) every Tuesday TA: Philip Baback Alipour Ph.D. Candidate in Electrical, Computer

Some Rules

- The root element: Everything should be inside one element

- No overlapping between elements

- End tags are required

- Elements are case sensitive

Page 8: SENG 422 Lab 5 An Introduction to XML Time: ELW B220 from (4:00 - 6:50) every Tuesday TA: Philip Baback Alipour Ph.D. Candidate in Electrical, Computer

Data Definition

Two Methods:

- Document Type Definition

- XML Schema

Page 9: SENG 422 Lab 5 An Introduction to XML Time: ELW B220 from (4:00 - 6:50) every Tuesday TA: Philip Baback Alipour Ph.D. Candidate in Electrical, Computer

XML Schema

- XML schemas use XML syntax

- XML schemas support data types

- XML schemas are extensible

- XML schemas have more expressive power

Page 10: SENG 422 Lab 5 An Introduction to XML Time: ELW B220 from (4:00 - 6:50) every Tuesday TA: Philip Baback Alipour Ph.D. Candidate in Electrical, Computer

Schema Example

r

Page 11: SENG 422 Lab 5 An Introduction to XML Time: ELW B220 from (4:00 - 6:50) every Tuesday TA: Philip Baback Alipour Ph.D. Candidate in Electrical, Computer

Schema Example

r

Page 12: SENG 422 Lab 5 An Introduction to XML Time: ELW B220 from (4:00 - 6:50) every Tuesday TA: Philip Baback Alipour Ph.D. Candidate in Electrical, Computer

Assignment

Create a schema for a checklist. It may contain the following:

- Surveyor ID

- Location

- Weather

- Last Modification Date