cvc-elt.1: Cannot find the declaration of element 'MyElement'

后端 未结 3 1116
小蘑菇
小蘑菇 2020-12-01 07:42

I\'m trying to validate a really simple xml using xsd, but for some reason I get this error. I\'ll really appreciate if someone can explain me why.

XML File

3条回答
  •  没有蜡笔的小新
    2020-12-01 07:44

    I got this same error working in Eclipse with Maven with the additional information

    schema_reference.4: Failed to read schema document 'https://maven.apache.org/xsd/maven-4.0.0.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not .
    

    This was after copying in a new controller and it's interface from a Thymeleaf example. Honestly, no matter how careful I am I still am at a loss to understand how one is expected to figure this out. On a (lucky) guess I right clicked the project, clicked Maven and Update Project which cleared up the issue.

提交回复
热议问题