I'm currently trying to write a DTD for an XML file.
In the xml I came across this type of things :
<CHAMP NAME="JBRTHDTC" DOMAIN="DM" DB="YES:CRF" TYPE="JOUR" FORCED="YES" AFFICHE="YES">
<![CDATA[ Date de naissance: ]]>
<MESSAGE><![CDATA[Date de naissance (Jour)]]></MESSAGE>
</CHAMP>
Is it ok to have CDATA and a xml element inside another?
If so, how can I manage to write it in DTD? Like
ELEMENT CHAMP (MESSAGE?|CDATA??)>
You have to declare
CHAMPas a mixed content model.This means that
CHAMPcan contain either#PCDATA(parsed character data) orMESSAGE. (You can still haveCDATAsections in the mixed content model.)This has to be declared a certain way, so you won't be able to limit the number of occurrences of
MESSAGE. It's zero or more#PCDATAorMESSAGEin any order.Example: