« Programmation XML/Définition de Type Document » : différence entre les versions

Contenu supprimé Contenu ajouté
Aucun résumé des modifications
Ligne 34 :
* '''ANY''' : la structure de l'élément est libre
* '''EMPTY''' : l'élément est vide
* '''#PCDATA(Parsed Character Data)''' : donnée textuelle analysable
 
On peut préciser ces qualificateurs grâce aux éléments suivants :
Ligne 86 ⟶ 87 :
</service>
</repertoire>
</source>
 
== Entités ==
Déclarer une entité permet de l'intégrer ensuite en appelant son nom<ref>http://xmlwriter.net/xml_guide/entity_declaration.shtml</ref>. Ex :
<source lang="xml">
<!ENTITY intro!
SYSTEM "https://fr.wikibooks.org/wiki/Programmation_XML/Introduction.xml">!
 
<b>
$intro;
</b>
</source>
 
Ligne 112 ⟶ 102 :
| #FIXED value || attribut de valeur fixe
|}
 
==Types ==
{|class="wikitable"
! Type !! Description
|-
| CDATA || The value is character data
|-
| (en1|en2|..) || The value must be one from an enumerated list
|-
| ID || The value is a unique id
|-
| IDREF || The value is the id of another element
|-
| IDREFS || The value is a list of other ids
|-
| NMTOKEN || The value is a valid XML name
|-
| NMTOKENS || The value is a list of valid XML names
|-
| ENTITY || The value is an entity
|-
| ENTITIES || The value is a list of entities
|-
| NOTATION || The value is a name of a notation
|-
| xml: || The value is a predefined xml value
|}
 
=== Entity ===
Déclarer une entité permet de l'intégrer ensuite en appelant son nom<ref>http://xmlwriter.net/xml_guide/entity_declaration.shtml</ref>. Ex :
<source lang="xml">
<!ENTITY intro!
SYSTEM "https://fr.wikibooks.org/wiki/Programmation_XML/Introduction.xml">!
 
<b>
$intro;
</b>
</source>
 
==Références==