Search code examples
xmleclipsexml-parsingdtd

how can i solve "No grammar constraints (DTD or XML Schema) referenced in the document." WARNING


I have an eclipse dynamic web Project, this warning appear in all XML files;

No grammar constraints (DTD or XML Schema) referenced in the document.

enter image description here

how can i solve it ?


Solution

  • To resolve an error whose message is "No DTD or schema referenced in document", perhaps the simplest approach would be to reference the relevant DTD or schema from the document. That involves (a) having a DTD or XSD schema for each document type you are using, (b) knowing where they are, and (c) adding the appropriate reference to the document, or supplying the relevant information elsewhere in the Eclipse configuration. Your question provides no clue as to which of these you are finding hard or confusing.

    Or possibly you merely want to change some option in Eclipse to make it stop expecting that there will be a DTD or schema -- it would be surprising to me if Eclipse required that there be a schema for every bit of XML it is asked to handle, so it looks off hand as if something in your setup was asking Eclipse not just to work with the XML but to validate it.