you have two options:
configure workspace settings (disable the validation for the current workspace): go to window > preferences > validation and uncheck the manual and build for: xml schema validator, xml validator
check enable project specific settings (disable the validation for this project): right-click on the project, select properties > validation and uncheck the manual and build for: xml schema validator, xml validator
right-click on the project and select validate to make the errors disappear.
in jboss developer 4.0 and above (eclipse-based), this is a tad easier. just right-click on your file or folder that contains xml-based files, choose "exclude validation", then click "yes" to confirm. then right-click the same files/folder again and click on "validate", which will remove the errors with a confirmation.
ensure your encoding is correct for all of your files, this can sometimes happen if you have the encoding wrong for your file or the wrong encoding in your xml header.
so, if i have the following newfile.xml:
<?xml version="1.0" encoding="utf-16"?>
<bar foo="foiré" />
and the eclipse encoding is utf-8:
the encoding of your file, the defined encoding in eclipse (through properties->resource) and the declared encoding in the xml document all need to agree.
the validator is attempting to read the file, expecting <?xml ... but because the encoding is different from that expected, it's not finding it. hence the error: content is not allowed in prolog. the prolog is the bit before the <?xml declaration.
when you suspend the validators, the error messages that you've generated don't go away. to get them to go away, you have to manually delete them.
- suspend the validators
- click on the 'content is not allowed in prolog' message, right click and delete. you can select multiple ones, or all of them.
- do a project->clean. the messages should not come back.
i think that because you've suspended the validators, eclipse doesn't realise it has to delete the old error messages which came from the validators.
window > preferences > validation > uncheck xml validator manual and build
the other answers may work for you, but they did not cover my case. i wanted some xml to be validated, and others not. this image shows how to exclude certain folders (or files) for xml validation.
begin by right clicking the root of your eclipse project. select the last item: properties...
(if your browser scales this image very small, right click and open in a new window or tab.)
- eclipse appears to be very sensitive if you click the **browse file...* or **browser folder...* button. this dialog needs some work!
- this was done using eclipse 4.3 (kepler).
- Disable XML validation in Eclipse
- How to disable the JSP validation in Eclipse helios?
- Eclipse how to disable validation for txt file (lsp4e)
- eclipse disable completion of xml comment
- How can I disable HTML validation for PHP files in Eclipse Juno 4.2.1?
- Eclipse proxy setting for XML validation
- How to disable APT web service validation in Eclipse 4.4 edition for JavaEE Developers
- XML validation by XSLT or Schematron in Eclipse XML Editor?
- How can one disable the XML editor in Eclipse for .xsd and related files?
- Eclipse xml validation
- How to disable Eclipse HTML validation via M2E
- eclIpse 3.7 disable DTD validation (validation *of DTDs*)
- XML validation and auto-complete in Eclipse
- Disable tool tips of XML files in Eclipse
- Disable generics validation in Eclipse via M2E
- Eclipse gradle project's spring xml validation
- Eclipse : how to disable validation for SVG files
- Eclipse plugin: Disable context menu contributon if no xml is selected
- Eclipse Kepler XML validation
- Eclipse Validation not picking up any errors in XML file? How do I check XML?
- Eclipse RCP: Disable Menu Entry for Command via Plugin XML
- Disable part of validation (annotations) in PHP Eclipse Photon
- Xml validation Error Eclipse Crash Deployment of App
- Eclipse: how to disable XML validation for a specific test-file?
- Eclipse extension point for excluding faceted projects from XML validation
- Eclipse Hibernate XML Editor: Property tag validation
- XML Validation in Eclipse
More Query from same tag
- Multiple Eclipse IDE apps don't show up on Launchpad
- Eclipse editor is freezing when scrolling
- Kerberos: Login failure for <user> from keytab file javax.security.auth.login.LoginException: Unable to obtain p assword from user
- How to enable Eclipse to autobuild/autosave changes before run (CDT)
- How do I enable undo in eclipse ant editor?
- How to force StyledText to break line in SWT
- Eclipse Mars - set default settings for C++ project (c++11 set by default)
- Ghost error with M2 Eclipse
- How to calculate order-complexity of the following algorithm
- Where are the Eclipse XML Editor Preferences?
- eclipse and codeigniter
- Project library not getting added to android project
- Running JPA project in Eclipse
- Eclipse relative ClassPath question
- How to import RESTful Server Hapi Fhir?
- can't run app on eclipse using google play service
- BIRT Formatting Legend of a bar chart
- my android app runs fine in the emulator, but when i publish it it's wrong
- How to start Eclipse from Ubuntu on startup
- Type fatal error: gtk/gtk.h: No such file or directory during Eclipse (Oxygen) compilation
- Use Eclipse/CMake with existing C++ project
- How to exclude .class files from file search in Eclipse?
- Is there any way to export the renderscript to *.jar without manual copying the *.bc?
- How to export the Eclipse plugins to a folder "eclispe" with the cotent .exlipsextension and subfolder plugins
- how can i make eclipse stop formatting my code
- How to launch an Android project from an Eclipse plugin programmatically?
- Running my new code runs my old code?
- Run maven test in junit window
- Run on server option does not display in eclipse helios for spring-maven project
- Is there a way to add documentation for Python in eclipse.