Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » DTD warning in xml files
DTD warning in xml files [message #663046] Sat, 02 April 2011 18:26 Go to next message
No real name is currently offline No real nameFriend
Messages: 2
Registered: April 2011
Junior Member
I am working on an android project using the default android project setup. I am encoutering an annoying warning in all my xml files in eclipse. This warning comes in the form of a fuzzy yellow line accross all the text in the file(making it very hard to read). When I hover over this line I get the "no grammer constraints (dtd or xml) detected for document. If I right click the file and click validate it says no errors or warnings. Why eclipse chooses to tell me my xml file has no errors by putting a fuzzy yellow line through everything I have no idea.

I can run my android app on avd emulator with no problem so I assume this is just something superficial and eclipse telling me to worry about something which I don't need to at this point.

So firstly can I I remove this fuzzy underline from all my text in some kind of visual/validation preferences? I have tried changing all the "validation" settings in windows-preferences with zero effect.

Secondly, since the default android "sudoku" tutorial project didn't show these errors in xml files, I can think the only difference in my own project is the package namespace? I understand from my research though, that I was meant to choose a completley unique namespace(com.mydomainname.myprojectname)-which I have done. I can only think some kind of XML/dtd/validation reference was attached to the sudoku/tutorial project namespace that was lost when I started a new project and specified my own package namespace? Or maybe the package namespace is completley unrelated... however I did read something somewhere linking the 2 so I thought I would put it out there since it is also the only difference I can think of between my new project and the default/tutorial one.

I have <?xml version="1.0" encoding="utf-8"?> at the start of every xml file by default of course, I tried adding random xml dtds I found after this but they did not have any effect.

So I really need to know how do I either make eclipse validate my xml properly so whatever end it seems to need by configuring some xml dtd somewhere...... or simply get rid of the fuzzy yellow line in some kind of visual preference?

I have researched all these elements individually, but can't find anywhere that describes a solution to my problem specifically, all I have found are either vague references or different problems.

Any help is appreicated, even just a link to a page that describes a solution to my problem.
Re: DTD warning in xml files [message #663062 is a reply to message #663046] Sat, 02 April 2011 23:26 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
It sounds likely that you have WTP installed and are using WTP's XML
editor. You might avoid the issue and try opening the file with
Eclipse's plain old text editor. WTP does have preferences that allow
you to tailor how the validation is done (I think even to disable it)
including a mechanism whereby you can specify the location of a schema
for a particular namespace so that your instance documents will be
validated against that. I'm not sure of the details, but I'm sure a
hunt of the preferences will turn something up...


droidtech1@gmail.com wrote:
> I am working on an android project using the default android project
> setup. I am encoutering an annoying warning in all my xml files in
> eclipse. This warning comes in the form of a fuzzy yellow line
> accross all the text in the file(making it very hard to read). When I
> hover over this line I get the "no grammer constraints (dtd or xml)
> detected for document. If I right click the file and click validate it
> says no errors or warnings. Why eclipse chooses to tell me my xml file
> has no errors by putting a fuzzy yellow line through everything I have
> no idea.
>
> I can run my android app on avd emulator with no problem so I assume
> this is just something superficial and eclipse telling me to worry
> about something which I don't need to at this point.
> So firstly can I I remove this fuzzy underline from all my text in
> some kind of visual/validation preferences? I have tried changing all
> the "validation" settings in windows-preferences with zero effect.
>
> Secondly, since the default android "sudoku" tutorial project didn't
> show these errors in xml files, I can think the only difference in my
> own project is the package namespace? I understand from my research
> though, that I was meant to choose a completley unique
> namespace(com.mydomainname.myprojectname)-which I have done. I can
> only think some kind of XML/dtd/validation reference was attached to
> the sudoku/tutorial project namespace that was lost when I started a
> new project and specified my own package namespace? Or maybe the
> package namespace is completley unrelated... however I did read
> something somewhere linking the 2 so I thought I would put it out
> there since it is also the only difference I can think of between my
> new project and the default/tutorial one.
>
> I have <?xml version="1.0" encoding="utf-8"?> at the start of every
> xml file by default of course, I tried adding random xml dtds I found
> after this but they did not have any effect.
>
> So I really need to know how do I either make eclipse validate my xml
> properly so whatever end it seems to need by configuring some xml dtd
> somewhere...... or simply get rid of the fuzzy yellow line in some
> kind of visual preference?
>
> I have researched all these elements individually, but can't find
> anywhere that describes a solution to my problem specifically, all I
> have found are either vague references or different problems.
>
> Any help is appreicated, even just a link to a page that describes a
> solution to my problem.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: DTD warning in xml files [message #663077 is a reply to message #663062] Sun, 03 April 2011 10:15 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 2
Registered: April 2011
Junior Member
Thanks for the response. I did actually find the visual preference, I only didn't realise it because I only restarted the eclipse client after I wrote this post and the visual settings didn't change until I restarted, will remember that is a necessary step next time.

Still curious about the dtd and namespace connection? If there is one.
Re: DTD warning in xml files [message #663103 is a reply to message #663077] Sun, 03 April 2011 16:38 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Maybe there are project specific settings for namespace to schema/dtd
mappings that were lost?


droidtech1@gmail.com wrote:
> Thanks for the response. I did actually find the visual preference, I
> only didn't realise it because I only restarted the eclipse client
> after I wrote this post and the visual settings didn't change until I
> restarted, will remember that is a necessary step next time.
>
> Still curious about the dtd and namespace connection? If there is one.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: DTD warning in xml files [message #663533 is a reply to message #663046] Tue, 05 April 2011 14:05 Go to previous message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 3070
Registered: July 2009
Senior Member
On 4/2/11 2:26 PM, droidtech1@gmail.com wrote:
> I am working on an android project using the default android project
> setup. I am encoutering an annoying warning in all my xml files in
> eclipse. This warning comes in the form of a fuzzy yellow line accross
> all the text in the file(making it very hard to read). When I hover over
> this line I get the "no grammer constraints (dtd or xml) detected for
> document. If I right click the file and click validate it says no errors
> or warnings. Why eclipse chooses to tell me my xml file has no errors by
> putting a fuzzy yellow line through everything I have no idea.

It's just a warning, not an error. It's alerting you to the fact that
the XML does not specify a DTD or Schema, so it can't validate the
grammar (it can only validate that the document is valid XML, not that
it complies with a schema or DTD).

Go to Preferences > XML > XML Files > Validation and you'll find an
option named "Indicate when no grammar is specified" which you can set
to "Ignore" if you don't want to see those warnings.

Eric
Previous Topic:Komodo Edit convert, finding features in Eclipse
Next Topic:[SOLVED] Eclipse prints only in A4 page size
Goto Forum:
  


Current Time: Thu Apr 25 13:18:43 GMT 2024

Powered by FUDForum. Page generated in 0.08405 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top