From 12f97c0cc981656c1a501ff600defb97bd2018c0 Mon Sep 17 00:00:00 2001 From: Angelo Date: Wed, 29 May 2019 20:13:57 +0200 Subject: [PATCH] Validate XML Schema with Xerces XSD validator. See #190 (#390) Signed-off-by: azerr --- .../ContentModelDiagnosticsParticipant.java | 8 +- .../xsd/participants/XSDErrorCode.java | 19 ++- .../diagnostics/LSPErrorReporterForXSD.java | 8 ++ .../XSDDiagnosticsParticipant.java | 3 +- .../diagnostics/XSDValidator.java | 91 ++++++++----- .../lsp4xml/utils/XMLPositionUtility.java | 4 + .../XMLSchemaDiagnosticsTest.java | 15 --- .../xsd/XSDValidationExtensionsTest.java | 121 ++++++++++++++++-- .../schema/s4s_att_invalid_value.xsd | 5 + .../validation/schema/s4s_att_must_appear.xsd | 5 + .../validation/schema/s4s_att_not_allowed.xsd | 5 + .../validation/schema/s4s_elt_character.xsd | 5 + .../schema/s4s_elt_invalid_content_1.xsd | 5 + .../validation/schema/src-resolve.xsd | 12 ++ .../validation/schema/src-resolve2.xsd | 16 +++ 15 files changed, 254 insertions(+), 68 deletions(-) create mode 100644 org.eclipse.lsp4xml/src/test/resources/validation/schema/s4s_att_invalid_value.xsd create mode 100644 org.eclipse.lsp4xml/src/test/resources/validation/schema/s4s_att_must_appear.xsd create mode 100644 org.eclipse.lsp4xml/src/test/resources/validation/schema/s4s_att_not_allowed.xsd create mode 100644 org.eclipse.lsp4xml/src/test/resources/validation/schema/s4s_elt_character.xsd create mode 100644 org.eclipse.lsp4xml/src/test/resources/validation/schema/s4s_elt_invalid_content_1.xsd create mode 100644 org.eclipse.lsp4xml/src/test/resources/validation/schema/src-resolve.xsd create mode 100644 org.eclipse.lsp4xml/src/test/resources/validation/schema/src-resolve2.xsd diff --git a/org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/extensions/contentmodel/participants/diagnostics/ContentModelDiagnosticsParticipant.java b/org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/extensions/contentmodel/participants/diagnostics/ContentModelDiagnosticsParticipant.java index 3d2963e91..8cdd01582 100644 --- a/org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/extensions/contentmodel/participants/diagnostics/ContentModelDiagnosticsParticipant.java +++ b/org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/extensions/contentmodel/participants/diagnostics/ContentModelDiagnosticsParticipant.java @@ -18,9 +18,11 @@ import org.eclipse.lsp4xml.dom.DOMDocument; import org.eclipse.lsp4xml.extensions.contentmodel.ContentModelPlugin; import org.eclipse.lsp4xml.services.extensions.diagnostics.IDiagnosticsParticipant; +import org.eclipse.lsp4xml.utils.DOMUtils; /** - * Validate XML files with Xerces for general SYNTAX validation and XML Schema, DTD. + * Validate XML files with Xerces for general SYNTAX validation and XML Schema, + * DTD. * */ public class ContentModelDiagnosticsParticipant implements IDiagnosticsParticipant { @@ -33,8 +35,8 @@ public ContentModelDiagnosticsParticipant(ContentModelPlugin contentModelPlugin) @Override public void doDiagnostics(DOMDocument xmlDocument, List diagnostics, CancelChecker monitor) { - if (xmlDocument.isDTD()) { - // Don't validate DTD with XML validator + if (xmlDocument.isDTD() || DOMUtils.isXSD(xmlDocument)) { + // Don't validate DTD / XML Schema with XML validator return; } // Get entity resolver (XML catalog resolver, XML schema from the file diff --git a/org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/extensions/xsd/participants/XSDErrorCode.java b/org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/extensions/xsd/participants/XSDErrorCode.java index 40f654609..e33fa4335 100644 --- a/org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/extensions/xsd/participants/XSDErrorCode.java +++ b/org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/extensions/xsd/participants/XSDErrorCode.java @@ -35,7 +35,7 @@ public enum XSDErrorCode implements IXMLErrorCode { s4s_att_invalid_value("s4s-att-invalid-value"), // s4s_elt_character("s4s-elt-character"), // src_resolve_4_2("src-resolve.4.2"), // - src_resolve("src-resolve"); + src_resolve("src-resolve"), src_element_2_1("src-element.2.1"); private final String code; @@ -85,20 +85,27 @@ public static Range toLSPRange(XMLLocator location, XSDErrorCode code, Object[] case s4s_elt_must_match_1: case s4s_att_must_appear: case s4s_elt_invalid_content_2: + case src_element_2_1: return XMLPositionUtility.selectStartTag(offset, document); - case s4s_att_not_allowed: - return XMLPositionUtility.selectAttributeNameAt(offset, document); + case s4s_att_not_allowed: { + String attrName = (String) arguments[1]; + return XMLPositionUtility.selectAttributeNameFromGivenNameAt(attrName, offset, document); + } case s4s_att_invalid_value: { - String attrName = ""; + String attrName = (String) arguments[1]; return XMLPositionUtility.selectAttributeValueAt(attrName, offset, document); } case s4s_elt_character: return XMLPositionUtility.selectContent(offset, document); - case src_resolve_4_2: - case src_resolve: + case src_resolve_4_2: { String attrValue = (String) arguments[2]; return XMLPositionUtility.selectAttributeValueByGivenValueAt(attrValue, offset, document); } + case src_resolve: { + String attrValue = (String) arguments[0]; + return XMLPositionUtility.selectAttributeValueByGivenValueAt(attrValue, offset, document); + } + } return null; } } diff --git a/org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/extensions/xsd/participants/diagnostics/LSPErrorReporterForXSD.java b/org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/extensions/xsd/participants/diagnostics/LSPErrorReporterForXSD.java index 70664d9c4..72aa28dac 100644 --- a/org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/extensions/xsd/participants/diagnostics/LSPErrorReporterForXSD.java +++ b/org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/extensions/xsd/participants/diagnostics/LSPErrorReporterForXSD.java @@ -16,6 +16,7 @@ import org.eclipse.lsp4j.Diagnostic; import org.eclipse.lsp4j.Range; import org.eclipse.lsp4xml.dom.DOMDocument; +import org.eclipse.lsp4xml.extensions.contentmodel.participants.XMLSyntaxErrorCode; import org.eclipse.lsp4xml.extensions.xsd.participants.XSDErrorCode; import org.eclipse.lsp4xml.services.extensions.diagnostics.AbstractLSPErrorReporter; import org.xml.sax.ErrorHandler; @@ -54,6 +55,13 @@ protected Range toLSPRange(XMLLocator location, String key, Object[] arguments, return range; } } + XMLSyntaxErrorCode syntaxCode = XMLSyntaxErrorCode.get(key); + if (syntaxCode != null) { + Range range = XMLSyntaxErrorCode.toLSPRange(location, syntaxCode, arguments, document); + if (range != null) { + return range; + } + } return null; } } diff --git a/org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/extensions/xsd/participants/diagnostics/XSDDiagnosticsParticipant.java b/org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/extensions/xsd/participants/diagnostics/XSDDiagnosticsParticipant.java index 8783bc6e3..bf9b5ec5e 100644 --- a/org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/extensions/xsd/participants/diagnostics/XSDDiagnosticsParticipant.java +++ b/org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/extensions/xsd/participants/diagnostics/XSDDiagnosticsParticipant.java @@ -35,8 +35,7 @@ public void doDiagnostics(DOMDocument xmlDocument, List diagnostics, // associations settings., ...) XMLEntityResolver entityResolver = xmlDocument.getResolverExtensionManager(); // Process validation - // XSDValidator.doDiagnostics(xmlDocument, entityResolver, diagnostics, - // monitor); + XSDValidator.doDiagnostics(xmlDocument, entityResolver, diagnostics, monitor); } } diff --git a/org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/extensions/xsd/participants/diagnostics/XSDValidator.java b/org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/extensions/xsd/participants/diagnostics/XSDValidator.java index 0ebac0911..a050b5277 100644 --- a/org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/extensions/xsd/participants/diagnostics/XSDValidator.java +++ b/org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/extensions/xsd/participants/diagnostics/XSDValidator.java @@ -11,12 +11,20 @@ package org.eclipse.lsp4xml.extensions.xsd.participants.diagnostics; import java.io.ByteArrayInputStream; +import java.io.IOException; import java.io.InputStream; +import java.lang.reflect.Field; import java.nio.charset.StandardCharsets; import java.util.List; +import java.util.concurrent.CancellationException; +import java.util.logging.Level; import java.util.logging.Logger; import org.apache.xerces.impl.Constants; +import org.apache.xerces.impl.XMLErrorReporter; +import org.apache.xerces.impl.xs.XMLSchemaLoader; +import org.apache.xerces.impl.xs.opti.SchemaDOMParser; +import org.apache.xerces.impl.xs.traversers.XSDHandler; import org.apache.xerces.parsers.XMLGrammarPreparser; import org.apache.xerces.util.XMLGrammarPoolImpl; import org.apache.xerces.xni.grammars.XMLGrammarDescription; @@ -34,12 +42,18 @@ public class XSDValidator { private static final Logger LOGGER = Logger.getLogger(XSDValidator.class.getName()); + private static boolean canCustomizeReporter = true; + public static void doDiagnostics(DOMDocument document, XMLEntityResolver entityResolver, List diagnostics, CancelChecker monitor) { try { + XMLErrorReporter reporter = new LSPErrorReporterForXSD(document, diagnostics); + XMLGrammarPreparser grammarPreparser = new LSPXMLGrammarPreparser(); - grammarPreparser.registerPreparser(XMLGrammarDescription.XML_SCHEMA, null/* schemaLoader */); + XMLSchemaLoader schemaLoader = createSchemaLoader(reporter); + + grammarPreparser.registerPreparser(XMLGrammarDescription.XML_SCHEMA, schemaLoader); grammarPreparser.setProperty(Constants.XERCES_PROPERTY_PREFIX + Constants.XMLGRAMMAR_POOL_PROPERTY, new XMLGrammarPoolImpl()); @@ -57,50 +71,63 @@ public static void doDiagnostics(DOMDocument document, XMLEntityResolver entityR grammarPreparser.setFeature(Constants.XERCES_FEATURE_PREFIX + Constants.WARN_ON_DUPLICATE_ATTDEF_FEATURE, true); - /* - * if(configuration.getFeature(XSDValidationConfiguration. - * HONOUR_ALL_SCHEMA_LOCATIONS)) { try { - * grammarPreparser.setFeature(Constants.XERCES_FEATURE_PREFIX + - * "honour-all-schemaLocations", true); //$NON-NLS-1$ } catch (Exception e) { // - * catch the exception and ignore } } - * - * if(configuration.getFeature(XSDValidationConfiguration. - * FULL_SCHEMA_CONFORMANCE)) { try { - * grammarPreparser.setFeature(Constants.XERCES_FEATURE_PREFIX + - * Constants.SCHEMA_FULL_CHECKING, true); } catch (Exception e) { // ignore - * since we don't want to set it or can't. } - * - * } - */ - // Add LSP content handler to stop XML parsing if monitor is canceled. // grammarPreparser.setContentHandler(new LSPContentHandler(monitor)); // Add LSP error reporter to fill LSP diagnostics from Xerces errors - grammarPreparser.setProperty("http://apache.org/xml/properties/internal/error-reporter", - new LSPErrorReporterForXSD(document, diagnostics)); + grammarPreparser.setProperty("http://apache.org/xml/properties/internal/error-reporter", reporter); if (entityResolver != null) { grammarPreparser.setEntityResolver(entityResolver); } + String content = document.getText(); + String uri = document.getDocumentURI(); + InputStream inputStream = new ByteArrayInputStream(content.getBytes(StandardCharsets.UTF_8)); + XMLInputSource is = new XMLInputSource(null, uri, uri, inputStream, null); + grammarPreparser.getLoader(XMLGrammarDescription.XML_SCHEMA); + grammarPreparser.preparseGrammar(XMLGrammarDescription.XML_SCHEMA, is); + } catch (IOException | CancellationException exception) { + // ignore error + } catch (Exception e) { + LOGGER.log(Level.SEVERE, "Unexpected XMLValidator error", e); + } + } + + /** + * Create the XML Schema loader to use to validate the XML Schema. + * + * @param reporter the lsp reporter. + * @return the XML Schema loader to use to validate the XML Schema. + * @throws NoSuchFieldException + * @throws IllegalAccessException + */ + private static XMLSchemaLoader createSchemaLoader(XMLErrorReporter reporter) { + XMLSchemaLoader schemaLoader = new XMLSchemaLoader(); + + // To validate XML syntax for XML Schema, we need to use the Xerces Reporter + // (XMLErrorReporter) + // (and not the Xerces XML ErrorHandler because we need the arguments array to + // retrieve the attribut e name, element name, etc) + + // Xerces XSD validator can work with Xerces reporter for XSD error but not for + // XML syntax (only XMLErrorHandler is allowed). + // To fix this problem, we set the Xerces reporter with Java Reflection. + if (canCustomizeReporter) { try { - String content = document.getText(); - String uri = document.getDocumentURI(); - InputStream inputStream = new ByteArrayInputStream(content.getBytes(StandardCharsets.UTF_8)); - XMLInputSource is = new XMLInputSource(null, uri, uri, inputStream, null); - grammarPreparser.getLoader(XMLGrammarDescription.XML_SCHEMA); - grammarPreparser.preparseGrammar(XMLGrammarDescription.XML_SCHEMA, is); + Field f = XMLSchemaLoader.class.getDeclaredField("fSchemaHandler"); + f.setAccessible(true); + XSDHandler handler = (XSDHandler) f.get(schemaLoader); + + Field g = XSDHandler.class.getDeclaredField("fSchemaParser"); + g.setAccessible(true); + SchemaDOMParser domParser = (SchemaDOMParser) g.get(handler); + domParser.setProperty("http://apache.org/xml/properties/internal/error-reporter", reporter); } catch (Exception e) { - // parser will return null pointer exception if the document is structurally - // invalid - // TODO: log error message - // System.out.println(e); + canCustomizeReporter = false; } - } catch (Exception e) { - // TODO: log error. - // System.out.println(e); } + return schemaLoader; } } diff --git a/org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/utils/XMLPositionUtility.java b/org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/utils/XMLPositionUtility.java index b33407d86..c2d5580e3 100644 --- a/org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/utils/XMLPositionUtility.java +++ b/org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/utils/XMLPositionUtility.java @@ -24,6 +24,7 @@ import org.eclipse.lsp4xml.dom.DOMElement; import org.eclipse.lsp4xml.dom.DOMNode; import org.eclipse.lsp4xml.dom.DOMProcessingInstruction; +import org.eclipse.lsp4xml.dom.DOMText; import org.eclipse.lsp4xml.dom.DTDAttlistDecl; import org.eclipse.lsp4xml.dom.DTDDeclNode; import org.eclipse.lsp4xml.dom.DTDDeclParameter; @@ -385,6 +386,9 @@ public static Range selectContent(int offset, DOMDocument document) { } // node has NO content (ex: , select the start tag return selectStartTag(node); + } else if (node.isText()) { + DOMText text = (DOMText) node; + return createRange(text.getStartContent(), text.getEndContent(), document); } } return null; diff --git a/org.eclipse.lsp4xml/src/test/java/org/eclipse/lsp4xml/extensions/contentmodel/XMLSchemaDiagnosticsTest.java b/org.eclipse.lsp4xml/src/test/java/org/eclipse/lsp4xml/extensions/contentmodel/XMLSchemaDiagnosticsTest.java index 2355e074e..614c3a7c0 100644 --- a/org.eclipse.lsp4xml/src/test/java/org/eclipse/lsp4xml/extensions/contentmodel/XMLSchemaDiagnosticsTest.java +++ b/org.eclipse.lsp4xml/src/test/java/org/eclipse/lsp4xml/extensions/contentmodel/XMLSchemaDiagnosticsTest.java @@ -356,21 +356,6 @@ public void issue217() { testDiagnosticsFor(xml, d); } - @Test - public void cvc_elt_3_1() throws Exception { - String xml = "\r\n" + // - "\r\n" + // - " \r\n" + // - ""; - XMLAssert.testDiagnosticsFor(xml, d(7, 3, 7, 17, XMLSchemaErrorCode.cvc_elt_3_1)); - - } - @Test public void cvc_type_3_2_1() throws Exception { String xml = "\r\n" + // diff --git a/org.eclipse.lsp4xml/src/test/java/org/eclipse/lsp4xml/extensions/xsd/XSDValidationExtensionsTest.java b/org.eclipse.lsp4xml/src/test/java/org/eclipse/lsp4xml/extensions/xsd/XSDValidationExtensionsTest.java index 2906ac224..0a8c4c0bf 100644 --- a/org.eclipse.lsp4xml/src/test/java/org/eclipse/lsp4xml/extensions/xsd/XSDValidationExtensionsTest.java +++ b/org.eclipse.lsp4xml/src/test/java/org/eclipse/lsp4xml/extensions/xsd/XSDValidationExtensionsTest.java @@ -15,26 +15,127 @@ import org.eclipse.lsp4j.Diagnostic; import org.eclipse.lsp4xml.XMLAssert; import org.eclipse.lsp4xml.commons.BadLocationException; -import org.eclipse.lsp4xml.extensions.contentmodel.participants.XMLSchemaErrorCode; +import org.eclipse.lsp4xml.extensions.xsd.participants.XSDErrorCode; +import org.eclipse.lsp4xml.extensions.xsd.participants.diagnostics.XSDValidator; import org.junit.Test; /** - * XSD diagnostics tests which test the {@link XSDURIResolverExtension}. + * XSD diagnostics tests which test the {@link XSDValidator}. * */ public class XSDValidationExtensionsTest { @Test - public void xsdInvalid() throws BadLocationException { - String xml = "\r\n" - + " \r\n" - + // - " bar\r\n" + // <- error foo doesn't exist + public void s4s_elt_invalid_content_1() throws BadLocationException { + String xml = "\r\n" + // + "\r\n" + // + " \r\n" + // <- error foo doesn't exist ""; - testDiagnosticsFor(xml, d(2, 4, 2, 7, XMLSchemaErrorCode.cvc_complex_type_2_4_a)); + testDiagnosticsFor(xml, d(3, 2, 3, 5, XSDErrorCode.s4s_elt_invalid_content_1)); } - private void testDiagnosticsFor(String xml, Diagnostic... expected) throws BadLocationException { - XMLAssert.testDiagnosticsFor(xml, expected); + @Test + public void s4s_elt_character() throws BadLocationException { + String xml = "\r\n" + // + "\r\n" + // + " bar\r\n" + // <- error with bar text + ""; + testDiagnosticsFor(xml, d(3, 24, 3, 27, XSDErrorCode.s4s_elt_character)); + } + + @Test + public void s4s_att_must_appear() throws BadLocationException { + String xml = "\r\n" + // + "\r\n" + // + " \r\n" + // <- error with @name missing + ""; + testDiagnosticsFor(xml, d(3, 2, 3, 12, XSDErrorCode.s4s_att_must_appear)); + } + + @Test + public void s4s_att_not_allowed() throws BadLocationException { + String xml = "\r\n" + // + "\r\n" + // + " \r\n" + // <- error with foo attribute which is not allowed + ""; + testDiagnosticsFor(xml, d(3, 13, 3, 16, XSDErrorCode.s4s_att_not_allowed), + d(3, 2, 3, 12, XSDErrorCode.s4s_att_must_appear)); + } + + @Test + public void s4s_att_invalid_value() throws BadLocationException { + String xml = "\r\n" + // + "\r\n" + // + " \r\n" + // <- error with @name which is empty + ""; + testDiagnosticsFor(xml, d(3, 18, 3, 20, XSDErrorCode.s4s_att_invalid_value), + d(3, 2, 3, 12, XSDErrorCode.s4s_att_must_appear)); + } + + @Test + public void src_resolve() throws BadLocationException { + String xml = "\r\n" + // + "\r\n" + // + " \r\n" + // + " \r\n" + // + " \r\n" + // + " \r\n" + // + " \r\n" + // <- error with XXXXX + " \r\n" + // + " \r\n" + // + " \r\n" + // + ""; + testDiagnosticsFor(xml, d(7, 32, 7, 39, XSDErrorCode.src_resolve)); + } + + @Test + public void src_resolve2() throws BadLocationException { + String xml = "\r\n" + // + "\r\n" + // + "\r\n" + // + " \r\n" + // + " \r\n" + // + " \r\n" + // + " \r\n" + // + " \r\n" + // + " \r\n" + // + " \r\n" + // + "\r\n" + // + " \r\n" + // + " \r\n" + // <- error with fooType which doesn't exists + "\r\n" + // + ""; + testDiagnosticsFor(xml, d(13, 29, 13, 38, XSDErrorCode.src_resolve)); + } + + @Test + public void src_element_2_1() throws BadLocationException { + String xml = "\r\n" + // + "\r\n" + // + " \r\n" + // + " \r\n" + // + " \r\n" + // + " \r\n" + // <- error nhame + // doesn't exists + " \r\n" + // + " \r\n" + // + " \r\n" + // + " \r\n" + // + " \r\n" + // + " \r\n" + // + ""; + testDiagnosticsFor(xml, d(5, 28, 5, 33, XSDErrorCode.s4s_att_not_allowed), + d(5, 17, 5, 27, XSDErrorCode.src_element_2_1)); + } + + private static void testDiagnosticsFor(String xml, Diagnostic... expected) throws BadLocationException { + XMLAssert.testDiagnosticsFor(xml, null, null, "test.xsd", expected); } } diff --git a/org.eclipse.lsp4xml/src/test/resources/validation/schema/s4s_att_invalid_value.xsd b/org.eclipse.lsp4xml/src/test/resources/validation/schema/s4s_att_invalid_value.xsd new file mode 100644 index 000000000..96cea65f0 --- /dev/null +++ b/org.eclipse.lsp4xml/src/test/resources/validation/schema/s4s_att_invalid_value.xsd @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/org.eclipse.lsp4xml/src/test/resources/validation/schema/s4s_att_must_appear.xsd b/org.eclipse.lsp4xml/src/test/resources/validation/schema/s4s_att_must_appear.xsd new file mode 100644 index 000000000..7ca029910 --- /dev/null +++ b/org.eclipse.lsp4xml/src/test/resources/validation/schema/s4s_att_must_appear.xsd @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/org.eclipse.lsp4xml/src/test/resources/validation/schema/s4s_att_not_allowed.xsd b/org.eclipse.lsp4xml/src/test/resources/validation/schema/s4s_att_not_allowed.xsd new file mode 100644 index 000000000..191b14e1c --- /dev/null +++ b/org.eclipse.lsp4xml/src/test/resources/validation/schema/s4s_att_not_allowed.xsd @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/org.eclipse.lsp4xml/src/test/resources/validation/schema/s4s_elt_character.xsd b/org.eclipse.lsp4xml/src/test/resources/validation/schema/s4s_elt_character.xsd new file mode 100644 index 000000000..67281a8d0 --- /dev/null +++ b/org.eclipse.lsp4xml/src/test/resources/validation/schema/s4s_elt_character.xsd @@ -0,0 +1,5 @@ + + + bar + \ No newline at end of file diff --git a/org.eclipse.lsp4xml/src/test/resources/validation/schema/s4s_elt_invalid_content_1.xsd b/org.eclipse.lsp4xml/src/test/resources/validation/schema/s4s_elt_invalid_content_1.xsd new file mode 100644 index 000000000..a944153ed --- /dev/null +++ b/org.eclipse.lsp4xml/src/test/resources/validation/schema/s4s_elt_invalid_content_1.xsd @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/org.eclipse.lsp4xml/src/test/resources/validation/schema/src-resolve.xsd b/org.eclipse.lsp4xml/src/test/resources/validation/schema/src-resolve.xsd new file mode 100644 index 000000000..6e7192e7f --- /dev/null +++ b/org.eclipse.lsp4xml/src/test/resources/validation/schema/src-resolve.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/org.eclipse.lsp4xml/src/test/resources/validation/schema/src-resolve2.xsd b/org.eclipse.lsp4xml/src/test/resources/validation/schema/src-resolve2.xsd new file mode 100644 index 000000000..13c4b8c85 --- /dev/null +++ b/org.eclipse.lsp4xml/src/test/resources/validation/schema/src-resolve2.xsd @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + \ No newline at end of file