<!DOCTYPE
>
<!DOCTYPE hello [
<!ELEMENT hello (#PCDATA)>
] >
<?xml version="1.0" standalone="yes" ?>
<hello> Hello XML et hello cher lecteur ! </hello>
<?xml version="1.0" standalone="yes" ?>
<!DOCTYPE hello [
<!ELEMENT hello (#PCDATA)>
]>
<hello> Hello XML et hello chère lectrice ! </hello>
<!ELEMENT name (family,given)>
<!ELEMENT family (#PCDATA)>
name ==> family + given
family ==> "texte"
<!ELEMENT person (name,email? ) |
||
<!ELEMENT person (name,email+ ) |
||
<!ELEMENT person (name,email* ) |
||
<!ELEMENT person (email | fax ) |
||
<!ELEMENT person (name ,email? ) |
||
<!ELEMENT liste ( name,email)+ |
<!ELEMENT addressBook (person)+>
<!ELEMENT person (name,email*)>
<!ELEMENT name (family,given)>
<!ELEMENT family (#PCDATA)>
<!ELEMENT given (#PCDATA)>
<!ELEMENT email (#PCDATA)>
<addressBook>
<person>
<name> <family>Wallace</family> <given>Bob</given> </name>
<email>bwallace@megacorp.com</email>
</person>
<person>
<name> <family>Tuttle</family> <given>Claire</given> </name>
<email>ctuttle@megacorp.com</email>
</person>
</addressBook>
<addressBook>
<address>Derrière le Salève</address>
<person>
<name>
<family>Schneider</family> <firstName>Nina</firstName>
</name>
<email>nina@dks.com</email>
</person>
<name>
<family> Muller </family> </name>
</addressBook>
<!ELEMENT list (recipe+)>
<!ELEMENT recipe (author, recipe_name, meal, ingredients, directions)>
<!ELEMENT author (#PCDATA)> <!ELEMENT recipe_name (#PCDATA)> <!ELEMENT meal (#PCDATA)>
<!ELEMENT ingredients (item+)> <!ELEMENT item (#PCDATA)> <!ELEMENT directions (#PCDATA)>
<!ATTLIST target_tag attr_nom TypeAttribut TypeDef Defaut>
Attribut obligatoire (l'utilisateur doit rentrer une valeur) |
|
Attribut avec valeur fixe (la valeur est déjà fixée dans la DTD) |
<!ATTLIST person prenom CDATA #REQUIRED>
<!ATTLIST person gender (male|female) #IMPLIED>
<!ATTLIST form method CDATA #FIXED "POST">
<!ATTLIST list type (bullets|ordered) "ordered">
<!ATTLIST sibling type (brother|sister) #REQUIRED>
<!ATTLIST person id ID #REQUIRED>
<?xml version="1.0" encoding="UTF-8"?>
<!ELEMENT addressBook (person)+>
<!ELEMENT person (name,email*)>
<!ATTLIST person id ID #REQUIRED>
<!ATTLIST person gender (male|female) #IMPLIED>
<!ELEMENT name (#PCDATA|family|given)*>
<!ELEMENT family (#PCDATA)>
<!ELEMENT given (#PCDATA)>
<!ELEMENT email (#PCDATA)>
<!ELEMENT link EMPTY>
<!ATTLIST link manager IDREF #IMPLIED subordinates IDREFS #IMPLIED>
<!DOCTYPE addressBook SYSTEM "ab.dtd">
<addressBook>
<person id="B.WALLACE" gender="male">
<name>
<family>Wallace</family> <given>Bob</given>
</name>
<email>bwallace@megacorp.com</email>
<link manager="C.TUTTLE"/>
</person>
<person id="C.TUTTLE" gender="female">
<name>
<family>Tuttle</family> <given>Claire</given>
</name>
<email>ctuttle@megacorp.com</email>
<link subordinates="B.WALLACE"/>
</person>
</addressBook>
<!ENTITY nom_du_tag "contenu">
<!ENTITY tecfaUnit "Unité de technologies de formation et apprentissage">
<!ENTITY tecfaDesc SYSTEM "http://tecfa.unige.ch/../tecfa_description.xml">
<!ENTITY pm "Patrick Mendelsohn">
<!ENTITY acirc "Â">
<!ENTITY espace " ">
<!ENTITY copyright "©">
<!ENTITY explication SYSTEM "project1a.xml">
<!ENTITY % stamp '
id ID #IMPLIED
creation-day NMTOKEN #IMPLIED
.......
mod-by NMTOKEN #IMPLIED
version NMTOKEN #IMPLIED
status (draft|final|obsolete) #IMPLIED
approval (ok|not-ok|so-so) #IMPLIED
main-author CDATA #IMPLIED
'
>
Usage: Les listes d'attributs ci-dessous contient tous les attributs définis dans l'entité %stamp;
<!ELEMENT main-goal (title, content, (after-thoughts)?, (teacher-comments)?)>
<!ATTLIST main %stamp; >
<!ELEMENT title (...)>
<!ATTLIST main %stamp; >
<! ENTITY % foreign-dtd SYSTEM "ibtwsh6_ePBL.dtd" >
%foreign-dtd;
<!ELEMENT introduction %vert.model ;>
<!ELEMENT introduction %struct.model; >
<!ELEMENT conclusion %struct.model;>