Categories > OpenTBS with ODT >

Apostrophe error

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Nicola
Date: 2017-02-07
Time: 18:01

Apostrophe error

Hi.
I have a template in .odt and everything works fine. But when I add an apostrophe (') I get the error "can't found the end of the tag". I have tried to substitute this with the xml entity ' but in this case the .odt produced has error and it is not possible to open it.
Is there some trick or solution to use apostrophes?
Many thanks.
By: Skrol29
Date: 2017-02-08
Time: 08:04

Re: Apostrophe error


The single quote is a string delimitor for TBS. You can escape the single quote using a second single quote.
Example: [myblock.column;if [val]='it''s true']
By: Nicola
Date: 2017-02-08
Time: 23:42

Re: Apostrophe error

Many thanks.
Escaping the apostrophe with another works, but both are showed in the document.
This is my code put in the template:
[onload; if [var.omnic] = 0; then fornita dall''impianto]

and this is the result:
fornita dall''impianto

I have tried to quote the sentence that I want to show conditionally but I get the quote in the result.
How I can get the sentence with one apostrophe?

Many thanks for your help.
By: Skrol29
Date: 2017-02-17
Time: 08:36

Re: Apostrophe error

The correct syntax is:
[onload; if [var.omnic] = 0; then 'fornita dall''impianto']