Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-1076

MarkupBuilder does not work with escaped tags

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-JSR-3
    • 1.0-JSR-4
    • 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()

      { ejb_ql() }

      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.

      Attachments

        Activity

          People

            guillaume Guillaume Sauthier
            sevenm Horia Muntean
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: