views:

4665

answers:

4

I'm using Eclipse Ganymede. Everything works fine, but I have an anal-retentive yearning for a warning-free Problems tab. Right now it (correctly) complains about my ant scripts: "No grammar constraints (DTD or XML schema) detected for the document." Any way to turn that off for just those files? Ideally I'd like it to still warn me if my other schema-constrained files were missing the schema declarations.

+15  A: 

The simplest is to supply a minimal DTD to shut it up.

<!DOCTYPE project> for ant files
David Pierre
Indeed, so the start of your build.xml looks like: `<?xml version = '1.0' encoding = 'windows-1252'?> <!DOCTYPE project> <project name="myproject" default="make" basedir=".">` I had to close + reopen the tab for the warning to go away...
Sorry if this is a stupid question, but ANT dont have a DTD file that we can point to real validate the XML? Cheers!
Castanho
None that I know of.Besides Ant extensibility makes it impossible to get a complete one.
David Pierre
You mean I should include "for ant files" too?
drozzy
+1  A: 

U can delete it and restore it to avoid the warning. It is a bug obviously.

damoco
A: 

In fact, as damoco says, this seems to be a bug in Eclipse. If I delete (copy elsewhere) the file from windows, refresh eclipse, and then restore the file, and refresh again, the warning goes away.

I'm using Eclipse Galileo build 20090621-0832.

MatthieuF
+1  A: 

Even though this thread is a little older, somebody might find this interesting:

http://www.cs.hs-rm.de/~knauf/KomponentenArchitekturen2008/jsfunit/index.html

Go to Project Properties -> Validation and follow the screen shots on that page. Should be easy even if you don't speak German. ;-)

This solution worked perfectly for me. Cheers!

Martin