Skip to main content
Solved

JSONTemplater alternative

  • February 21, 2020
  • 4 replies
  • 65 views

jorge_vidinha
Contributor
Forum|alt.badge.img+2

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

Best answer by jorge_vidinha

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

Thanks

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

4 replies

jdh
Contributor
Forum|alt.badge.img+37
  • Contributor
  • 2002 replies
  • February 21, 2020

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.

jorge_vidinha
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • 30 replies
  • February 21, 2020

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.


jdh
Contributor
Forum|alt.badge.img+37
  • Contributor
  • 2002 replies
  • February 21, 2020

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


jorge_vidinha
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • 30 replies
  • Best Answer
  • February 24, 2020

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

Thanks