Quantcast
Channel: New board topics in SmartBear Community
Viewing all articles
Browse latest Browse all 20990

How do I get rid of xsi:nil when setting an elements text using groovy

$
0
0

I'm trying to set the text of an xml element in my request that was previously set to xml:nil=true.

 

So I want:

<MyElement i:nil="true" />

to become:

<MyElement>NewText</MyElement>

My groovy script is:

def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def response = groovyUtils.getXmlHolder("Step1#Response")
response["//MyElement"] = "NewText"

But I'm getting:

<MyElement i:nil="true">NewText</MyElement>

How do I get rid of the xsi:nil attribute?


Viewing all articles
Browse latest Browse all 20990

Trending Articles