XML, DTD fix internal content of dtd

0

I try to make this work without changing the external content, just by changing the inside of the dtd. He always tells me that I'm missing a "(" in text or any other element on line 8.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mensajes [
 <!ELEMENT mensajes (mensaje*)>
 <!ELEMENT mensaje (de, para, hora, texto)>
 <!ELEMENT de (#PCDATA)>
 <!ELEMENT para (#PCDATA)>
 <!ELEMENT hora (#PCDATA)>
 <!ELEMENT texto (((#PCDATA) , strong) | (#PCDATA))>
 <!ELEMENT strong (#PCDATA)>
]>
<mensajes>
 <mensaje>
     <de>Pepe ([email protected])</de>
     <para>Juan ([email protected])</para>
     <hora>28/02/2011 17:48:23,61</hora>
     <texto>¿Hola, Juan, qué haces?</texto>
 </mensaje>
 <mensaje>
     <de>Juan ([email protected])</de>
     <para>Pepe ([email protected])</para>
     <hora>28/02/2011 17:54:20,87</hora>
     <texto>Aquí, aprendiendo <strong>XML</strong></texto>
 </mensaje>
</mensajes>

This is the error exactly:

(21   A '(' character or an element type is required in the declaration of element type
"texto").
    
asked by Darckan 21.02.2018 в 10:25
source

1 answer

0

Line 8 should be like this to add mixed elements.   <!ELEMENT texto (#PCDATA | strong)*>

    
answered by 21.02.2018 в 11:14