XML DTD Validation

Hello,
I cannot validate this markup:
 
<?xml version="1.0" encoding="ISO-8859-1" ?> 
<!DOCTYPE entry [
     <!ELEMENT entry (title, author,dayname, date, bodytext)>
     <!ELEMENT date (day,month,year)>
     <!ELEMENT title (#PCDATA)> 
     <!ELEMENT author (PCDATA)> 
     <!ELEMENT dayname (#PCDATA)> 
     <!ELEMENT date (#PCDATA)> 
      <!ELEMENT body (#PCDATA)> 
     <!ELEMENT day (#PCDATA)> 
      <!ELEMENT month (#PCDATA)> 
      <!ELEMENT year (#PCDATA)> ]>

<entry>

<!-- This is an XML comment - just like an HTML comment. -->

<!--
This file shows a simple data structure, which could be used,
perhaps, for weblog entries -->

<!--
The structure has a root node called "entry".
In this example author information has been included as a child within the entry.
In this example date information has been included as a child within the entry.

In this example the date information has itself been broken down into "child" nodes for day, month and year.

Some developers prefer this style
-->
   
<title>A rainy day</title>
<author>Sandra</author>
<dayname>Thursday</dayname>

<date>
	<day>5</day>
	<month>2</month>
	<year>2004</year>
</date>
<bodytext>Today it was raining ... more ... more ... </bodytext>

</entry>

Open in new window

I tried validome.org XML DTD
and it gives me this error: "Markup declarations contained in or pointed to by document type declaration must be well-formed."

How can I fixed it? Is there any other errors? How can I validate it?
LVL 16
SSupremeAsked:
Who is Participating?

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

x
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.

Gertone (Geert Bormans)Information ArchitectCommented:
The DTD is wrong

<!ELEMENT date (day,month,year)>
...
<!ELEMENT date (#PCDATA)>

you declare "date" twice (with a different definition)
In DTD all declarations are global
0
Gertone (Geert Bormans)Information ArchitectCommented:
another bug
<!ELEMENT author (PCDATA)>
should be
<!ELEMENT author (#PCDATA)>
0
Gertone (Geert Bormans)Information ArchitectCommented:
and you forgot a declaration
<!ELEMENT bodytext (#PCDATA)>

I added the full corrected DTD

Then both DTD and instance are valid
<!ELEMENT entry (title, author,dayname, date, bodytext)>
<!ELEMENT date (day,month,year)>
<!ELEMENT title (#PCDATA)> 
<!ELEMENT author (#PCDATA)> 
<!ELEMENT dayname (#PCDATA)> 
<!ELEMENT bodytext (#PCDATA)> 
<!ELEMENT body (#PCDATA)> 
<!ELEMENT day (#PCDATA)> 
<!ELEMENT month (#PCDATA)> 
<!ELEMENT year (#PCDATA)>

Open in new window

0
Acronis Data Cloud 7.8 Enhances Cyber Protection

A closer look at five essential enhancements that benefit end-users and help MSPs take their cloud data protection business further.

SSupremeAuthor Commented:
Why do I still get this error? Where can I validate it myself? Thanks
 Error DTD
0
Gertone (Geert Bormans)Information ArchitectCommented:
It seems that your validator does not support Internal Declarations of the DTD

I cite:
Please note: With respect to personalized (but still XML conform) grammars, we check the document against the grammar (DTD or Schema) you pointed to within document.
Please specify an available URL to your XML DTD or Schema, so Validome can process validation.

You need to exterialise the DTD, put it at a URL and use a SYSTEM identifier in your DOCTYPE declaration
0

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
SSupremeAuthor Commented:
Thanks
0
Gertone (Geert Bormans)Information ArchitectCommented:
Or use a better quality tool, such as www.oxygenxml.com (paid for license)
or http://free.editix.com/download.html (pretty basic, but free for non commercial use, windows only)
0
Gertone (Geert Bormans)Information ArchitectCommented:
welcome
0
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
Software

From novice to tech pro — start learning today.