0

This is me just trying to get rid of warning messages.

My logback xml files start rather baldly with "<configuration>..." which gives a warning about no "XML or DTD constraints".

So an answer here in SO suggests putting these two lines at the top of the file:

<?XML version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration>

When I do that, however, I get a nasty white cross in a red circle with no error message from Eclipse.

nasty white cross in red circle

Can anyone identify the problem and hopefully the solution?

mike rodent
  • 14,126
  • 11
  • 103
  • 157
  • Thanks. This the whole point: there is NOTHING there, not an error, not a warning. – mike rodent May 31 '19 at 14:21
  • No text is shown when you hover over those icons, or in the **Problems** View? Also: `` is case sensitive. It must be lower case. – nitind Jun 01 '19 at 04:35
  • @nitind Tx. Case-sensitive - never knew that, and I presume you mean even in a Windows OS. Absolutely no text of any kind showing. NB Eclipse is version 4.10.0. Having said the above, I just launched again and there are no errors currently showing. – mike rodent Jun 01 '19 at 09:21
  • It's the file format, the O.S. doesn't affect it. – nitind Jun 01 '19 at 13:30

2 Answers2

0

Here's a link - might be helpful I think - take a look at the first two/three answers:

No grammar constraints (DTD or XML schema) detected for the document

First try changing <!DOCTYPE configuration> to <!DOCTYPE xml>

John M
  • 37
  • 1
  • 4
  • Thanks. Thought I'd found a workaround: File --> New --> Other --> XML --> XML file. This gives an xml file with the initial line... and no nasty white-cross-and-red-circle. It is then just a matter of copying the content of the "defective file" to the new one. NB encoding of "defective" file is UTF-8, exactly the same as the new file.. later: unfortunately, next time I launch Eclipse the same "no grammar constraints" warning comes back (though the white cross in red circle has gone). – mike rodent May 31 '19 at 17:00
0

Thought I had found an answer.

Having inserted these two lines at the top of my XML file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration>

... I then found I have to position the cursor e.g. after "xml" and backspace... and then re-type the characters <?xml ... After this the nasty symbol went away.

I'm no great expert on encoding but this may be something to do with those funny "initial bytes" of a file which indicate what encoding it's using (Big-Endian, Little-Endian).

However, I then find that next time I launch Eclipse the same "no grammar constraints" warning comes back (though the white cross in red circle has gone).

mike rodent
  • 14,126
  • 11
  • 103
  • 157