Is there a way to enforce in the DTD that the user must insert 8 digits in an attribute?

Current DTD:
Code:
<!ELEMENT din	EMPTY>
<!ATTLIST din
	 code   	CDATA
>
The user must then enter an 8 digit number in the xml document.

Code:
<din code="12345678">
if the user enters <din code="12345"> it should be an error.

Hope...