Hello fisrt time posting. i was doing a dtd to validate an xml and idk why when my code is readed the doctype declaration is closed with the ">" of the fisrt element of the dtd instead of at the end where the "]>" is placed. i have spend a few hours with this but no one of my friends knows xml.
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE torneo [
<!ELEMENT torneo (edicion, anteriorGanador, participante+)>
<!ATTLIST torneo
edicion CDATA #REQUIRED
anteriorGanador CDATA #REQUIRED>
<!ELEMENT participante (idP, pareja, nombre, edad, cabezaDeSerie?)>
<!ATTLIST participante
idP ID #REQUIRED
pareja IDREF #REQUIRED>
<!ELEMENT nombre (#PCDATA)>
<!ELEMENT edad (#PCDATA)>
<!ELEMENT cabezaDeSerie (EMPTY)>
]>
You seem to want
edicionandanteriorGanadorto be attributes oftorneo, andidPandparejato be attributes ofparticipante. To get this to work, just remove the specification of those attributes as sub-elements.