Forum Discussion
RJanecek
14 years agoRegular Contributor
hm firstly you read your data from element
def element = sql.firstrow("select" .....
then you can convert this string to xml element: http://stackoverflow.com/questions/7296 ... de-in-java and working with these as element - append new node
or you can do some operation with these string part1 = element.substring(0,element.lastIndexOf('/')-1)
par1 = part1.concat("your new element")
element .concat(part1 + element.substring(element.lastIndexOf('/'),element.lenght()))
this code is just an idea how you can create element in groovy sccript
def element = sql.firstrow("select" .....
then you can convert this string to xml element: http://stackoverflow.com/questions/7296 ... de-in-java and working with these as element - append new node
or you can do some operation with these string part1 = element.substring(0,element.lastIndexOf('/')-1)
par1 = part1.concat("your new element")
element .concat(part1 + element.substring(element.lastIndexOf('/'),element.lenght()))
this code is just an idea how you can create element in groovy sccript