how insert/move/delete nodes xml groovy?


for example, i have following xml document:



def car_records = '''
<records>
<car name='hsv maloo' make='holden' year='2006'/>
<car name='p50' make='peel' year='1962'/>
<car name='royale' make='bugatti' year='1931'/>
</records>
'''


and i wish pierce car "royale" adult initial one, insert new car only after car"hsv maloo", outcome be:



'''
<records>
<car name='royale' make='bugatti' year='1931'/>
<car name='hsv maloo' make='holden' year='2006'/>
<car name='my new car' make='peel' year='1962'/>
<car name='p50' make='peel' year='1962'/>
</records>
'''


how groovy? comments welcome.



Comments

Popular posts from this blog

list macos calm editors formula editors

how hibernate @any-related annotations?

why does floated <input> control floated component slip over too distant right ie7, nonetheless firefox?