lecture09 - XML Namespaces and Schemas Resources:

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
Lecture 9 XML – Namespaces and Schemas Resources: http://www.w3schools.com/schema/default.asp; http://www.xml.com/pub/a/2000/11/29/schemas/part1.html; http://lucas.ucs.ed.ac.uk/xml-schema/; http://www.cs.man.ac.uk/~kechen/pages/teaching/comp17032
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
COMP17032 Web Technology and Practice 1 2 Aims and Objectives •A ims Understand the basic structure of an XML Schema and describe simple and complex type elements. • Objectives –N a m e s p a c e s Limitations of DTDs How to write a basic XML Schema Simple and Complex type element declarations Attribute declarations Referencing an XML Schema Occurrence constraints Order indicators: sequence, choice and all
Background image of page 2
COMP17032 Web Technology and Practice 1 3 Overview of Namespaces •A namespace is a group, or set, of element and attribute names that belong to or describe a document type • Each name in a namespace must be unique within that namespace naming collision occurs when an element name has two different meanings within a document • XML namespaces are used to avoid naming collisions and to assign elements to different groupings within a document
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
COMP17032 Web Technology and Practice 1 4 Naming Collision Example -1. <course_information> <title> Introduction to XML </title> <professor> Jane Smith </professor> <meeting_time> Monday, 3:00-5:00 </meeting_time> <description> This course covers the basics of XML </description> </course_information> Document 1 contains course information
Background image of page 4
COMP17032 Web Technology and Practice 1 5 Naming Collision Example -2. <book> <title> Programming with XML </title> <author> Sandy Birch </author> <publishing_company> Addison-Wesley </publishing_company> </book> Document 2 contains information about the book
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
COMP17032 Web Technology and Practice 1 6 Naming Collision Example -3. <catalog> <course> <title>Introduction to XML</title> <professor> Jane Smith </professor> <meeting_time> Monday, 3:00-5:00 </meeting_time> <description> This course covers the basics of XML </description> <title>Programming with XML</title> <author> Sandy Birch </author> <publishing_company> Addison-Wesley </publishing_company> </course> </catalog> Documents are now merged but <title> element occurs twice
Background image of page 6
COMP17032 Web Technology and Practice 1 7 Namespace Syntax • Namespaces must be declared before they are used • Namespaces are declared on elements in the start tag • Two types of namespace declarations: –De fau l t : xmlns="URI" xmlns="http://www.w3c.org/1999/xlink" – Prefixed : xmlns:prefix="URI" xmlns:xlink="http://www.w3c.org/1999/xlink" • Prefixed namespaces are referred to as qualified names • Both default and prefixed declarations can exist within a single document
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
COMP17032 Web Technology and Practice 1 8 Namespaces •T h e xmlns attribute stands for namespace. It defines a namespace used to qualify element or attribute name General syntax is <tagname xmlns:namespace=“AnyUniqueString”…> Actual string used to identify namespace should be unique .
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/20/2008 for the course COMP 17032 taught by Professor Kechen during the Fall '07 term at University of Manchester.

Page1 / 40

lecture09 - XML Namespaces and Schemas Resources:

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online