Escaping TextGenBuffer Follow
Hi,
I'm currently generating text from a model.
Now i need this text to be embeded in a xml-file.
So I need to escape characters like < " > ' etc.
I wanted to use buffer.getText() then escape everything and write it back to the buffer.
How can I overwrite or clean the buffer?
If that's not working I would have to write to my own Buffer(e.g. a singleton) and then just append that once to the text-gen-buffer. But the problem is, that then I would have to rewrite all the textgens I've already created... Not a nice solution...
Greets.
I'm currently generating text from a model.
Now i need this text to be embeded in a xml-file.
So I need to escape characters like < " > ' etc.
I wanted to use buffer.getText() then escape everything and write it back to the buffer.
How can I overwrite or clean the buffer?
If that's not working I would have to write to my own Buffer(e.g. a singleton) and then just append that once to the text-gen-buffer. But the problem is, that then I would have to rewrite all the textgens I've already created... Not a nice solution...
Greets.
Please sign in to leave a comment.
You can use MPS migration capability to automatically change those text gens already created - see scripts aspect of your language.
This seems a bit more straight forward, cause I dont need no buffer here.