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

Adding valid xml start and end tags for groovy template scripts

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.0-beta-10
    • None
    • Groovlet / GSP
    • None
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: