| My validatorV2 extension disables XML source validation [message #785407] |
Sat, 28 January 2012 19:19  |
John Ruud Messages: 6 Registered: July 2009 |
Junior Member |
|
|
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"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.core.contenttype.contentTypes">
<content-type
base-type="org.eclipse.core.runtime.xml"
file-extensions="xml2"
id="validator-test.xml2"
name="XML2"
priority="normal">
</content-type>
</extension>
<extension
id="id1"
name="name"
point="org.eclipse.wst.validation.validatorV2">
<validator
build="true"
class="org.eclipse.wst.xml.core.internal.validation.eclipse.Validator"
manual="true"
markerId="org.eclipse.wst.xml.core.validationMarker"
sourceid="org.eclipse.wst.xml.ui.internal.validation.DelegatingSourceValidatorForXML"
version="3">
<include>
<rules>
<contentType
exactMatch="true"
id="validator-test.xml2">
</contentType>
</rules>
</include>
</validator>
</extension>
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).
John
|
|
|