[298265] XSLT 1.0 validation is used on XSLT 2.0 documents when the root is xsl:transform https://bugs.eclipse.org/bugs/show_bug.cgi?id=298265
Fixed the wrong reference to xsl:template instead of xsl:transform.
diff --git a/tests/org.eclipse.wst.xsl.ui.tests/projectfiles/XSLT20Transform.xsl b/tests/org.eclipse.wst.xsl.ui.tests/projectfiles/XSLT20Transform.xsl
new file mode 100644
index 0000000..fbfa7ef
--- /dev/null
+++ b/tests/org.eclipse.wst.xsl.ui.tests/projectfiles/XSLT20Transform.xsl
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
+ <xsl:variable name="var" as="xs:string" select="''" />
+</xsl:transform>
\ No newline at end of file
diff --git a/tests/org.eclipse.wst.xsl.ui.tests/src/org/eclipse/wst/xsl/ui/internal/validation/TestDelegatingSourceValidatorForXSL.java b/tests/org.eclipse.wst.xsl.ui.tests/src/org/eclipse/wst/xsl/ui/internal/validation/TestDelegatingSourceValidatorForXSL.java
index 321766c..22cd866 100755
--- a/tests/org.eclipse.wst.xsl.ui.tests/src/org/eclipse/wst/xsl/ui/internal/validation/TestDelegatingSourceValidatorForXSL.java
+++ b/tests/org.eclipse.wst.xsl.ui.tests/src/org/eclipse/wst/xsl/ui/internal/validation/TestDelegatingSourceValidatorForXSL.java
@@ -100,6 +100,16 @@
sourceValidator.validate(context, reporter);
assertFalse("Errors reported with XSLT 2.0 with Functions: " + fileName + ".", reporter.isMessageReported());
}
+
+ @Test
+ public void testXSL20Transform() throws Exception {
+ String fileName = "XSLT20Transform.xsl";
+ WorkbenchContext context = setupFile(getxslTestFilesProjectName(), fileName);
+ TestReporter reporter = new TestReporter();
+ sourceValidator.validate(context, reporter);
+ assertFalse("Errors reported with XSLT 2.0 with Transform statement: " + fileName + ".", reporter.isMessageReported());
+ }
+
private class TestReporter implements IReporter {
protected boolean messageReported = false;