Eclipse - cvc-elt.1: Cannot find the declaration of element error | About Publisher

Eclipse - cvc-elt.1: Cannot find the declaration of element error

When working with XML files in Eclipse, a common error developers encounter is; cvc-elt.1: Cannot find the declaration of element "some-element-name".

The error message gives a clue on which file the error exists by pointing to the element name, but does not give any information on why this error is shown or how it could be fixed.

Solution

Given error is generated if parser could not find any specification on the given elements when Eclipse tries to parse the XML file using Xerces XML parser. To over come the error, XML file must be provided with a specification (a schema file or a DTD file).

Below are two such examples with the fix.

<!DOCTYPE mule-configuration PUBLIC
"-//Comp //DTD configuration XML V1.0//EN"
"http://www.comp.com/dtds/proj/project-configuration.dtd">
or

<element
xmlns="http://www.comp.com/schema/element"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.comp.com/schema/element
http://www.comp.com/schema/element/elements-1.0.xsd">

Hope this tip would help you.
Share this article please, on :
Share on fb Tweet Share on G+

0 Response to "Eclipse - cvc-elt.1: Cannot find the declaration of element error"

Post a Comment