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: 
Anonymous
Not applicable

XML mapping with REST client

The requirement I need is to be able to monitor a folder directory for a formatted .cvs file and when that gets triggered, I take that read the file and map the data into a UTF-8 XML file to pass to a REST client web service call (not my REST service). The problem is, the REST service requires that the passed XML file has a new line after each tag (I think people call that pretty XML) and the XML mapping does not provide that feature so I was wondering what my next approach should be or if it's just me doing something wrong. (Also note that I'm new to Talend).
Everything is mapping fine data-wise but the required format is not what I need and I'm pretty sure my tRESTClient is configured correctly as the web service is getting called.
I've attached a screen of the process (hopefully you can see it). My tRESTClient is a POST and the content type and accepted type are both XML. I also unticked the "convert response to DOM document" in the advanced setting but that shouldn't affect the input structure.
0683p000009MBH5.png
Labels (4)
11 Replies
Anonymous
Not applicable
Author

I've managed to use the routine code to convert the XML map document to be a pretty document by converting the input row of type routines.system.Document to a string, then using the pretty XML example previously provided to make a pretty XML document of type org.w3c.dom.Document.
The problem I'm having now is the document type of output_row.body is routines.system.Document but the pretty XML document is org.w3c.dom.Document.
Can someone help explain to me how I can convert from org.w3c.dom.Document to routines.system.Document?
Anonymous
Not applicable
Author

Hi
I will take a look at your code and come back to you.
Best regards
Shong