|My validatorV2 extension disables XML source validation [message #785407]
||Sat, 28 January 2012 19:19
| John Ruud
Registered: July 2009
I'd like to add XML editor source (as-you-type) validation for my own xml based content type ("xml2"). However, contributing the org.eclipse.wst.validation.validatorV2 extension as shown below seems to disable source validation for the original org.eclipse.core.runtime.xml content type (and it doesn't work for my xml2 type either). |
Normal batch validation still works for both xml and xml2. Source validation clearly stopped working because no red squiggly lines are drawn for invalid <tag></tag2> elements (for example) when editing xml or xml2 files using the WST XML editor. I'm using Eclipse JEE/Indigo SR1:
<?xml version="1.0" encoding="UTF-8"?>
If I remove the source validator entry (sourceid="org.eclipse.wst.xml.ui.internal.validation.DelegatingSourceValidatorForXML") from my plugin.xml then source validation starts working again for the normal xml content type (but obviously not for my own content type).
Has anybody been able to get source validation to work for their own XML based content type? DelegatingSourceValidatorForXML seems to stop working properly after it's been re-contributed. Source validation *mostly* works if I remove the validatorV2 extension and instead manually add my content type to: Preferences + Validation + XML validator + Settings, while there has been a couple of times when that stopped working as well (and I needed to remove and then add them back in).
|Re: My validatorV2 extension disables XML source validation [message #827040 is a reply to message #826945]
||Thu, 22 March 2012 16:28
| olivier pod
Registered: March 2012
at first, I didn't try to manually associate the validators as I didn't initially considered to override any existing implementation (I just want the exactly same behaviour as the XML, but for my own content-type which only differs from the XML content-type by the file extension).
(By the way, I'm not sure of what you mean when you ask "Do your validators work if you manually make the associations ?").
So, I just tried to "duplicate" as many contributions needed for the XML content-type, but for my own specific "XML-like" content-type to get the same functionalities (problem marker, sourcevalidation and ValidatorV2 as far as I remember).
For now, all functionnalities work for XML and only the "as-you-type" validation doesn't work for my content-type.
Now, I'm trying to figure out why it doesn't work by debugging the WST validator framework by comparing the call stacks/code calling tree between an editor on an XML file and another one on my own content-type.
I think I'm not far of a solution by declaring a sourcevalidation contribution and a ValidatorV2 pointing on a Validator class which default internal validator ID is pointing on the Validator markerId value. I'll detail a little bit more this particular point tomorrow from work.
Regards and sorry for the long post.
Powered by FUDForum
. Page generated in 0.05185 seconds