Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Found out the solution by myself.
Just put "name(...)" around the xpath expression like "name(//*[1])".
Does nobody know how to solve this?
Best regards,
Dominik
Found out the solution by myself.
Just put "name(...)" around the xpath expression like "name(//*[1])".
@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...