Skip to main content

I would like to use JSONTemplater to build nested text structers making use of the ROOT and SUB TEMPLATES but this are not valid JSON ... its  a Groovy syntax ... Beacause is not a valid JSON format the JSONTemplater gets offended and stops the translation. i cant find a way to skip the JSON validations

I tried disabling validation ,,, but nothing ... any alternatives ?

 

 

0684Q00000ArE3zQAF.png

 

2020-02-21 17:22:01|   2.1|  0.0|WARN  |JSONTemplater(XMLTemplaterFactory): The following error occurred near line 1, column 11 of the query:
2020-02-21 17:22:01|   2.1|  0.0|WARN  |JSONTemplater(XMLTemplaterFactory): invalid expression: syntax error, unexpected ExprSingle (missing comma "," between expressions?)
2020-02-21 17:22:01|   2.1|  0.0|ERROR |JSONTemplater(XMLTemplaterFactory): An error occurred while parsing the ROOT template
2020-02-21 17:22:01|   2.1|  0.0|ERROR |JSONTemplater(XMLTemplaterFactory): A fatal error has occurred. Check the logfile above for details

 

 

Thanks

The error unexpected ExprSingle (missing comma "," between expressions?) suggests that your template is not set up correctly.

 

 

When you have multiple expressions that are not nested, there needs to be a comma between them in the template.

 

 

Without posting your template there's not much we can do to troubleshoot.

The error unexpected ExprSingle (missing comma "," between expressions?) suggests that your template is not set up correctly.

 

 

When you have multiple expressions that are not nested, there needs to be a comma between them in the template.

 

 

Without posting your template there's not much we can do to troubleshoot.

thanks for the answer @jdh , ... in fact its not a valid JSON , im trying to nest some text structures using the capabilities of JSONTemplater ROOT and SUB templates . The text syntax im working with is Groovy and not JSON compatible. So i was hoping i could skip the JSON validation but still writing the result, kind of imagine a TXTTemplater not strict to JSON format.


thanks for the answer @jdh , ... in fact its not a valid JSON , im trying to nest some text structures using the capabilities of JSONTemplater ROOT and SUB templates . The text syntax im working with is Groovy and not JSON compatible. So i was hoping i could skip the JSON validation but still writing the result, kind of imagine a TXTTemplater not strict to JSON format.

The JSONTemplater uses XQuery, you might be able to do that directtly.

Alternatively, use the JSONTemplater to create valid JSON structure and then Groovy's JSONSlurper (or equivalent) to convert to groovy


Thanks , i end up solving my challenge with listbuilders listconcatenators and attributecreators

Thanks


Reply