DTD solved test (tortillas)

This commit is contained in:
Rafa Muñoz
2024-10-16 10:19:04 +02:00
parent f19320e72e
commit 5d85cdff7c
2 changed files with 43 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
<!ENTITY % atributoCodigoID "codigo ID #IMPLIED">
<!ELEMENT tortillas (local*, tortilla*)>
<!ELEMENT local (#PCDATA | localidad)*>
<!ATTLIST local cantidad (tapa | media | entera) "entera">
<!ELEMENT localidad EMPTY>
<!ATTLIST localidad nombre CDATA #REQUIRED
%atributoCodigoID;
comarca CDATA #FIXED "Subbética">
<!ELEMENT tortilla (ingredientes, puntuacion?, opinion+)>
<!ELEMENT puntuacion (#PCDATA)>
<!ELEMENT opinion (#PCDATA)>
<!ELEMENT ingredientes (patatas, huevo, (cebolla | pimientos))>
<!ELEMENT patatas EMPTY>
<!ELEMENT huevo EMPTY>
<!ELEMENT cebolla EMPTY>
<!ELEMENT pimientos EMPTY>
<!ATTLIST tortilla locales IDREFS #REQUIRED
localPreferido IDREF #IMPLIED
%atributoCodigoID;>
<!ENTITY estrella "Estrella Galicia">

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE tortillas SYSTEM "tortillas.dtd">
<tortillas>
<local cantidad="tapa">Bar Manolo - Tiene &estrella;
<localidad nombre="Moriles" codigo="Bar_Manolo"
comarca="Subbética" />
</local>
<local cantidad="entera">Bar Pepe
<localidad nombre="Lucena" codigo="Bar_Pepe"
comarca="Subbética" />
</local>
<tortilla locales="Bar_Manolo Bar_Pepe" localPreferido="Bar_Pepe"
codigo="tortilla_1">
<ingredientes>
<patatas/>
<huevo/>
<cebolla/>
</ingredientes>
<puntuacion>9</puntuacion>
<opinion>Es estupenda</opinion>
<opinion>Es horrible</opinion>
</tortilla>
</tortillas>