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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

XPath in XMLMap

Hello,
I'm trying to get an XPath-Query working in a XML-Map. But I got some problems with it.
The XML is from a webservice an I need the XML as it is, just with some additional data. It is an invoice with several lines. I need to add the total.
An option would be an tExtractXMLField with tAggregateRow, then put the value on the global map an read the xml-document an the total after FlowToIterate.
Is there an easier option?

The best solution would be to get the total with an XPath-Query in the XML-Map.

A simlyfied example is this one:
XML-Structure:
<invoice>
<line>
<nr>1</nr>
<amount>100</amount>
</line>
<line>
<nr>2</nr>
<amount>100</amount>
</line>
</invoice>

When I read the XML from a file and put the XPath in tFileInputXML it works.
When I read the XML as a node an put the XPath in an XMLMap (what I want for the webservice) it stops with an error (method not defined).
Is there a way to get XPath working in tXMLMap?
0683p000009MCeE.png 0683p000009MCYm.png 0683p000009MCUP.png 0683p000009MCeJ.png
Labels (3)
1 Reply
Anonymous
Not applicable
Author

Hi aoh,
Please refer to my attachment solution.png.
First you can use tConvertType component convert you output String type to what you want to (like Integer,Double and so on ).
And then pass the value to another tXMLMap component.
0683p000009MCHr.png