groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Edinson E. Padrón Urdaneta <edinson.padron.urdan...@gmail.com>
Subject Re: GPathResult and attributes
Date Wed, 14 Oct 2015 17:33:28 GMT
How about XmlParser?

def node = new XmlParser().parse(new File('path-to-xml-file')
println node.parent.child1.first().attributes()


On Wed, Oct 14, 2015 at 10:49 AM, Balachandran Sivakumar <
benignbala@gmail.com> wrote:

> Hi,
>
> On Wed, Oct 14, 2015 at 8:46 PM, Schalk Cronjé <ysb33r@gmail.com> wrote:
>
>>
>>> Use
>>
>>   root.parent.child.@id
>>
>> or
>>
>>   root.parent.child.'@id'
>>
>> to access the attribute you want.
>>
>>
>>
>         Thanks, but I want all the attributes on the node returned as a
> ma, not just a specific attribute. Thanks.
>
>
>> --
>> Schalk W. Cronjé
>> Twitter / Ello / Toeter : @ysb33r
>>
>>
>
>
> --
> Thank you
> Balachandran Sivakumar
>
>

Mime
View raw message