Skip to main content
Solved

JSONTemplater alternative

  • February 21, 2020
  • 4 replies
  • 35 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

View original
Did this help you find an answer to your question?

4 replies

jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • 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
  • February 21, 2020
jdh wrote:

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+28
  • Contributor
  • February 21, 2020
jorge_vidinha wrote:

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
  • Best Answer
  • February 24, 2020

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

Thanks


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings