Tutorial 03 Working with Schemas 1. Contents The University Hospital Problem Solution 2.

Slides:



Advertisements
Similar presentations
CG0119 Web Database Systems Parsing XML: using SimpleXML & XSLT.
Advertisements

An Introduction to XML Based on the W3C XML Recommendations.
XML: Managing Data Exchange Stylesheets. Lesson Contents CSS The basic XSL file XSL transforms Templates Sort Numbering Parameters and Variables Datatypes.
Microsoft Excel 2003 Illustrated Complete Excel Files and Incorporating Web Information Sharing.
XML Unit 6 October 31. XML, review XML is used to markup data Used to describe information Uses tags like HTML –But all tags are user-defined –Must be.
 CSS ids  Pages  Sites  HTML: class=“name”  Names may define format OR content › Either works  CAN apply multiple classes to the same tag  Multiple.
Winter 2002Arthur Keller – CS 18018–1 Schedule Today: Mar. 12 (T) u Semistructured Data, XML, XQuery. u Read Sections Assignment 8 due. Mar. 14.
VALIDATING AN XML DOCUMENT
Tutorial 3: Adding and Formatting Text. 2 Objectives Session 3.1 Type text into a page Copy text from a document and paste it into a page Check for spelling.
Tutorial 1: Getting Started with HTML5
Chapter 12 Creating and Using XML Documents HTML5 AND CSS Seventh Edition.
Working with Namespaces Combining XML Vocabularies in a Compound Document.
WORKING WITH NAMESPACES
XP New Perspectives on XML Tutorial 4 1 XML Schema Tutorial – Carey ISBN Working with Namespaces and Schemas.
Tutorial 3: XML Creating a Valid XML Document. 2 Creating a Valid Document You validate documents to make certain necessary elements are never omitted.
XP New Perspectives on XML Tutorial 3 1 DTD Tutorial – Carey ISBN
XML introduction to Ahmed I. Deeb Dr. Anwar Mousa  presenter  instructor University Of Palestine-2009.
Validating DOCUMENTS with DTDs
XML: Overview MIS 181.9: Service Oriented Architecture 2 nd Semester,
XP New Perspectives on XML Tutorial 6 1 TUTORIAL 6 XSLT Tutorial – Carey ISBN
XP 1 CREATING AN XML DOCUMENT. XP 2 INTRODUCING XML XML stands for Extensible Markup Language. A markup language specifies the structure and content of.
CIS 1315 – Web Development for Educators CIS 1315 HTML Tutorial 9: Working With XHTML.
Adding Hypertext Links to a Web Page Tutorial 2 eXtensible Markup Language (XML)
XP 1 DECLARING A DTD A DTD can be used to: –Ensure all required elements are present in the document –Prevent undefined elements from being used –Enforce.
What is XML?  XML stands for EXtensible Markup Language  XML is a markup language much like HTML  XML was designed to carry data, not to display data.
Session IV Chapter 9 – XML Schemas
1 Tutorial 13 Validating Documents with DTDs Working with Document Type Definitions.
Session 1 SESSION 1 Working with Dreamweaver 8.0.
Avoid using attributes? Some of the problems using attributes: Attributes cannot contain multiple values (child elements can) Attributes are not easily.
Winter 2006Keller, Ullman, Cushing18–1 Plan 1.Information integration: important new application that motivates what follows. 2.Semistructured data: a.
Date : 3/3/2010 Web Technology Solutions Class: Application Syndication: Parse and Publish RSS & XML Data.
New Perspectives on XML, 2nd Edition
Waqas Anwar Next SlidePrevious Slide. Waqas Anwar Next SlidePrevious Slide XML XML stands for EXtensible Markup Language.
XP 1 New Perspectives on XML Binding XML Data with Internet Explorer.
XP 1 Creating an XML Document Developing an XML Document for the Jazz Warehouse XML Tutorial.
XP New Perspectives on XML, 2nd Edition Tutorial 2 1 TUTORIAL 2 WORKING WITH NAMESPACES.
17 Apr 2002 XML Syntax: Documents Andy Clark. Basic Document Structure Element tags – Elements have associated attributes Text content Miscellaneous –
XML Design Goals 1.XML must be easily usable over the Internet 2.XML must support a wide variety of applications 3.XML must be compatible with SGML 4.It.
XML Basics A brief introduction to XML in general 1XML Basics.
1 Tutorial 11 Creating an XML Document Developing a Document for a Cooking Web Site.
1 Tutorial 14 Validating Documents with Schemas Exploring the XML Schema Vocabulary.
Tutorial 13 Validating Documents with Schemas
1 Tutorial 12 Working with Namespaces Combining XML Vocabularies in a Compound Document.
XML Many-to-Many Relationship January 30, Learning Objectives ● Create a schema for a data model containing a many:many relationship ● Understand.
Working with XML Schemas ©NIITeXtensible Markup Language/Lesson 3/Slide 1 of 36 Objectives In this lesson, you will learn to: * Declare attributes in an.
DYNAMIC HTML What is Dynamic HTML: HTML code that allow you to change/ specify the style of your web pages. Example: specify style sheet, object model.
Representing data with XML SE-2030 Dr. Mark L. Hornick 1.
XSD: XML Schema Language Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
CSS Cascading Style Sheets A very brief introduction CSS, Cascading Style Sheets1.
XP Tutorial 9New Perspectives on HTML and XHTML, Comprehensive 1 Working with XHTML Creating a Well-Formed Valid Document Tutorial 9.
How to… Cascading Style Sheets. How to Insert a Style Sheet When a browser reads a style sheet, it will format the document according to it. There are.
Basic HTML Document Structure. Slide 2 Goals (XHTML HTML5) XHTML Separate document structure and content from document formatting HTML 5 Create a formal.
Chapter 29. Copyright 2003, Paradigm Publishing Inc. CHAPTER 29 BACKNEXTEND 29-2 LINKS TO OBJECTIVES Attach an XML Schema Attach an XML Schema Load XML.
Rendering XML Documents ©NIITeXtensible Markup Language/Lesson 5/Slide 1 of 46 Objectives In this session, you will learn to: * Define rendering * Identify.
XML SCHEMA 1 CH 20. Objective 2 What’s wrong with DTDs? What is a schema? The W3C XML Schema Language Hello schemas Complex types Simple types Deriving.
Creating Groups of Elements and Attributes in an XML Schema ©NIITeXtensible Markup Language/Lesson 4/Slide 1 of 28 Objectives In this lesson, you will.
CASCADING STYLE SHEET CSS. CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to solve a problem.
XML Schemas Dr. Awad Khalil Computer Science Department AUC.
Document Type Definition
Getting Started with CSS
Creating an XSLT Style Sheet for Formatting Data
Tutorial 04 (cont’) Using XPath Patterns in an XSLT Style Sheet.
Creating an XML Document
WORKING WITH NAMESPACES
CASCADING STYLE SHEET CSS.
Basic HTML Document Structure
Web Programming Maymester 2004
New Perspectives on XML
New Perspectives on XML
Presentation transcript:

Tutorial 03 Working with Schemas 1

Contents The University Hospital Problem Solution 2

The University Hospital Problem o The University Hospital stores information about its patients. Patient’s information must be store in a consistent format. Restrictions must be placed on the kind of data that can be saved in the data store to ensure uniformity and consistency of information. o The patient information comprise the name (first and last) of patient, date of Birth, age, stage, comments (optional, multiple) and his/her performance. o Every patient is uniquely identified by a patient ID, and the ID of the study in which the patient is enrolled. 3

Solution 1.Analysis and Design 2.Implementation 3.Testing 4

1. Analysis and Design  Structure of the patients vocabulary: 5

1. Analysis and Design (cont.) ElementContent / Data Type PatientsComplex PatientComplex Last nameSimple / String First NameSimple / String Date of BirthSimple / String AgeSimple / Positive Number StageSimple / String CommentSimple / String PerformanceComplex / String 6 AttributeContent / Data Type patIDSimple / String onStudySimple / String scaleSimple / String

2. Implementation 2.1 Declaring Elements 2.2 Storing Elements 7

2.1 Declaring Elements Creating a new XML Schema file Inserting the root element Inserting the parent element Inserting the child elements Inserting the attribute 8

2.1.1 Creating a new XML Schema file Open XML Spy > File > New > xsd > OK Save the file as patients.xsd 9

2.1.2 Inserting the root element 10

2.1.3 Inserting the parent element 11

2.1.4 Inserting the child elements 12

2.1.5 Inserting the attribute 13

2.2 Storing Elements Creating a new XML document Applying the XML Schema into the XML document Inserting data 14

2.2.1 Creating a new XML document Create a new XML file and save it as patients.xml 15

2.2.2 Applying the XML Schema into the XML document 16

2.2.3 Inserting data Insert the patient information below (using the text file on Moodle) 17

3. Testing 3.1 Valid Case 3.2 Invalid Case 18

3.1 Valid Case 19

3.2 Invalid Case Suppose you delete one row in patient information, what will you see? 20

Extension 1.Each patient in document has a unique medical reference number that identifies the patient to the investigator. You decide to apply the ID data type to values of this attribute. To apply the ID data type: Change the type value from “xs:string” to “xs:ID” 2.You have recorded the date of birth of each patient in XML document. To apply the date data type: change the data type to xs:date 21

Extension 3.Every patient has to have the stage element containing either “I” for Stage I cancer patients or “II” for Stage II. To create the stageType data type: change the base type in the stage element from “xs:string” to “stageType” 22

Extension 4.Patients must be at least 21 years of age in order to give informed consent. To create the ageType data type: change the base type in the age element from “xs:positiveInterger” to “ageType”. 23

Extension 5.The performance scale varies from 0 to 1. To apply this decimal data types: change the base type in the performance element from “xs:string” to “perfType” 24

Exercise o The head office of Cyber Shop sends the information about its products to the branch offices. o The products details must be store in a consistent format at all branches. o Restrictions must be placed on the kind of data that can be saved in the data store to ensure uniformity and consistency of information. o The product details comprise the name of the product, a brief description about it, the price of the product, and the quantity available in stock, the price of the product must always be greater than zero. o Every product is uniquely indentified by a product ID. Create a XML Schema for the above case, reuse the XML document in the previous session to view data. 25

References New Perspectives on Creating Web Pages with HTML and XML (Patrick Carey & Mary Kemper) - Course Technology Publisher Creating Cool Web Sites with HTML, XHTML and CSS - Taylor, Dave, Wiley 26

27