XML TD1 : DTD et XML Schema



Documents pareils
Bienvenue. #TwitterMobile

Paris Airports - Web API Airports Path finding

MANUEL MARKETING ET SURVIE PDF

Utiliser une WebCam. Micro-ordinateurs, informations, idées, trucs et astuces

Get Instant Access to ebook Cest Maintenant PDF at Our Huge Library CEST MAINTENANT PDF. ==> Download: CEST MAINTENANT PDF

Autour du web. Une introduction technique Première partie : HTML. Georges-André SILBER Centre de recherche en informatique MINES ParisTech

VTP. LAN Switching and Wireless Chapitre 4

Our recommendation engine has come up with some personalized suggestions for you.

TIC. Réseau informatique. Historique - 1. Historique - 2. TC - IUT Montpellier Internet et le Web

PRESENT SIMPLE PRESENT PROGRESSIF

Once the installation is complete, you can delete the temporary Zip files..

Contents Windows

Stéphane Lefebvre. CAE s Chief Financial Officer. CAE announces Government of Canada participation in Project Innovate.

The assessment of professional/vocational skills Le bilan de compétences professionnelles

Summary / Sommaire. 1 Install DRIVER SR2 USB01 Windows seven 64 bits / Installation du DRIVER SR2 USB01 Windows seven 64 bits 2

RAPID Prenez le contrôle sur vos données

Langage HTML (2 partie) <HyperText Markup Language> <tv>lt La Salle Avignon BTS IRIS</tv>

: Machines Production a créé dès 1995, le site internet

Formulaire d inscription (form also available in English) Mission commerciale en Floride. Coordonnées

Invitation / CTI. CeBIT «SWISS Pavilion» Research & Innovation Applied Research, Basic Research, Emerging Technologies, Start-ups, Spin-offs

Créé par Goldfing & Pblabla Créé le 02/05/ :49:00. Guide pour la déclaration d impôt

Practice Direction. Class Proceedings

Instructions Mozilla Thunderbird Page 1

Les sites Internet dynamiques. contact : Patrick VINCENT pvincent@erasme.org

Francoise Lee.

Gestion Électronique de Documents et XML. Master 2 TSM

Module Title: French 4

Comment Accéder à des Bases de Données MySQL avec Windows lorqu'elles sont sur un Serveur Linux

Nouveautés printemps 2013

Master d Informatique Corrigé du partiel novembre 2010

Quick Start Guide This guide is intended to get you started with Rational ClearCase or Rational ClearCase MultiSite.

valentin labelstar office Made-to-measure label design. Conception des étiquettes sur mesure. Quality. Tradition. Innovation DRUCKSYSTEME

Gestion des prestations Volontaire

SCHOLARSHIP ANSTO FRENCH EMBASSY (SAFE) PROGRAM APPLICATION FORM

AMENDMENT TO BILL 32 AMENDEMENT AU PROJET DE LOI 32

CETTE FOIS CEST DIFFERENT PDF

1 ère Université WEB. Courbevoie Samedi 21 octobre Votre site interactif sur internet.

Quel temps fait-il chez toi?

OUTIL DE TRAVAIL COLLABORATIF

GIGABIT PCI DESKTOP ADAPTER DGE-530T. Quick Installation Guide+ Guide d installation+

Guide de Saisie de Factures sur le Formulaire Web OB10

L ABC de l acquisition de petites entreprises

We Generate. You Lead.

Application Form/ Formulaire de demande

HTML/CSS - Travaux Pratiques 2

UNIVERSITE DE YAOUNDE II

INFO-F-404 : Techniques avancées de systèmes d exploitation

The space to start! Managed by

Programmation Internet Cours 4

Cambridge International Examinations Cambridge International Advanced Subsidiary Level

WEB page builder and server for SCADA applications usable from a WEB navigator

Deadline(s): Assignment: in week 8 of block C Exam: in week 7 (oral exam) and in the exam week (written exam) of block D

THE FRENCH EXPERIENCE 1

Les services usuels de l Internet

La propriété intellectuelle à Hong Kong: ce qu un canadien doit savoir!

Frequently Asked Questions

CEST POUR MIEUX PLACER MES PDF

UNIVERSITY OF CAMBRIDGE INTERNATIONAL EXAMINATIONS General Certificate of Education Advanced Subsidiary Level

Formation HTML / CSS. ar dionoea

QUESTIONNAIRE DESTINE AUX VETERINAIRES ET AUX RESPONSABLES DE CLINIQUE VETERINAIRES

Institut français des sciences et technologies des transports, de l aménagement

PHOTO ROYAUME DE BELGIQUE /KINDOM OF BELGIUM /KONINKRIJK BELGIE. Données personnelles / personal data

lundi 3 août 2009 Choose your language What is Document Connection for Mac? Communautés Numériques L informatique à la portée du Grand Public

Contrôle d'accès Access control. Notice technique / Technical Manual

XML, PMML, SOAP. Rapport. EPITA SCIA Promo janvier Julien Lemoine Alexandre Thibault Nicolas Wiest-Million

Demande d inscription

Monitor LRD. Table des matières

PANKA. PORTFOLIO Karina Pannhasith. Karina Pannhasith. URBANIA Ipad Magazine School Project 2012 Photoshop Illustrator Dreamweaver Hype - HTML5

P R E T S P R E F E R E N T I E L S E T S U B V E N T I O N S D I N T E R Ê T S

Internet. DNS World Wide Web. Divers. Mécanismes de base Exécution d'applications sur le web. Proxy, fire-wall

Guide d'installation rapide TFM-560X YO.13

UNIVERSITY OF CAMBRIDGE INTERNATIONAL EXAMINATIONS General Certificate of Education Advanced Level

Installation d un serveur HTTP (Hypertext Transfer Protocol) sous Débian 6

GUIDE D UTILISATION DE LA PLATEFORME D ENVOI DE COURRIELS

Please kindly find below a synoptic table showing the various ways of transport from Mahe to La Digue, with a stop over on Praslin:

NOM ENTREPRISE. Document : Plan Qualité Spécifique du Projet / Project Specific Quality Plan

Restoring people s trust in their government by making governments more open and transparent

HSCS 6.4 : mieux appréhender la gestion du stockage en environnement VMware et service de fichiers HNAS Laurent Bartoletti Product Marketing Manager

Faits saillants et survol des résultats du sondage

TABLE DES MATIERES A OBJET PROCEDURE DE CONNEXION

Exemple PLS avec SAS

EN UNE PAGE PLAN STRATÉGIQUE

Insérer des images dans Base

Exercices sur SQL server 2000

Internet personnel. Auteur: Guillaume GUAY La Clé Informatique Université de Sherbrooke, mars 2006

Empowering small farmers and their organizations through economic intelligence

Configurer la supervision pour une base MS SQL Server Viadéis Services

SUGARCRM Sugar Open Source Guide d Installation de French SugarCRM Open Source Version 4.2

Innovation in Home Insurance: What Services are to be Developed and for what Trade Network?

Cours Bases de données 2ème année IUT

.. CSS. Damien Nouvel. Damien Nouvel (Inalco) CSS 1 / 15

English Q&A #1 Braille Services Requirement PPTC Q1. Would you like our proposal to be shipped or do you prefer an electronic submission?

Miroir de presse. International Recruitment Forum 9-10 mars 2015

Resident Canadian (Insurance Companies) Regulations. Règlement sur les résidents canadiens (sociétés d assurances) CONSOLIDATION CODIFICATION

Afin de valider votre inscription merci de bien veiller à :

COUNCIL OF THE EUROPEAN UNION. Brussels, 18 September 2008 (19.09) (OR. fr) 13156/08 LIMITE PI 53

ROYAUME DE BELGIQUE / KINGDOM OF BELGIUM / KONINKRIJK BELGIE

Réseaux. 1 Généralités. E. Jeandel

Transcription:

Université du Littoral Côte d Opale M1 Info / 2014 2015 XML TD1 : DTD et XML Schema www-lisic.univ-littoral.fr/~hoock/enseignements/ulco/xml/tdxml01.pdf Enseignant : Jean-Baptiste Hoock (hoock@lisic.univ-littoral.fr) Exercice 1 : XML Les documents XML suivants sont-ils corrects? Trouvez et corrigez les éventuels erreurs. 1. 1: <?xml version="1.0" encoding="utf-8"?> 2: <!DOCTYPE html [ 3: <!ELEMENT html (head,body)> 4: <!ELEMENT head (title)> 6: <!ELEMENT body (p+)> 7: <!ELEMENT p (#PCDATA)> 8: ]> 9: <html> 10: <head><title>hello, World</title></head> 11: <body><p>hello, World</p></body> 12: </html> 2. 1: <?xml version="1.0" encoding="utf-8"?> 2: <p>this is a test. This is a test of the <em> 3: <strong>emergency</em> Broadcast System.</strong></p> 3. 1: <?xml version="1.0" encoding="utf-8"?> 2: <!DOCTYPE note [ 3: <!ELEMENT note (Message)> 4: <!ELEMENT Message (to,from,heading,body)> 5: <!ELEMENT to (#PCDATA)> 6: <!ELEMENT from (#PCDATA)> 7: <!ELEMENT heading (#PCDATA)> 8: <!ELEMENT body (#PCDATA)> 9: <!ATTLIST note date CDATA #REQUIRED> 10: ]> 11: <note date="12/11/2007"> 12: <!-- This is a comment --> 13: <Message><to>Tove</to> 14: <from>jani</from> 15: <heading>reminder</heading> 16: <body>don t forget me this weekend!</body></message> 17: </note> 18: <note date="13/11/2007"> 1

19: <message><to>jani</to> 20: <from>tove</from> 21: <heading>re: Reminder</heading> 22: <body>ok!</body></message> 23: </note> 4. 1: <?xml version="1.0" encoding="utf-8"?> 2: <xs:schema attributeformdefault="unqualified" 3: xmlns:xs="http://www.w3.org/2001/xmlschema"> 4: <xs:element name="points"> 5: <xs:complextype> 6: <xs:sequence> 7: <xs:element maxoccurs="unbounded" name="point"> 8: <xs:complextype> 9: <xs:attribute name="x" type="xs:unsignedshort" use="required"/> 10: <xs:attribute name="y" type="xs:unsignedshort" use="required"/> 11: </xs:complextype> 12: </xs:element> 13: </xs:sequence> 14: </xs:complextype> 15: </xs:element> 16: </xs:schema> 5. 1: <?xml version="1.0" encoding="utf-8"?> 2: <!DOCTYPE html [ 3: <!ELEMENT html (head,body)> 4: <!ELEMENT head (title)> 6: <!ELEMENT body (p+)> 7: <!ELEMENT p (#PCDATA)> 8: ]> 9: <html> 10: <head><title>paragraphs</title></head> 11: <body><p>this is a paragraph.<br/> 12: <p>this is another paragraph.<br/> 13: <p>third paragraph.</body> 14: </html> 6. 1: <?xml version="1.0" encoding="utf-8"?> 2: <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 3: xmlns:dc="http://purl.org/dc/elements/1.1/"> 4: <rdf:description rdf:about=http://www.acronymfinder.com/> 5: <dc:title>acronym Finder</dc:title> 6: <dc:description>the Acronym Finder is a world wide 7: web (WWW) searchable database of more than 169,000 8: abbreviations and acronyms about computers, 9: technology, telecommunications, and military 10: acronyms and abbreviations.</dc:description> 11: <dc:subject> 12: <rdf:bag> 2

13: <rdf:li>astronomy</rdf:li> 14: <rdf:li>literature</rdf:li> 15: <rdf:li>mathematics</rdf:li> 16: <rdf:li>music</rdf:li> 17: <rdf:li>philosophy</rdf:li> 18: </rdf:bag> 19: </dc:subject> 20: </rdf:description> 21: </rdf:rdf> 7. 1: <?xml version="1.0" encoding="utf-8"?> 2: <!DOCTYPE html [ 3: <!ELEMENT html (head,body)> 4: <!ELEMENT head (title)> 6: <!ELEMENT body (p b i br)+> 7: <!ELEMENT p (b i)+> 8: <!ELEMENT br EMPTY> 9: <!ELEMENT b (#PCDATA i)*> 10: <!ELEMENT i (#PCDATA b)*> 11: ]> 12: <html><body> 13: <p><b><i>this paragraph is bold and italic.</b></i></p><br/> 14: <p><i><b>this paragraph is italic and bold.</i></b></p><br/> 15: </body></html> 8. 1: <?xml version="1.0" encoding="utf-8"?> 2: <!DOCTYPE catalog [ 3: <!ELEMENT catalog (work)> 4: <!ELEMENT work (title,author)> 6: <!ELEMENT author (#PCDATA)> 7: <!ATTLIST work type CDATA #REQUIRED> 8: <!ATTLIST work date CDATA #REQUIRED> 9: ]> 10: <catalog> 11: <work date= 1906 type="prose"> 12: <title>the Gift Of The Magi</title> 13: <author>o. Henry</author> 14: </work> 15: <work type= poem > 16: <title>the Raven</title> 17: <author>edgar Allen Poe</author> 18: </work> 19: <work type= play date= 1601 > 20: <author>william Shakespeare</author> 21: <title>hamlet</title> 22: </work> 23: </catalog> 3

9. 1: <?xml version="1.0" encoding="utf-8"?> 2: <letter> 3: <date>december 11, 2002</date> 4: <addressee> 5: <name>melvile Dewey</name> 6: <address_one> 7: Columbia University</address_one><address_two>New York, NY 8: </address_two> 9: </addressee> 10: <greeting>dear Melvile,</greeting> 11: <paragraph>i have been reading your ideas concerning nature of 12: librarianship, and <italics>i find them very intriguing</italics>. 13: I would love the opportunity to discuss with you...</paragraph> 14: <list><item>monday, 2-4</item> 15: <item>tuesday, 3-5</item> 16: <item>thursday, 1-3</item> 17: </list> 18: <paragraph>we hope you can join us.</paragraph> 19: <closing>sincerely, S. R. Ranganathan</closing> 20: </letter> 10. 1: <?xml version="1.0"?> 2: <!DOCTYPE dictionary [ 3: <!ELEMENT dictionary (word*)> 4: <!ELEMENT word (update name description definition)*> 5: <!ELEMENT update EMPTY> 6: <!ATTLIST update date CDATA #REQUIRED> 7: <!ELEMENT name (#PCDATA)> 8: <!ATTLIST name is_acronym CDATA #IMPLIED > 9: <!ELEMENT description (#PCDATA)> 10: <!ELEMENT definition (#PCDATA)> 11: ]> 12: <dictionary> 13: <word> 14: <update date="2002-12-23"/> 15: <name is_acronym="true">xml</name> 16: <description>extensible Markup Language</description> 17: </word> 18: <word> 19: <update date="2002-12-23"/> 20: <name is_acronym="true">pop</name> 21: <definition default>post Office Protocol</definition> 22: <definition>point Of Purchase</definition> 23: </dictionary> 11. 1: <?xml version="1.0" encoding="utf-8"?> 2: <domain type= kvm> 3: <name>domain</name>< 4: <memory>524288</memory> 5: <vcpu>2</vcpu> 4

6: <features><acpi/><pae/> 7: <clock offset= utc > 8: <disk type= block device= cdrom > 9: <driver name= qemu type= raw /> 10: <source file= /path/to/image.iso /> 11: <tar get dev= hdc bus= ide /> 12: <readonly/></name> 13: </disk> 14: </domain> 12. 1: <?xml version="1.0" encoding="utf-8"?> 2: <name>oyster Soup</name> 3: <author>eric Lease Morgan</author> 4: <copyright holder=eric Lease Morgan> 2003</copyright> 5: <ingredients> 6: <list> 7: <item>1 stalk of celery 8: <item>1 onion 9: <item>2 tablespoons of butter 10: <item>2 cups of oysters and their liquor 11: <item>2 cups of half & half 12: </list><cost>total cost < 36 euro </cost> 13: </ingredients> 14: <process><p>begin by sauteing the celery and onions in butter until 15: soft. 16: Add oysters, oyster liquor, and cream. Heat until the oysters float. 17: Serve in warm bowls.</p> 18: <p><i>yummy!</p></i> 19: </process> 13. 1: <?xml version="1.0" encoding="utf-8"?> 2: <!DOCTYPE list [ 3: <!ELEMENT list (list integer)*> 4: <!ELEMENT integer (#PCDATA)> 5: <!ATTLIST list list CDATA #IMPLIED> 6: ]> 7: <list> 8: <integer>3</integer> 9: <list list="list of lists of integers"> 10: <list> 11: <integer>4</integer> 12: <integer>9</integer> 13: </list> 14: </list> 15: <integer>13</integer> 16: <list/> 17: </list> 5

Exercice 2 : XML et DTD Soit le document XML suivant : <?xml version="1.0" encoding="iso-8859-1"?> <facture> <etabliepar> Sociéte Orégram </etabliepar> <date> 3 décembre 2008 </date> <areglerpar> Sociéte Béta </areglerpar> <lignes> <ligne> <article> service Alpha </article> <Prix monnaie="euro"> 2000 </Prix> </ligne> <ligne> <article> service gamma </article> <Prix monnaie="euro"> 345 </Prix> </ligne> </lignes> <total> Total TTC 2345 </total> </facture> Questions : 1. Dessiner un arbre qui montre la structure du document XML ci-dessus. 2. Donner la DTD de ce fichier. Exercice 3 : XML et DTD On veut produire un fichier XML permettant de représenter les films d une cinémathèque. On dispose du cahier des charges suivants : une cinémathèque contient des films ; chaque film est décrit par son titre, son réalisateur, la date de sa première diffusion, son genre et le pays de son producteur ; la date de diffusion est composée du jour, du mois et de l année. Questions : 1. Dresser un arbre montrant la structure du document XML. 2. Quel sera le document XML correspondant au tableau figurant à la fin de l exercice. 3. Modifier la structure du fichier XML pour qu un film ne soit décrit que par une seule balise (il n est plus composé). 4. Donner les dtd des deux versions du fichier XML de la cinémathèque. titre réalisateur date genre pays Razzia sur la chnouf Henri Decoin 07/04/1955 policier Français Les tontons flingueurs Georges Lautner 27/11/1963 comédie Franco-italo-allemand Les Barbouzes Georges Lautner 10/12/1964 comédie Franco-italien Exercice 4 : XML Schema Écrire les fichiers XML schema des documents XML produits lors des exercices 1 et 2. 6