XML : XML: DTD questions

I have some exercises to be solved on the DTD. The DTD to be analyzed is the following:

  <!DOCTYPE a [      <!ELEMENT a (a*,(u|s|z),a*,y,((t,y)|(w,z)))>      <!ELEMENT s (#PCDATA|w)*>      <!ELEMENT t (x?,w*,(t|a|s)?)>      <!ELEMENT u (a?,(u|s)*,(z,y)+)>      <!ELEMENT x (#PCDATA|x)*>      <!ELEMENT y (#PCDATA|x)*>      <!ELEMENT w EMPTY>      <!ELEMENT z ((z,y)*,(u|s)+)>      <!ATTLIST s attrs CDATA #REQUIRED>      <!ATTLIST u attru CDATA #IMPLIED>      <!ATTLIST x attrx CDATA #REQUIRED>  ]>    

I wanted to ask you the following questions: 1)Can a DTD in XML have in the content-model of the declaration of an element, the element declared himself? As an example, you can declare the elements in this way?

  <!ELEMENT x (#PCDATA|x)*>     

or another example:

  <!ELEMENT a (a*,(u|s|z),a*,y,((t,y)|(w,z)))>    

where the declaration of a and the declaration of x contains a and x?

2) Can the declaration of a non root-element contains in his content-model the root element? For example in this DTD "a" is the root-element and:

  <!ELEMENT t (x?,w*,(t|a|s)?)>    

can the element t, contains the root-element a?

3) Are there some errors in the DTD I've posted? If yes, which are the errors?

Thanks for your help.

No comments:

Post a Comment