When Eclipse detects an invalid XML document, in my case a web.xml
file, it dumps the content model of the DTD and tells me that the element is invalid. This is quite unhelpful, since it ends up telling me that:
The content of element type "web-app" must match "(icon?,display-name?,description?,distributable?,context-param*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-local-ref*)".
In a 900-line web.xml file, the error is not easy to find.
How can I single out the first element which causes the document to be invalid?