Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Validation Framework not returning errors
Validation Framework not returning errors [message #218456] Tue, 29 July 2008 18:24
Philippe Sabourin is currently offline Philippe SabourinFriend
Messages: 28
Registered: July 2009
Junior Member
Hello,

I'm trying to determine whether the file open in my editor has errors in
it. It's an XML file with a DTD defined, and when I erase part of a tag
(or the whole tag, if its required), the little red box shows up on the
right, and sometimes a marker shows up on the left. However, this method
always returns false. I call it in between switching from a source page to
a form page, which I only want viewable if there are no errors in the
source.

private boolean hasErrors(){
Validator[] validators =
ValidationFramework.getDefault().getValidatorsFor(currentFil e);
for(Validator validator : validators){
ValidationResult result = validator.validate(currentFile,
IResourceDelta.CONTENT, null, null);
if(result.getSeverityError() > 0)
return true;
}
return false;
}

Any ideas?

PS: Reference from before:
http://dev.eclipse.org/newslists/news.eclipse.webtools/msg16 654.html
Previous Topic:org.w3c.dom.DOMException when using jre 1.6
Next Topic:(low priority) Misleading comment in wst.sse internals.
Goto Forum:
  


Current Time: Wed Apr 24 16:25:53 GMT 2024

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

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

Back to the top