Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » validation of a file with a new extension "myxml"(sourcevalidation extension point)
validation of a file with a new extension "myxml" [message #646474] Fri, 24 December 2010 17:15 Go to next message
Alain is currently offline Alain
Messages: 20
Registered: March 2010
Junior Member
Hello,
I created an editor based on StructuredTextEditor
I tried to add the extension org.eclipse.core.contenttype.contentTypes
and next I configured a second one org.eclipse.wst.sse.ui.sourcevalidation in order to have an ,as you type, validation
I also implemented the IValidator interface.
here is the declaration of my plugin extension points :
<extension
       point="org.eclipse.core.contenttype.contentTypes">
        <content-type base-type="org.eclipse.core.runtime.xml"
                 file-extensions="myxml"
                 id="project.presentation.myxml"
                 name="myXml editor"
                 priority="normal">
   </content-type>
       
 </extension>

 <extension point="org.eclipse.wst.sse.ui.sourcevalidation">
		<validator
			scope="total"
			class="project.presentation.validation.FooValidator"
			id="project.presentation.validation.FooValidator">
			<contentTypeIdentifier id="project.presentation.myxml">
				<partitionType id="org.eclipse.wst.xml.XML_DEFAULT">
				</partitionType>
			</contentTypeIdentifier>
		</validator>
	</extension>


I juste don't knwo why the validation dosn't work at all!
may be it's because my editor file extension is myxml?
any ideas?
thank you
Re: validation of a file with a new extension "myxml" [message #648427 is a reply to message #646474] Wed, 12 January 2011 21:22 Go to previous messageGo to next message
Nick Sandonato is currently offline Nick Sandonato
Messages: 126
Registered: July 2009
Senior Member
Hi Alain,

What you have here is enough to make sure the source validator gets run. Without knowing other details, though, I cannot be certain what is causing validation to not work for you.

If you can supply any more information, hopefully we can pinpoint your problem.
Re: validation of a file with a new extension "myxml" [message #648872 is a reply to message #646474] Fri, 14 January 2011 19:08 Go to previous message
Nitin Dahyabhai is currently offline Nitin Dahyabhai
Messages: 2310
Registered: July 2009
Senior Member
On 12/24/2010 12:15 PM, Alain wrote:
> I juste don't knwo why the validation dosn't work at all!
> may be it's because my editor file extension is myxml?
> any ideas?
> thank you

Source Validation isn't an inherited behavior in quite the same way that
the viewer configuration is: if you define any source validator
specifically for your content type, no source validators are inherited
from its base types. In your case it means that the normal XML source
validation will not be used on your content type unless you recontribute
it as your own extension to your content type specifically. This
strategy was chosen to help deal with XSL files, where an XSL-specific
validator could work properly but a normal XML validation would report a
number of problems.

--
Nitin Dahyabhai
Eclipse WTP Source Editing and JSDT
IBM Rational


---
Nitin Dahyabhai
Eclipse WTP, IBM
Previous Topic:Fix for a XML formatting bug
Next Topic:How to let JSDT know the variable type?
Goto Forum:
  


Current Time: Sat Oct 25 08:53:53 GMT 2014

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

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