Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.0-JSR-3
-
None
-
None
-
WinXP SP2
Description
Lets get Groovy!
================
Version: 1.0-jsr-03 JVM: 1.5.0-b64
Type 'exit' to terminate the shell
Type 'help' for command help
Type 'go' to execute the statements
groovy> def xml = new groovy.xml.MarkupBuilder(); def doc = xml.query()
{ xml."ejb-ql"() }groovy> go
CommandLine.groovy: 1: Invalid method name. Invalid character at position: 4 of value: - in name: ejb-ql.
Node: org.codehaus.groovy.ast.expr.MethodCallExpression. At [1:67] @ line 1, column 67.
1 Error
groovy> def xml = new groovy.xml.MarkupBuilder(); def doc = xml.query() { xml.invokeMethod("ejb-ql", {}) }
groovy> go
<query>
<ejb-ql />
</query>
groovy>
groovy> def xml = new groovy.xml.MarkupBuilder(); def doc = xml.query()
groovy> go
<query>
<ejb-ql />
</query>
groovy>
The first example should work, but it does not.
The second example is a workaround provided by tug.
The third example is just a hack and should not be used.