I'm doing some data conversions using FME Workbench through Data Interoperability, and I'm having issues with the JSONTemplater. I am grabbing a field from a json that contains more json, and I want to leave it unaltered as part of my template. the fme:get-attribute XQuery alters the contents, and fme:get-json-attribute returns an error stating that the data does not contain any JSON text when it does.
My template expression:
{
"annotations": fme:get-attribute("annotations"),
"initialStepId": fme:get-attribute("initialStepID"),
"initialStepName": fme:get-attribute("initialStepName"),
"steps":fme:get-attribute("steps"),
"displayGrid": fme:get-attribute("displayGrid")
}
And an example set of data for the annotation field:
"annotations" : [ {
"position":"299, 109, 171, 77",
"text":"This is an annotation."
}
]
Comes out like this with get-attribute...
\"annotations\" : \"[ {
\\\"position\\\":\\\"299, 109, 171, 77\\\",
\\\"text\\\":\\\"This is an annotation.\\\"
}
]\"
but I get this error with get-json-attribute:
diagram_details_2(XMLTemplaterFactory):
The following error occurred while executing the fme:get-json-attribute function:
diagram_details_2(XMLTemplaterFactory): The attribute 'annotations' did not contain valid JSON text
diagram_details_2(XMLTemplaterFactory): A JSON syntax error was found at line 1, column 0
diagram_details_2(XMLTemplaterFactory): The JSON data is incomplete: Unexpectedly encountered the end of JSON data
diagram_details_2(XMLTemplaterFactory): A JSON syntax error was found at line 1, column 0
diagram_details_2(XMLTemplaterFactory): The data does not contain any JSON text
Anyone familiar with the tool able to help out?