public ValidationReport validate(String uri, InputStream inputstream, NestedValidatorContext context, ValidationResult result)
{
XMLValidator validator = XMLValidator.getInstance();
XMLValidationConfiguration configuration = new XMLValidationConfiguration();
try
{
//Preferences pluginPreferences = XMLCorePlugin.getDefault().getPluginPreferences();
configuration.setFeature(XMLValidationConfiguration.INDICATE_NO_GRAMMAR, indicateNoGrammar);
final IPreferencesService preferencesService = Platform.getPreferencesService();
configuration.setFeature(XMLValidationConfiguration.INDICATE_NO_DOCUMENT_ELEMENT, preferencesService.getInt(XMLCorePlugin.getDefault().getBundle().getSymbolicName(), XMLCorePreferenceNames.INDICATE_NO_DOCUMENT_ELEMENT, -1, fPreferenceScopes));
configuration.setFeature(XMLValidationConfiguration.USE_XINCLUDE, preferencesService.getBoolean(XMLCorePlugin.getDefault().getBundle().getSymbolicName(), XMLCorePreferenceNames.USE_XINCLUDE, false, fPreferenceScopes));
configuration.setFeature(XMLValidationConfiguration.HONOUR_ALL_SCHEMA_LOCATIONS, preferencesService.getBoolean(XMLCorePlugin.getDefault().getBundle().getSymbolicName(), XMLCorePreferenceNames.HONOUR_ALL_SCHEMA_LOCATIONS, true, fPreferenceScopes));
}
catch(Exception e)
{
// TODO: Unable to set the preference. Log this problem.
}