Your best way of knowing is to use an online XML validator
- Create your XML document
- Write your DTD
- Insert it DTD at the right spot in the XML document
- Run the validator. It will check your DTD against your markup
If there are errors, then continue editing the DTD to fit your markup, assuming your markup is what you want. I have often found out that markup is edited while I edit the DTD (going back and forth).
I see multiple errors in your DTD now. One is an unmatched right-hand parenthesis (')') in your DTD. No parenthesis is need with the EMPTY declaration.
You are also missing the root element/node definition: "<!DOCTYPE root [ ..... ]>", which must contain all your declarations.
You should show us your "well-formed" (not valid) XML markup/content. Well-formed is just the markup without any DTD or xml-schema.
Suppose your root element is named 'root'. The following is both a well-formed and valid(ated) XML document for what you want
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE root [
<!ELEMENT root (web_site)>
<!ELEMENT web_site EMPTY>
<!ATTLIST web_site url CDATA #REQUIRED>
<web_site url="http://a.website.com" />
Note that you should probably be learning to make XML Schema rather than using the DTD. DTD is insufficient for specifying limitations on attribute values and certain content.
For example, the DTD will not verify that the attribute value for the URL is a valid URL string. The XML schema can check for a valid URL type string.