Exercises: DTD Basi di da/ 2



Similar documents
Exercises: XSD, XPath Basi di da4 2

<Namespaces> Core XML Technologies. Why Namespaces? Namespaces - based on unique prefixes. Namespaces. </Person>

DTD Tutorial. About the tutorial. Tutorial

Please see the attached file: "SendExample.asp" for an example of how you can send files using classic ASP.

Introduction to XML. Data Integration. Structure in Data Representation. Yanlei Diao UMass Amherst Nov 15, 2007

Last Week. XML (extensible Markup Language) HTML Deficiencies. XML Advantages. Syntax of XML DHTML. Applets. Modifying DOM Event bubbling

Exchanger XML Editor - Canonicalization and XML Digital Signatures

Structured vs. unstructured data. Semistructured data, XML, DTDs. Motivation for self-describing data

XML: extensible Markup Language. Anabel Fraga

Structured vs. unstructured data. Motivation for self describing data. Enter semistructured data. Databases are highly structured

Chapter 2: Designing XML DTDs

Auto-lead Data Format / ADF. An Industry Standard Data Format for the Export and Import of Automotive Customer Leads using XML

Fast track to HTML & CSS 101 (Web Design)

04 XML Schemas. Software Technology 2. MSc in Communication Sciences Program in Technologies for Human Communication Davide Eynard

Quiz! Database Indexes. Index. Quiz! Disc and main memory. Quiz! How costly is this operation (naive solution)?

Database Technologies

XML and Data Management

WEBINARS. Realtà Aumentata e casi studio rilevanti nel settore industriale. Mauro Rubin. Copyright 2015 by InfoComm International

RULES AND REGULATIONS OF FIXED ODDS BETTING GAMES

OASIS - DISPLAY - DOUBLE BOAT - LENTE - TANK - LOOP - SLIM FINE DESIGN

XML WEB TECHNOLOGIES

Safe Driving Score. by Maxine Fonua, Jasmine Kemble, and Sapna Patel

Italian Section 31 - Online activitites

ipratico POS Quick Start Guide v. 1.0

VIRTUAL LABORATORY: MULTI-STYLE CODE EDITOR

Internationalization Tag Set 1.0 A New Standard for Internationalization and Localization of XML

Large apartment with attic Milano Visconti, Cusago, Milan

EPOKA LEAGUE International Football Championship for high schools

BCS THE CHARTERED INSTITUTE FOR IT. BCS HIGHER EDUCATION QUALIFICATIONS BCS Level 6 Professional Graduate Diploma in IT WEB ENGINEERING

Vulnerability Scan Results in XML

Standard Recommended Practice extensible Markup Language (XML) for the Interchange of Document Images and Related Metadata

How To Use Stat Crew Next Generation

XML and Data Integration

Job Aid. Creating Expense Reports. 1. Begin by navigating to the Expense Report Entry page. 2. Click Create under Expense Report in the Main Page

How To Use Xml In A Web Browser (For A Web User)

Application of XML Tools for Enterprise-Wide RBAC Implementation Tasks

Semistructured data and XML. Institutt for Informatikk INF Ahmet Soylu

Who wins the rest of the match European handicap Home t.win or Away t. win after regular time/overtime/penalty shootout Which team will win

Excel Database Management

Verification of Good Design Style of UML Models

XEP-0043: Jabber Database Access

Web Services in Eclipse. Sistemi Informativi Aziendali A.A. 2012/2013

Foto a colori del mobile originario Marim N/C

3. FIXED ODDS FOOTBALL BETS

DIRECTORS AND OFFICERS PROPOSTA DI POLIZZA

Questionario Medico Medical Questionnaire

Fun ways to group students

1. Write the query of Exercise 6.19 using TRC and DRC: Find the names of all brokers who have made money in all accounts assigned to them.

Versione: 2.1. Interoperabilità del Sistema di Accettazione di SPT

Payment of bets: In absence of further proofs, the bets will be assigned according to our statistics:

by LindaMay Patterson PartnerWorld for Developers, AS/400 January 2000

Converting XML Data To UML Diagrams For Conceptual Data Integration

How to cash-in on ALL football matches without ever picking a winning team

Law 14 The Penalty Kick

Formal Structured Specification for Web Application Testing

WebCite Technical Background and Best Practices Guide

Odoo 8.0. Le nuove API.

Statistics 100A Homework 3 Solutions

DDL ed SQL Compravendite Immobiliari

Football Bets Explained:

T XML in 2 lessons! %! " #$& $ "#& ) ' */,: -.,0+(. ". "'- (. 1

PROVETTE E TAPPI TEST TUBES AND STOPPERS

XML Implementation Guide: General Information

STAMPI PER CIOCCOLATO CATALOGO STAMPI PER CIOCCOLATO CHOCOLATE MOULDS CATALOG

Austria/Cyprus/Malaysia/Philippines/Portugal/Switzerland

OGS 3 yr olds- 4-5 years old and 6-7 year olds PLAYER/PRACTICE GUIDE

APM for European top Customers

Entering Scores into GotSoccer Remotely

Association Amici per la Musica, Venaria Reale Introduces the INTERNATIONAL MUSIC COMPETITION LUIGI NONO

Qualys API. Network Support Qualys Version 8.2

Joint modelling of goals and bookings in association football matches

H = Altezza porta. 2 DOORS ASSEMBLING 3 DOORS ASSEMBLING Per porte rivestite in legno, si raccomanda di utilizzare pannelli o vetri opachi.

USAV New Rules and Interpretations

Nodes, Ties and Influence

Strategies for Medical Device So2ware Development Presented By Anthony Giles of Blackwood Embedded Solu;ons And a Case Study by Francis Amoah of Creo

XML Redirect Integration Guide

Section 7C: The Law of Large Numbers

VERS Standard Electronic Record Format PROS 99/007 Specification 3. Public Record Office Victoria

Sports Activity Pack

Public Safety Communciations Pre-Employment Test Preparation Guide

Kanban game. Danske Bank version developed by Sune Lomholt based on Software development Kanban Christina Skaskiw

Transcription:

Exercises: DTD Basi di da/ 2 Disheng Qiu disheng.qiu@gmail.com Luca Rossi luca.rossi.917@gmail.com

Hints: Use a validator: Eclipse has an embedded XML/DTD validator W3C Validator: hip://validator.w3.org/ Common mistakes: Whitespaces Tabs are allowed Whitespaces are considered CDATA Quotes!= " " Order of mixed content Ex.: (#PCDATA,elem1,elem2) is NOT allowed #PCDATA elem1 elem2 Non- determinis<c sequences Ex.: (this this, that other) A?ributes modifiers are needed <!ATTLIST elem air CDATA #REQUIRED>

Exercises: 2x From instance to DTD 2x From DTD to instance 1x From specs to instance to DTD

Exercise 1: Orders From instance to DTD

Ex.1 - From instance to DTD <?xml version="1.0"?> <shiporder orderid="889923"> <orderperson> John Smith </orderperson> <shipto> <name> Ola Nordmann </name> <address> Langgt 23 </address> <city> 4000 Stavanger </city> <country> Norway </country> </shipto> <item> </tle> Empire Burlesque<//tle> <note> Special Edi/on </note> <quan/ty> 1 </quan/ty> <price> 10.90 </price> </item> <item> </tle> Hide your heart<//tle> <quan/ty>1</quan/ty> <price>9.90</price> </item> </shiporder>

Ex.1 - From instance to DTD: Solu/on <?xml version="1.0"?> <!DOCTYPE shiporder[ <!ELEMENT shiporder (orderperson,shipto,item+)> <!ATTLIST shiporder orderid CDATA #REQUIRED> <!ELEMENT orderperson (#PCDATA)> <!ELEMENT shipto (name,address,city,country)> <!ELEMENT name (#PCDATA)> <!ELEMENT address (#PCDATA)> <!ELEMENT city (#PCDATA)> <!ELEMENT country (#PCDATA)> <!ELEMENT item (/tle,note?,quan/ty,price)> <!ELEMENT /tle (#PCDATA)> <!ELEMENT note (#PCDATA)> <!ELEMENT quan/ty (#PCDATA)> <!ELEMENT price (#PCDATA)> ]>

Exercise 2: Le(era From instance to DTD

Ex.2 - From instance to DTD <leiera> Gen/le <cliente> tal dei tali </cliente>, la informiamo che i seguen/ ar/coli da lei ordina/ non sono più disponibili a magazzino: <ordine num="1234"> <ar/colo> <codice>1</codice> <descr>ar/colo 1</descr> </ar/colo> <ar/colo> <codice>5</codice> <descr>ar/colo 5</descr> </ar/colo> </ordine> Cordiali salu/, <responsabile></t>dr.<//t>mario Rossi</responsabile> </leiera>

Ex.2 - From instance to DTD: Solu/on <?xml version="1.0"?> <!DOCTYPE leiera[ <!ELEMENT leiera (#PCDATA cliente ordine responsabile)*> <!ELEMENT cliente (#PCDATA)> <!ELEMENT ordine (ar/colo+)> <!ATTLIST ordine num CDATA #REQUIRED> <!ELEMENT ar/colo (codice,descr)> <!ELEMENT codice (#PCDATA)> <!ELEMENT descr (#PCDATA)> <!ELEMENT responsabile (#PCDATA /t)*> <!ELEMENT /t (#PCDATA)> ]>

Exercise 3: Catene Montuose From DTD to instance

Ex.3 - From DTD to instance <?xml version="1.0"?> <!DOCTYPE catenemontuose[ <!ELEMENT catenemontuose (catenamontuosa*)> <!ELEMENT catenamontuosa (monte+)> <!ELEMENT monte (nome, regione?, altezza?)> <!ELEMENT nome (#PCDATA)> <!ELEMENT regione (#PCDATA)> <!ELEMENT altezza (#PCDATA)> <!ATTLIST altezza unitamisura CDATA #REQUIRED> ]>

Ex.3 - From DTD to instance: Solu/on <catenemontuose> <catenamontuosa> <monte> </monte> <nome> Monte Bianco </nome> <regione> Valle d Aosta </regione> <altezza unitamisura="metri">4810</altezza> </catenamontuosa> <catenamontuosa> <monte> </monte> <nome>gransasso</nome> </catenamontuosa> </catenemontuose>

Exercise 4: Stock/Used cars From DTD to instance

Ex.4 - From DTD to instance <?xml version="1.0"?> <!DOCTYPE stock[ <!ELEMENT stock (new- car used- car)*> <!ELEMENT new- car (model, price)> <!ELEMENT used- car (model, price, mileage, condi/on?)> <!ELEMENT model (#PCDATA)> <!ELEMENT price (#PCDATA)> <!ELEMENT mileage (#PCDATA)> <!ELEMENT condi/on (#PCDATA)> ]>

Ex.4 - From DTD to instance: Solu/on <stock> <new- car> </stock> <model>fiat Panda</model> <price>12000</price> </new- car> <used- car> <model>fiat Bravo</model> <price>4000</price> <mileage>1000</mileage> <condi/on>good</condi/on> </used- car> <used- car> <model>ferrari</model> <price>400000</price> <mileage>100</mileage> </used- car>

Exercise 5: Football matches From specs to instance to DTD

Ex.5 - From specs to instance to DTD Consider an applica/on in which the results of football games are to be represented in XML. For each game, we want to be able to represent the two teams involved, which one was playing at home, which players scored goals (some of which may have been penal/es) and the /me when each was scored, and which players were shown yellow or red cards. You might use some aiributes.

Ex.5 - From specs to instance to DTD: Solu/on <games> <game score="1-1"> <home- team>roma</home- team> <ex- team>lazio</ex- team> <scores> <score /me= "15"> </reds> </game> </games> <player>klose</player> </score> <score /me= "85" type="penalty"> <player>tox</player> </score> </scores> <yellows> <player>tox</player> <player>hernanes</player> </yellows> <reds> <player>kjaer</player>

Ex.5 - From specs to instance to DTD: Solu/on <?xml version="1.0"?> <!DOCTYPE games[ <!ELEMENT games (game)*> <!ELEMENT game (home- team, ex- team, scores, yellows, reds)> <!ELEMENT home- team (#PCDATA)> <!ELEMENT ex- team (#PCDATA)> <!ELEMENT scores (score)*> <!ELEMENT yellows (player)*> <!ELEMENT reds (player)*> <!ELEMENT score (player)*> <!ELEMENT player (#PCDATA)> <!ATTLIST game score CDATA #REQUIRED> <!ATTLIST score /me CDATA #REQUIRED> <!ATTLIST score type (field penalty) #IMPLIED> ]>