XML DTD Validate. Difference in Eclipse and other editors

328 Views Asked by At

I have XML with inline DTD

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE why [
<!ELEMENT why (animal,weight,age) >
]>  
<why>
 <animal>giraffe</animal>
 <weight>1192</weight>
 <age>26</age>
</why>

Eclipse completes validation with no errors or warnings. But other editors find errors of course. I'm agree with other editors))

Why does Eclipse work this way? Autocomplete? I wonder.

Thanks.

1

There are 1 best solutions below

2
On BEST ANSWER
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE why [
<!ELEMENT why (animal,weight,age) >
<!ELEMENT animal (#PCDATA)>
<!ELEMENT weight (#PCDATA)>
<!ELEMENT age (#PCDATA)>
]>  
<why>
 <animal>giraffe</animal>
 <weight>1192</weight>
 <age>26</age>
</why>

You can validate your xml-dtd whit this page : http://validator.w3.org/#validate_by_upload