Search code examples
xmldtd

DTD when the element has more than 1 attributes


For this xml line

<Employment type ="Full">...</Employment>

I have wrote this dtd line

<!ATTLIST Employment type (Full|Part) "Full">

Now, what if I have more than one attributes like this

<Institution from ="2011" to ="2014">...</Institution>

How do I represent its dtd?

Thanks for helping


Solution

  • Just add another <!ATTLIST> for the second attribute.

    So it might be something like

    <!ATTLIST Institution from CDATA #REQUIRED>
    <!ATTLIST Institution to CDATA #REQUIRED>