DTD - how to define attritbutes and two child elements

I have an XML file with two child elements to the root but I am getting a null error for the second child element.  It is also expecting definition for the attributes, could you show how this is done?

Thank you.  See the attachments.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mark BullockQA EngineerCommented:
I used this tool http://www.xmlvalidation.com/
with your input files.

It reported these errors.
Attribute "favcolor" must be declared for element type "family".
Attribute "gender" must be declared for element type "family".
Element type "friend" must be declared.
Gertone (Geert Bormans)Information ArchitectCommented:
<!ELEMENT contacts (family|friend)+>
<!ELEMENT friend (name,address,city,state,zip_code,phone,birthday?)>
<!ELEMENT family (name,address,city,state,zip_code,phone,birthday?)>
<!ATTLIST friend
favcolor CDATA #IMPLIED 
<!ATTLIST family
favcolor CDATA #IMPLIED 
<!ELEMENT address (#PCDATA)>
<!ELEMENT state (#PCDATA)>
<!ELEMENT zip_code (#PCDATA)>
<!ELEMENT phone (#PCDATA)>
<!ELEMENT birthday (#PCDATA)>

Open in new window

Gertone (Geert Bormans)Information ArchitectCommented:
I added an element "friend" having the same content model as "family"

For attributes you need an <!ATTLIST
first component is the name of the element the attribute is for
then a list of attribute declaration three components each: name, content type, required or not

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Gertone (Geert Bormans)Information ArchitectCommented:
You say this is an assignment, but you are obviously missing the basics.
Please read the course material before jumping right in the task,
it would help you understand what is going on

or start here
it is not a good tutorial, but it gives you some syntax basics
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.