Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
droth
Contributor II
Contributor II

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 

Labels (5)
1 Solution

Accepted Solutions
droth
Contributor II
Contributor II
Author

Found out the solution by myself.

 

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

View solution in original post

3 Replies
droth
Contributor II
Contributor II
Author

Does nobody know how to solve this? 

 

Best regards,

Dominik 

droth
Contributor II
Contributor II
Author

Found out the solution by myself.

 

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

vincentB1
Contributor
Contributor


@droth wrote:

Found out the solution by myself.

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


Make sure that "Get Nodes" is checked too.
explications here : https://community.talend.com/t5/Design-and-Development/Issue-extracting-XML-node-names-or-element-na...