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

Adding valid xml start and end tags for groovy template scripts

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0-beta-10
    • Fix Version/s: None
    • Component/s: Groovlet / GSP
    • Labels:
      None
    • Environment:
      All

      Description

      Current template scripting (not validxml ):

      <%
      3.each{println '<p>stooges</p>'
      %>

      proposed (valid XML) :

      <groovy:scriplet>
      3.each

      {println '<p>stooges</p>'}

      </groovy:scriplet>

      In addition to avoid additional xml escaping issues use of CDATA I would imagine real world usage :

      <groovy:scriplet>
      <![CDATA[
      3.each

      {println '<p>stooges</p>' }

      ]]>
      </groovy:scriplet>

      the CDATA enables use of illegal xml characters like '<' and '>' among otehr things.
      The implementation of this however should result after templating output as :
      <p>stooges</p>

      and NOT:
      <p>stooges</p>

      Otherwise printing of markup on the output of the template will not transpose to an xml output in teh expected fashion!!

      I have found otehr ways around this using builders and CDATA section but these are logical or elegant solutions.

      For XML compliance on input and output we need the new way.

        Attachments

        1. helloworld.xml
          0.4 kB
          sormuras
        2. helloworld.xhtml
          0.7 kB
          sormuras

          Issue Links

            Activity

              People

              • Assignee:
                sormuras sormuras
                Reporter:
                babelex Al
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: