| <?xml version='1.0' encoding='UTF-8'?> |
| <!-- |
| Copyright (c) 2016, 2018 IBM Corporation and others. |
| This program and the accompanying materials |
| are made available under the terms of the Eclipse Public License 2.0 |
| which accompanies this distribution, and is available at |
| https://www.eclipse.org/legal/epl-2.0/ |
| |
| SPDX-License-Identifier: EPL-2.0 |
| |
| Contributors: |
| IBM Corporation - initial API and implementation |
| --> |
| |
| <!-- Schema file written by PDE --> |
| <schema targetNamespace="org.eclipse.wst.html.core" xmlns="http://www.w3.org/2001/XMLSchema"> |
| <annotation> |
| <appInfo> |
| <meta.schema plugin="org.eclipse.wst.html.core" id="syntaxValidator" name="Validator"/> |
| </appInfo> |
| <documentation> |
| Extension point which allows to add external validators for HTML5-like tags. |
| </documentation> |
| </annotation> |
| |
| <element name="extension"> |
| <annotation> |
| <appInfo> |
| <meta.element /> |
| </appInfo> |
| </annotation> |
| <complexType> |
| <sequence minOccurs="1" maxOccurs="unbounded"> |
| <element ref="validator" minOccurs="1" maxOccurs="unbounded"/> |
| </sequence> |
| <attribute name="point" type="string" use="required"> |
| <annotation> |
| <documentation> |
| |
| </documentation> |
| </annotation> |
| </attribute> |
| <attribute name="id" type="string"> |
| <annotation> |
| <documentation> |
| |
| </documentation> |
| </annotation> |
| </attribute> |
| <attribute name="name" type="string"> |
| <annotation> |
| <documentation> |
| |
| </documentation> |
| <appInfo> |
| <meta.attribute translatable="true"/> |
| </appInfo> |
| </annotation> |
| </attribute> |
| </complexType> |
| </element> |
| |
| <element name="validator"> |
| <complexType> |
| <attribute name="class" type="string" use="required"> |
| <annotation> |
| <documentation> |
| |
| </documentation> |
| <appInfo> |
| <meta.attribute kind="java" basedOn="org.eclipse.wst.html.core.internal.validate.extension.IHTMLCustomTagValidator:"/> |
| </appInfo> |
| </annotation> |
| </attribute> |
| </complexType> |
| </element> |
| |
| <annotation> |
| <appInfo> |
| <meta.section type="since"/> |
| </appInfo> |
| <documentation> |
| [Enter the first release in which this extension point appears.] |
| </documentation> |
| </annotation> |
| |
| <annotation> |
| <appInfo> |
| <meta.section type="examples"/> |
| </appInfo> |
| <documentation> |
| Extension point for validating custom html tags. Only one error message will be displayed for each validated tag. |
| <pre> |
| <extension point="org.eclipse.wst.html.core.syntaxValidator"> |
| <validator class="org.package.YourValidator"></validator> |
| </extension> |
| </pre> |
| |
| YourValidator should implement IHTMLCustomTagValidator |
| |
| <pre> |
| public class YourValidator impements IHTMLCustomTagValidator{ |
| |
| public boolean canValidate(IDOMElement target) { |
| if (target.getLocalName().startsWith("tag")) { |
| return true; |
| } |
| return false; |
| } |
| |
| public void init() { |
| //called only once while validator was loaded |
| } |
| |
| public ValidationMessage validateTag(IDOMElement target) { |
| String tagName = target.getLocalName(); |
| if (tagName.contains("error")) { |
| Segment segment = CustomValidatorUtil.getTagSegment(target, SEG_START_TAG_NAME); |
| return new ValidationMessage("This is error tag", segment.getOffset(), segment.getLength(), ValidationMessage.ERROR); |
| } |
| return null; |
| } |
| } |
| </pre> |
| </documentation> |
| </annotation> |
| |
| <annotation> |
| <appInfo> |
| <meta.section type="apiinfo"/> |
| </appInfo> |
| <documentation> |
| [Enter API information here.] |
| </documentation> |
| </annotation> |
| |
| <annotation> |
| <appInfo> |
| <meta.section type="implementation"/> |
| </appInfo> |
| <documentation> |
| [Enter information about supplied implementation of this extension point.] |
| </documentation> |
| </annotation> |
| |
| |
| </schema> |