Ask a Question

How do I access the XPath within an XML Node?

testguru
Occasional Visitor

How do I access the XPath within an XML Node?

I am trying to access an attribute within an XML node. How would I do this?

 

<data:TransactionAdd AccountID="?">

 

I need to access the AccointID attribute, but when I map to TransactionAdd the XML is going after the TransactionAdd header.

 

Looks like this <data:TransactionAdd AccountID="?">XPATH LEADS HERE<Optional>

 

How do I access the variable AccountID via XPath?

1 REPLY 1
avidCoder
Super Contributor

Did you try this approach?

def gutils = new com.eviware.soapui.support.GroovyUtils( context );
def holder = gutils.getXmlHolder("Request_Name#Response");

def accountId = holder.getNodeValue("//data:TransactionAdd/@AccountID");
cancel
Showing results for 
Search instead for 
Did you mean: