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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Web link data extraction and JSON to XML conversion

Hi
I'm trying to fetch data from software link. 

Here's is my job

tLibraryLoad--->tRest--->tJavaRow--->tFileoutputDelimited--->tfileoutputxml--->tlogrow
In tJavarow am using this

org.json.JSONObject jsonFileObject = new org.json.JSONObject(input_row.Body);
output_row.Body = "<?xml version=\"1.0\" encoding=\"ISO-8859-15\"?>\n<root>" + org.json.XML.toString(jsonFileObject ).replaceAll("48x48>", "tag48x48>").replaceAll("16x16>", "tag16x16>").replaceAll("32x32>", "tag32x32>").replaceAll("24x24>", "tag24x24>") + "</root>";

In tFileoutputDelimited am getting xml file.

After running a job am getting error like this

Starting job weblink12 at 18:52 19/10/2015.
connecting to socket on port 3412
connected
Error on line 2 of document  : Content is not allowed in trailing section. Nested exception: Content is not allowed in trailing section.
disconnected
Job weblink12 ended at 18:52 19/10/2015.
Please help
Labels (6)
3 Replies
Anonymous
Not applicable
Author

For debugging, add a tLogRow after tJavaRow to print the body on the console to see what does the data looks like?
Anonymous
Not applicable
Author

Hi Shong
I'm receiving xml file at tFileoutputDelimited . But there is slightly error in xml file but after fixing that aI'm getting my getting data.
Is there any way to use validate xml file after receiving at tfileoutput delimited and then use that file with ifileinputxml?
Any way ?
Anonymous
Not applicable
Author

Hi all,
seems that you'got some 'bad hyphen' (unwanted) at the end of your xml.
you can check your xml against DTD or XSD thanks txsd validator
regards
laurent