dtd_schema_xml_azerty.py

Created by joelkouakou2080

Created on March 01, 2023

1.32 KB


On donne la DTD suivante 
enregistrée dans le fichier
azerty.dtd <!ELEMENT truc 
(alpha+, beta, gamma+)>

<!ENTITY %content "alphal, alpha2"> <!ELEMENT alpha (%content, alpha3)>

<!ELEMENT alphal (#PCDATA)>

<!ELEMENT alpha2 (#PCDATA)>

<!ELEMENT alpha3 EMPTY>

<!ENTITY %beta " betal+ | beta2* ">

<!ELEMENT beta (%beta)>

<!ELEMENT betal (#PCDATA)>

<!ELEMENT beta2 (#PCDATA)>

<!ELEMENT gamma (gammal*, gamma2?)>

<!ELEMENT gammal (#PCDATA)>

<!ELEMENT gamma2 (#PCDATA)>

Proposer un document xml respectant
la définition ci-dessus

Réponses :
----------

<!DOCTYPE truc SYSTEM "azerty.dtd">
<truc>
  <alpha>
    <alphal>Contenu de alpha l</alphal>
    <alpha2>Contenu de alpha 2</alpha2>
    <alpha3/>
  </alpha>
  <beta>
    <betal>Contenu de beta l</betal>
    <beta2>Contenu de beta 2</beta2>
  </beta>
  <gamma>
    <gammal>Contenu de gamma l</gammal>
    <gammal>Contenu de gamma l bis</gammal>
    <gamma2>Contenu de gamma 2</gamma2>
  </gamma>
</truc>

Dans ce document, on respecte
la structure de la DTD en créant 
des éléments truc, alpha, beta 
et gamma, avec les sous-éléments
définis dans la DTD. Les 
éléments alphal, alpha2, alpha3,
betal, beta2, gammal et gamma2
contiennent des données textuelles.
Notez que l'élément beta2 est 
facultatif et peut être présent 
zéro ou plusieurs fois.

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.