How to get name of xml node with tExtractXmlFields

Five Stars

How to get name of xml node with tExtractXmlFields

Hello,

 

i'm trying to extract the name of an Xml Node with tExtractXmlFields.

This works fine for my first usecase, but for the second use cases i'm facing a problem.

 

The Problem is, that the node i'm trying to get the name from has a xmlns-attribute.

Error: 

<myFunctionResponse xmlns="http://tempuri.org/Webservice/Function">

 

Works fine: 

<soap:Envelope ...  xmlns:web="http://tempuri.org/Webservice/Function">

...

<web:myFunctionResponse>

 

I am getting the following error:

Exception in component tExtractXMLField_1
java.lang.ArrayIndexOutOfBoundsException: -1

 

My XPath-Query:

"name(//soap:Envelop/soap:Body/*[1])"

 

also tried with:

"local-name(//soap:Envelop/soap:Body/*[1])"

"name(//soap:Envelop/soap:Body/*[@xmlns='http://tempuri.org/Webservice/Function'])"

 

 

Does anyone can help me on how to fix it?

 

Best regards,

Dominik 


Accepted Solutions
Five Stars

Re: How to get name of xml node with tExtractXmlFields

Found out the solution by myself.

 

Just put "name(...)" around the xpath expression like "name(//*[1])".


All Replies
Five Stars

Re: How to get name of xml node with tExtractXmlFields

Does nobody know how to solve this? 

 

Best regards,

Dominik 

Five Stars

Re: How to get name of xml node with tExtractXmlFields

Found out the solution by myself.

 

Just put "name(...)" around the xpath expression like "name(//*[1])".