INT-3051 Derive Script Language from Extension

Make 'lang' attribute optional on a script element and
attempt to derive the language from the file extension.

Change return value on ScriptParser.deriveLanguageFromExtension to the language name

Polishing (PR Comments)
This commit is contained in:
David Turanski
2013-06-10 10:40:44 -04:00
committed by Gary Russell
parent 573c692957
commit 67fd4a5a60
7 changed files with 212 additions and 40 deletions

View File

@@ -19,10 +19,12 @@
<xsd:complexType name="Jsr223Script">
<xsd:complexContent>
<xsd:extension base="ScriptType">
<xsd:attribute name="lang" use="required">
<xsd:attribute name="lang" use="optional">
<xsd:annotation>
<xsd:documentation>
The script language or JSR 223 scripting engine name
The script language or JSR 223 scripting engine name. Required only for inline scripts. If a script location is
referenced, the language may be derived from the file extension
(.rb: ruby, .groovy, js: javascript (ECMAScript), .py: python).
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>