You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@groovy.apache.org by GroovyBeginner <gr...@gmail.com> on 2016/08/21 07:06:15 UTC

Convert Employee Node object to XML Groovy

I have Employee Node Object of class groovy.util.Node 

xml=Employees[attributes={}; value=[Employee[attributes={};
value=[ID[attributes={}; value=[123]], Addresses[attributes={};
value=[Address[attributes={}; value=[Country[attributes={}; value=[USA]],
ZipCode[attributes={}; value=[40640]]]]]]]], Employee[attributes={};
value=[ID[attributes={}; value=[345]], Addresses[attributes={};
value=[Address[attributes={}; value=[Country[attributes={}; value=[CA]],
ZipCode[attributes={}; value=[50640]]]]]]]]]] 

How to convert this object to XML with out using the serialize method in
Groovy?



--
View this message in context: http://groovy.329449.n5.nabble.com/Convert-Employee-Node-object-to-XML-Groovy-tp5734786.html
Sent from the Groovy Dev mailing list archive at Nabble.com.

Fwd: Convert Employee Node object to XML Groovy

Posted by Paul King <pa...@asert.com.au>.
[forwarded from dev list, since it's not a dev question]

Hi GroovyBeginner,

Try:

new XmlNodePrinter().print(xml)

Cheers, Paul.


---------- Forwarded message ----------
From: GroovyBeginner <gr...@gmail.com>
Date: Sun, Aug 21, 2016 at 5:06 PM
Subject: Convert Employee Node object to XML Groovy
To: dev@groovy.incubator.apache.org


I have Employee Node Object of class groovy.util.Node

xml=Employees[attributes={}; value=[Employee[attributes={};
value=[ID[attributes={}; value=[123]], Addresses[attributes={};
value=[Address[attributes={}; value=[Country[attributes={}; value=[USA]],
ZipCode[attributes={}; value=[40640]]]]]]]], Employee[attributes={};
value=[ID[attributes={}; value=[345]], Addresses[attributes={};
value=[Address[attributes={}; value=[Country[attributes={}; value=[CA]],
ZipCode[attributes={}; value=[50640]]]]]]]]]]

How to convert this object to XML with out using the serialize method in
Groovy?



--
View this message in context:
http://groovy.329449.n5.nabble.com/Convert-Employee-Node-object-to-XML-Groovy-tp5734786.html
Sent from the Groovy Dev mailing list archive at Nabble.com.

Re: Convert Employee Node object to XML Groovy

Posted by Paul King <pa...@asert.com.au>.
I'll forward your email to the users list.


On Sun, Aug 21, 2016 at 5:06 PM, GroovyBeginner
<gr...@gmail.com> wrote:
> I have Employee Node Object of class groovy.util.Node
>
> xml=Employees[attributes={}; value=[Employee[attributes={};
> value=[ID[attributes={}; value=[123]], Addresses[attributes={};
> value=[Address[attributes={}; value=[Country[attributes={}; value=[USA]],
> ZipCode[attributes={}; value=[40640]]]]]]]], Employee[attributes={};
> value=[ID[attributes={}; value=[345]], Addresses[attributes={};
> value=[Address[attributes={}; value=[Country[attributes={}; value=[CA]],
> ZipCode[attributes={}; value=[50640]]]]]]]]]]
>
> How to convert this object to XML with out using the serialize method in
> Groovy?
>
>
>
> --
> View this message in context: http://groovy.329449.n5.nabble.com/Convert-Employee-Node-object-to-XML-Groovy-tp5734786.html
> Sent from the Groovy Dev mailing list archive at Nabble.com.