Skip to content

Commit e861166

Browse files
Revert identifiers.xsl to version from commit 2bb0f79
1 parent ab1501b commit e861166

File tree

1 file changed

+3
-28
lines changed

1 file changed

+3
-28
lines changed

identifiers.xsl

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,6 @@
1717

1818
<xsl:output method="text" version="1.0" encoding="UTF-8" indent="yes"/>
1919

20-
<!-- GET VALID JAVA IDENTIFIER -->
21-
<xsl:template name="get-valid-java-identifier">
22-
<xsl:param name="name"/>
23-
<xsl:variable name="java-keywords"
24-
select="'abstract assert boolean break byte case catch char class const continue default do double else enum extends final finally float for goto if implements import instanceof int interface long native new package private protected public return short static strictfp super switch synchronized this throw throws transient try void volatile while true false null record sealed non-sealed'"/>
25-
<xsl:choose>
26-
<xsl:when test="contains('0123456789', substring($name,1,1))">
27-
<xsl:text>_</xsl:text><xsl:value-of select="$name"/>
28-
</xsl:when>
29-
30-
<xsl:when test="contains(concat(' ', $java-keywords, ' '), concat(' ', $name, ' '))">
31-
<xsl:text>_</xsl:text><xsl:value-of select="$name"/>
32-
</xsl:when>
33-
<xsl:otherwise>
34-
<xsl:value-of select="$name"/>
35-
</xsl:otherwise>
36-
</xsl:choose>
37-
</xsl:template>
38-
3920
<!-- MAIN, FILE GENERATION -->
4021
<xsl:template match="/constants">
4122

@@ -72,9 +53,7 @@
7253

7354
<xsl:template match="int" mode="Java">
7455
<xsl:text>&#009;public static final int </xsl:text>
75-
<xsl:call-template name="get-valid-java-identifier">
76-
<xsl:with-param name="name" select="@name"/>
77-
</xsl:call-template>
56+
<xsl:value-of select="@name"/>
7857
<xsl:text>&#009; = </xsl:text>
7958
<xsl:value-of select="."/>
8059
<xsl:text>;</xsl:text>
@@ -83,9 +62,7 @@
8362

8463
<xsl:template match="float" mode="Java">
8564
<xsl:text>&#009;public static final double </xsl:text>
86-
<xsl:call-template name="get-valid-java-identifier">
87-
<xsl:with-param name="name" select="@name"/>
88-
</xsl:call-template>
65+
<xsl:value-of select="@name"/>
8966
<xsl:choose>
9067
<xsl:when test="@alias!='' or @alias='true'">
9168
<xsl:text>;</xsl:text>
@@ -107,9 +84,7 @@
10784

10885
<xsl:template match="string" mode="Java">
10986
<xsl:text>&#009;public static final String </xsl:text>
110-
<xsl:call-template name="get-valid-java-identifier">
111-
<xsl:with-param name="name" select="@name"/>
112-
</xsl:call-template>
87+
<xsl:value-of select="@name"/>
11388
<xsl:text>&#009; = "</xsl:text>
11489
<xsl:value-of select="."/><xsl:text>";</xsl:text>
11590
<xsl:value-of select="my:desc('//')"/>

0 commit comments

Comments
 (0)