Manuel
Manuel

Reputation: 9522

DTD Definition two children with the same childs

I got three elements defined in a dtd which have the same child element names. What is the correct syntax for:

  1. for all children having the same definition
  2. elements having different children definitions

Example idea: is this valid?

<!ELEMENT one ( childone?, childtwo? ) >
<!ELEMENT two ( childone?, childtwo? ) >
<!ELEMENT three ( childone?, childtwo? ) >
    <!ELEMENT childone ( #PCDATA ) >
    <!ELEMENT childtwo ( #PCDATA ) >

I appreciate your help! Thanks a lot!

Upvotes: 0

Views: 419

Answers (1)

Daniel Haley
Daniel Haley

Reputation: 52858

Yes, your example idea is valid for your first scenario (for all children having the same definition).

Your second scenario (elements having different children definitions) isn't possible. You're only allowed to have one declaration per element. You would have to declare new elements with unique names.

Upvotes: 1

Related Questions