I was trying to use 'replace' to do some changes in a xml file. The previous way I did it was like
* replace <element>1</element> = '<element>2</element><element>2</element>'
Based on this, I tried to use a method to generate the value and import that into the string
* replace <element>1</element> = '<element>#(test)</element><element>#(test)</element>'
But it seems like the thing after the # will be recognized as a comment.
Then I tried to use variables instead
* def replacement = generatenumber
* def replacement1 = generatenumber
* replace <element>1</element> = '<element>replacement</element><element>replacement1</element>'
And it's still not working. So can I ask is there anyway to achieve it? Thanks in advance.
Aucun commentaire:
Enregistrer un commentaire