Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » No grammar constraints(DTD or XML schema) detected for the document
No grammar constraints(DTD or XML schema) detected for the document [message #226879] Tue, 20 January 2009 18:35 Go to next message
Rodrigo Pastrana is currently offline Rodrigo Pastrana
Messages: 8
Registered: July 2009
Junior Member
Does anybody know a proper way to avoid raising the warning "No grammar
constraints(DTD or XML schema) detected for the document" for xml files
which do not specify a DTD nor a schema?

I know the user can manually disable the warning, but I need to do this
programatically and would rather disable the warning on a per project
basis. Let me know, and thanks in advance. Rod.
Re: No grammar constraints(DTD or XML schema) detected for the document [message #226886 is a reply to message #226879] Tue, 20 January 2009 18:57 Go to previous messageGo to next message
Russell Bateman is currently offline Russell Bateman
Messages: 3190
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

Rodrigo Pastrana wrote:
> Does anybody know a proper way to avoid raising the warning "No grammar
> constraints(DTD or XML schema) detected for the document" for xml files
> which do not specify a DTD nor a schema?
>
> I know the user can manually disable the warning, but I need to do this
> programatically and would rather disable the warning on a per project
> basis. Let me know, and thanks in advance. Rod.


Try Preferences->Validation->XML Validator-> unclick manual and/or build?
Re: No grammar constraints(DTD or XML schema) detected for the document [message #226893 is a reply to message #226886] Tue, 20 January 2009 19:40 Go to previous messageGo to next message
Rodrigo Pastrana is currently offline Rodrigo Pastrana
Messages: 8
Registered: July 2009
Junior Member
Hi Russ, thanks for that info. However, I'm looking for a way to do this
programatically, not manually. Any ideas? thanks.

Windofkeltia wrote:
> Rodrigo Pastrana wrote:
>> Does anybody know a proper way to avoid raising the warning "No
>> grammar constraints(DTD or XML schema) detected for the document" for
>> xml files which do not specify a DTD nor a schema?
>>
>> I know the user can manually disable the warning, but I need to do
>> this programatically and would rather disable the warning on a per
>> project basis. Let me know, and thanks in advance. Rod.
>
>
> Try Preferences->Validation->XML Validator-> unclick manual and/or build?
Re: No grammar constraints(DTD or XML schema) detected for the document [message #226906 is a reply to message #226893] Wed, 21 January 2009 06:28 Go to previous message
kiril mitov is currently offline kiril mitov
Messages: 69
Registered: July 2009
Member
Hi Rodrigo,

Since it is a preference it can be changed programmatically.
Every plugin has a preference store.
You can get it with Activator.getPreferenceStore() where Activator is the
plugin class defined in the MANIFEST.MF for the bundle contributing the
preference.

After you have the preference store you must find the name of the
preference.
Preferences are contributed with an extension point. Just find the extension
contributing the XML Validator.

Triggering a build on a project can be done with IProject.build(int,
monitor).

In your case
the plugin defining the extension point is org.eclipse.wst.validation.
the plugin contributing a validator is org.eclipse.wst.xml.core
the plugin in which Window->Prefernece->Validation is defined is
org.eclipse.wst.validation.ui (found that with Alt+Shift+F1). Class is
ValidationPreferencePage.
you can also take a look at org.eclipse.wst.validation.internal.ValManager.
Please not that this class is in internal package and is not a public API.

Best Regards,
Kiril

"Rodrigo Pastrana" <rpastran@us.ibm.com> wrote in message
news:gl59ba$mjt$1@build.eclipse.org...
> Hi Russ, thanks for that info. However, I'm looking for a way to do this
> programatically, not manually. Any ideas? thanks.
>
> Windofkeltia wrote:
>> Rodrigo Pastrana wrote:
>>> Does anybody know a proper way to avoid raising the warning "No grammar
>>> constraints(DTD or XML schema) detected for the document" for xml files
>>> which do not specify a DTD nor a schema?
>>>
>>> I know the user can manually disable the warning, but I need to do this
>>> programatically and would rather disable the warning on a per project
>>> basis. Let me know, and thanks in advance. Rod.
>>
>>
>> Try Preferences->Validation->XML Validator-> unclick manual and/or build?
Previous Topic:Why can not tomcat be started from within eclipse ?
Next Topic:JavaScript Model Exception: Java Model Status
Goto Forum:
  


Current Time: Thu Sep 18 19:46:41 GMT 2014

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

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