How to text gen from language A via language B?
I'm attempting to write a text editor around a few concepts. I want to generate HTML from it, so I defined an additional language, 'Xml', which contains two basic entities – Tag and Attribute.
The idea is that I use a concept from my original language (e.g., Paragraph), I transform it into the Xml language's Tag element, and then use the text gen from that to output the resulting HTML.
My question: how do I actually do it? I have added the Xml language to the original language's imports, but I see no ability to actually use this language in the textGen portion of the language. Am I missing something?
The idea is that I use a concept from my original language (e.g., Paragraph), I transform it into the Xml language's Tag element, and then use the text gen from that to output the resulting HTML.
My question: how do I actually do it? I have added the Xml language to the original language's imports, but I see no ability to actually use this language in the textGen portion of the language. Am I missing something?
Please sign in to leave a comment.
One slight annoyance is that the j.m.core.xml language hardcodes the file extension to "xml". Of course, many XML format documents do not use the .xml extension, e.g. xhtml in your case. The workaround is pretty straightforward, but a little clunky IMO - I can send you an example if you need it. I'm actually working on a patch to fix this problem which I will submit soon (tried to do it last night, but the master branch was broken so I need to wait for a clean build). Hopefully it will get approved and merged into the main codebase before the 3.0 release, as it's fairly trivial.