Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Associate Custom Content Type with XML Validator.
Associate Custom Content Type with XML Validator. [message #898993] Mon, 30 July 2012 04:47 Go to next message
rohit chawla is currently offline rohit chawla
Messages: 19
Registered: June 2012
Junior Member
Just want to know what should come in place of question marks ?? in the following plugin.xml, in order to validate my custom content-type xml2 (xml types) with normal xml validator???
Write now, I am able to open xml2 in XML editor, but not able to validate.


<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>

    <extension point="org.eclipse.wst.sse.ui.sourcevalidation">
		<validator
			scope="total"
			class="???"
			id="???">
			<contentTypeIdentifier id="com.xyz.ide.core.contentType.dummy">
				<partitionType id="org.eclipse.wst.xml.XML_DEFAULT">
				</partitionType>
			</contentTypeIdentifier>
		</validator>
	</extension>
   
	
	 <extension
         point="org.eclipse.core.runtime.contentTypes">
         <content-type
            id="com.xyz.ide.core.contentType.dummy"
            base-type="org.eclipse.core.runtime.xml"
            file-extensions="xml2"
            name="xml2"
            priority="normal"
            default-charset="UTF-8"/>
   </extension>
</plugin>


Thanks

[Updated on: Mon, 30 July 2012 04:50]

Report message to a moderator

Re: Associate Custom Content Type with XML Validator. [message #898994 is a reply to message #898993] Mon, 30 July 2012 05:44 Go to previous messageGo to next message
rohit chawla is currently offline rohit chawla
Messages: 19
Registered: June 2012
Junior Member
If anyone knows a different way of doing it, please share..thanks
Re: Associate Custom Content Type with XML Validator. [message #899143 is a reply to message #898994] Mon, 30 July 2012 16:30 Go to previous messageGo to next message
rohit chawla is currently offline rohit chawla
Messages: 19
Registered: June 2012
Junior Member
Also, if I manually go and add content type through Window->Preferences->Content Type....
That way the validation is still performed.
I am missing some small thing Sad
Re: Associate Custom Content Type with XML Validator. [message #899153 is a reply to message #898993] Mon, 30 July 2012 16:58 Go to previous messageGo to next message
Nick Sandonato is currently offline Nick Sandonato
Messages: 126
Registered: July 2009
Senior Member
The source (as-you-type) validator class that you're looking for is org.eclipse.wst.xml.ui.internal.validation.DelegatingSourceValidatorForXML. Your id can be whatever you'd like it to be.
Re: Associate Custom Content Type with XML Validator. [message #899166 is a reply to message #899153] Mon, 30 July 2012 18:13 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin Dahyabhai
Messages: 2283
Registered: July 2009
Senior Member
Just so long as you don't use an ID that exists elsewhere.

---
Nitin Dahyabhai
Eclipse WTP, IBM
Re: Associate Custom Content Type with XML Validator. [message #899193 is a reply to message #899166] Tue, 31 July 2012 01:16 Go to previous messageGo to next message
rohit chawla is currently offline rohit chawla
Messages: 19
Registered: June 2012
Junior Member
No Message Body
Re: Associate Custom Content Type with XML Validator. [message #899194 is a reply to message #899193] Tue, 31 July 2012 01:19 Go to previous messageGo to next message
rohit chawla is currently offline rohit chawla
Messages: 19
Registered: June 2012
Junior Member
Still no luck guys, I changed to what you specified. Still there is no xml validation??

<plugin>

   <extension point="org.eclipse.wst.sse.ui.sourcevalidation">
		<validator
			scope="total"
			 class="org.eclipse.wst.xml.ui.internal.validation.DelegatingSourceValidatorForXML"
			id="org.eclipse.wst.xml.ui.internal.validation.DelegatingSourceValidatorForXML">
			<contentTypeIdentifier id="com.xyz.ide.core.contentType.dummy">
				<partitionType id="org.eclipse.wst.xml.XML_DEFAULT">
				</partitionType>
				<partitionType id="org.eclipse.wst.xml.XML_COMMENT"/>
				<partitionType id="org.eclipse.wst.sse.ST_DEFAULT"/>
			</contentTypeIdentifier>
		</validator>
	</extension>
   
   <extension
         point="org.eclipse.core.runtime.contentTypes">
         <content-type
            id="com.xyz.ide.core.contentType.dummy"
            base-type="org.eclipse.core.runtime.xml"
            file-extensions="xml2"
            name="xml2"
            priority="normal"
            default-charset="UTF-8"/>
   </extension>

</plugin>
Re: Associate Custom Content Type with XML Validator. [message #905848 is a reply to message #898993] Fri, 31 August 2012 07:29 Go to previous message
Leonid Ripeynih is currently offline Leonid Ripeynih
Messages: 100
Registered: February 2012
Senior Member
Have you found a solution?
Previous Topic:How to make Content assist working when editors are inside Composite?
Next Topic:Forcing StructuredTextEditor to recognize XML
Goto Forum:
  


Current Time: Wed Oct 01 14:21:12 GMT 2014

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

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