Disable XML validation in Eclipse

后端 未结 5 1840
时光取名叫无心
时光取名叫无心 2020-11-30 17:51

My Eclipse validates XML files every time I save a file and it takes a while to validate them. The project is created using gwt-maven-plugin.

The XML files are not u

5条回答
  •  时光取名叫无心
    2020-11-30 18:53

    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:

    
    
    

    And the eclipse encoding is UTF-8:

    Eclipse Encoding Resource

    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

    EDIT: Sorry, didn't realise that the .xml files were generated and actually contain javascript.

    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.

    1. Suspend the validators
    2. Click on the 'Content is not allowed in prolog' message, right click and delete. You can select multiple ones, or all of them.
    3. 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.

提交回复
热议问题