Hello,

 

I’m having a headache trying to understand why those 2 pieces of groovy do not generate exactly the same thing :

 

1)-

<%

// LOOP 10 times

  println ( ‘<event>’ + xwiki.getXMLEncoded(blablabla) + ‘</event>’ )

// END LOOP

%>

 

2)-

<%

str = ‘’

// LOOP 10 times

  str  = str + ‘<event>’ + xwiki.getXMLEncoded(blablabla) + ‘</event>\n’

// END LOOP

println(str)

%> 

 

“blablabla” is a formatted text (in my case, the description field of an article for example).

 

1) produces what is expected : it writes 10 lines of text, beginning with ‘<event>’, and special characters in “blablabla” are correctly translated.

 

2) produces any number of lines (> 10), because carriage returns inside “blablabla” have not been translated, and so many lines are written for each line expected.

 

I ‘m not sure if this is the right place for this, but if someone as an idea it would greatly help me …

 

 

Best Regards,

Jeremie