[
https://issues.apache.org/jira/browse/GROOVY-3558?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Paul King closed GROOVY-3558.
-----------------------------
> ConfigSlurper - not able to create property containing xml using
> MarkupBuilder/StreamingMarkupBuilder
> -----------------------------------------------------------------------------------------------------
>
> Key: GROOVY-3558
> URL: https://issues.apache.org/jira/browse/GROOVY-3558
> Project: Groovy
> Issue Type: Sub-task
> Components: groovy-jdk
> Affects Versions: 1.6.3
> Environment: Mac OS X 10.5.7
> Reporter: Tomas Knappek
>
> when use the following as an config file:
> {code}
> import groovy.xml.StreamingMarkupBuilder
> def xml = new StreamingMarkupBuilder().bind{
> records {
> car(name:'HSV Maloo', make:'Holden', year:2006) {
> country('Australia')
> record(type:'speed', 'Production Pickup Truck with speed of 271kph')
> }
> }
> }
> definedxml= "<?xml version='1.0' encoding='UTF-8'?>" + xml.toString()
> {code}
> and use ConfigSlurper to parse the file, I get the following value when
> asking for "definedxml" property:
> {code:xml}
> <?xml version='1.0' encoding='UTF-8'?><country>Australia</country><record
> type='speed'>Production Pickup Truck with speed of 271kph</record>
> {code}
> However I do expect to get:
> {code:xml}
> <?xml version='1.0' encoding='UTF-8'?><records><car name='HSV Maloo'
> make='Holden' year='2006'><country>Australia</country><record
> type='speed'>Production Pickup Truck with speed of
> 271kph</record></car></records>
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)