-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
62 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<addressBook xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="schemaCarnet.xsd"> | ||
<identity> | ||
<nom></nom> | ||
<prenom></prenom> | ||
|
||
</identity> | ||
</addressBook> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> | ||
|
||
<!-- il fallait spécifier un élément racine --> | ||
<xs:element name="addressBook"> | ||
<xs:complexType> | ||
<xs:sequence> | ||
<!-- ici on retrouve ce que tu avais commencé à faire avec une cardinalité pour rendre l’élément identity obligatoire --> | ||
<xs:element name="identity" minOccurs="1" maxOccurs="1"> | ||
<xs:complexType> | ||
<xs:sequence> | ||
<!-- on aurait aussi pu rassembler les parties de nom ensemble (tu peux essayer) --> | ||
<xs:element name="nom" type="xs:string" /> | ||
<xs:element name="prenom" type="xs:string" /> | ||
<xs:element name="birthdate" type="xs:date" /> | ||
</xs:sequence> | ||
</xs:complexType> | ||
</xs:element> | ||
<!-- ici, on pointe vers les définitions déjà créées en fournissant des cardinalités, c’est un moyen de modulariser l’écriture du schéma --> | ||
<xs:element name="address" type="address" minOccurs="0" maxOccurs="unbounded" /> | ||
<xs:element name="tel" type="tel" minOccurs="0" maxOccurs="unbounded" /> | ||
</xs:sequence> | ||
</xs:complexType> | ||
</xs:element> | ||
<!-- fin de l’ajout --> | ||
|
||
<!-- ici j’ai remanié pour définir des complexType directement avec un nom car je les appelle dans l’élément racine --> | ||
|
||
|
||
|
||
<!-- j'ai supprimé la définition d’élément qui les entourait pour pouvoir appeler les définitions plus haut --> | ||
<!-- l’adresse répétable (cf. racine), l’ajout d’un attribut aurait permis de la répéter avec adresse perso, pro, etc. --> | ||
<xs:complexType name="address"> | ||
<xs:sequence> | ||
<xs:element name="number" type="xs:positiveInteger" /> | ||
<xs:element name="street" type="xs:string" /> | ||
<xs:element name="codePostal" type="xs:positiveInteger" /> | ||
</xs:sequence> | ||
</xs:complexType> | ||
|
||
<xs:complexType name="tel"> | ||
<xs:choice> | ||
<!-- ici j’aurais sans doute privilégié la création d’attribut --> | ||
<xs:element name="fix" type="xs:positiveInteger" /> | ||
<xs:element name="mobile" type="xs:positiveInteger" /> | ||
</xs:choice> | ||
</xs:complexType> | ||
|
||
|
||
|
||
</xs:schema> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.