You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (JIRA)" <ji...@apache.org> on 2016/07/30 06:30:21 UTC
[jira] [Resolved] (GROOVY-3558) ConfigSlurper - not able to create
property containing xml using MarkupBuilder/StreamingMarkupBuilder
[ https://issues.apache.org/jira/browse/GROOVY-3558?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King resolved GROOVY-3558.
-------------------------------
Resolution: Not A Problem
Looks like Roshan has explained the expected behavior of ConfigSlurper. Please reopen if you still have problems trying to achieve what you need using the suggested style/workarounds.
> 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.4#6332)