Ask a Question

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

SOLVED
garrmark
New Contributor

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

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?

2 REPLIES 2
nmrao
Community Hero

Would you like to post the full xml? Can you also clarify how your test case is structured and what you wanted to achieve?

 



Regards,
Rao.
garrmark
New Contributor
cancel
Showing results for 
Search instead for 
Did you mean: