No grammar constraints(DTD or XML schema) detected for the document [message #226879] |
Tue, 20 January 2009 13:35  |
Eclipse User |
|
|
|
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 #226906 is a reply to message #226893] |
Wed, 21 January 2009 01:28  |
Eclipse User |
|
|
|
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?
|
|
|
Powered by
FUDForum. Page generated in 0.03176 seconds