[
https://issues.apache.org/jira/browse/GROOVY-10495?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles updated GROOVY-10495:
---------------------------------
Fix Version/s: (was: 5.0.0-alpha-1)
> Invalid newlines generated by XmlTemplateEngine
> -----------------------------------------------
>
> Key: GROOVY-10495
> URL: https://issues.apache.org/jira/browse/GROOVY-10495
> Project: Groovy
> Issue Type: Bug
> Reporter: Daniel Sun
> Assignee: Paul King
> Priority: Major
> Fix For: 3.0.11, 4.0.2
>
> Time Spent: 1h 20m
> Remaining Estimate: 0h
>
> In our recent project, we found a formatting bug of {{{}XmlTemplateEngine{}}}:
> We expect the following test pass:
> {code:java}
> XmlTemplateEngine xmlTemplateEngine = new XmlTemplateEngine();
> String xmlScript = "<person>\n"
> + " <name>Daniel</name>\n"
> + "</person>";
> Template template = xmlTemplateEngine.createTemplate(xmlScript);
>
> assertTrue(template.make().toString().contains("<name>Daniel</name>")); // no
> newlines
> {code}
> But we get(see the newlines around {{{}Daniel{}}}):
> {code:xml}
> <person>
> <name>
> Daniel
> </name>
> </person>
> {code}
> As a result, we will get additional newlines if we parse the generated xml
> and fetch the text of {{name}} element.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)