mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-133468 XSLT 3.0 Support Crippled
GitOrigin-RevId: eb8ebede870916af834cf95165b86e1b036cbb78
This commit is contained in:
committed by
intellij-monorepo-bot
parent
d556b76599
commit
31940f7359
@@ -66,25 +66,25 @@ public class XsltChecker implements NanoXmlBuilder {
|
||||
private void checkVersion(String value, State yes) {
|
||||
if (isVersion1(value)) {
|
||||
myState = yes;
|
||||
} else if (isVersion2(value)) {
|
||||
} else if (isVersion2(value) || isVersion3(value)) {
|
||||
myState = State.VERSION2;
|
||||
} else {
|
||||
myState = State.NO;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isSupportedVersion(String value) {
|
||||
return isVersion1(value) || isVersion2(value);
|
||||
}
|
||||
|
||||
public static boolean isVersion1(String value) {
|
||||
private static boolean isVersion1(String value) {
|
||||
return "1.0".equals(value) || "1.1".equals(value);
|
||||
}
|
||||
|
||||
public static boolean isVersion2(String value) {
|
||||
private static boolean isVersion2(String value) {
|
||||
return "2.0".equals(value);
|
||||
}
|
||||
|
||||
private static boolean isVersion3(String value) {
|
||||
return "3.0".equals(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void elementAttributesProcessed(String name, String nsPrefix, String nsURI) throws Exception {
|
||||
NanoXmlBuilder.stop(); // the first element (or its attrs) decides - stop here
|
||||
@@ -99,10 +99,6 @@ public class XsltChecker implements NanoXmlBuilder {
|
||||
return myState == State.YES || myState == State.SIMPLIFIED;
|
||||
}
|
||||
|
||||
public boolean isSimplifiedSyntax() {
|
||||
return myState == State.SIMPLIFIED;
|
||||
}
|
||||
|
||||
public static LanguageLevel getLanguageLevel(String value) {
|
||||
if (value == null) {
|
||||
return LanguageLevel.NONE;
|
||||
@@ -113,6 +109,9 @@ public class XsltChecker implements NanoXmlBuilder {
|
||||
if (isVersion2(value)) {
|
||||
return LanguageLevel.V2;
|
||||
}
|
||||
if (isVersion3(value)) {
|
||||
return LanguageLevel.V2;
|
||||
}
|
||||
return LanguageLevel.NONE;
|
||||
}
|
||||
|
||||
|
||||
@@ -56,6 +56,10 @@ public class Xslt2HighlightingTest extends TestBase {
|
||||
doXsltHighlighting("move-def.xsd");
|
||||
}
|
||||
|
||||
public void testXslt3() {
|
||||
doXsltHighlighting();
|
||||
}
|
||||
|
||||
private void doXsltHighlighting(String... moreFiles) {
|
||||
final String name = getTestFileName();
|
||||
myFixture.testHighlighting(true, false, false, ArrayUtil.mergeArrays(new String[]{ name + ".xsl" }, moreFiles));
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
<xsl:template match="/">
|
||||
<xsl:variable name="foo" select="foo"/>
|
||||
<xsl:variable name="<warning descr="Variable 'bar' is never used">bar</warning>" select="concat($foo, '/', $<error descr="Unresolved variable 'unknown'">unknown</error>)"/>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
Reference in New Issue
Block a user