Hi,
here my situation:
I would like to import data that is returned from a weservice call in json format, something like:
{
"status_product_detail": { "codice_value": "00001", "out_of_sla": "Within the Service Target", "creation_ore": "10:25", "creation_date": "21-05 10:25", "product": "ABC", priority": "1", "isTopService": "false" } } My idea was use XML source for the datafeed. like for RSS 2.0. I could insert the web-url to obtain the data in json format. But at this point I don't know how to config the datafeed options to read the data correctly. I'm not sure, but I think that I could use the "prepocessing" that allow me to import a xsl file. But i'm not able to identify how this preprocessing file should be written to convert json format to xml. Anyone can help me? thanks
That's a difficult thing to do. Currently, MashZone only supports XSLT 1.0, which has only very rudimentary plain text processing capabilities.
If you're feeling adventurous, you could try to read the JSON input via the CSV operator and use MashZone's text manipulation operators to get a result - this is very error-prone (as this approach depends on the format of the JSON input regarding position of brackets, line breaks and so on), but for the example you provided I achieved some usable content:
Maybe in some future version there could be native JSON support, or at least XSLT 2.0 support. Till then, you have to work around.
If someone manages to write a XSLT 1.0 script that does that work - I'm really looking forward to your solutions!
I found this article
and I create a similar XSLT 1.0 stylesheet
unluckly, the result is always an error.
:-(