I have defined a language with editor and everything works fine so far. But I'm completely stuck with the generation part.
If one would like to generate XML from a syntax tree, there are various ways as I understood:
1. using the jetbrains.mps.sampleXml
2. using the jetbrains.mps.xml language which somehow uses jetbrains.mps.gtext for generation
3. maybe also with jetbrains.mps.xmlInternal ?
Now 2. using the xml language seems to be the best and obvious way or not?
Unfortunately this is quasi undocumented and there is no sample or explanation whatsoever for this way. Would it be possible to get a sample/demo or tutorial for generating XML this way at some point in time? I think this would help a lot of MPS-users because MPS is a really cool tool but it is extremely difficult to find out how to do certain things right if one does not generate Java code.
Now for 2., what I see is that one needs to define a XML schema as part of the generator and then try to map the original language onto this schema, or?
Here are the first problems, this xmlSchema language should somehow allow to define a element of type xsd:string but element in a complexType that I define only allows to specify a complexType again, how can I then define a element "description" of type xsd:string?
Second, I did not understand how I then can generate a XML document from a instance of my language then? Somehow I need to use a template or a xmlInternal xmlFile or how is this supposed to work then? Even if I would have a XML AST then, how would I then further generate the text using gtext language etc.???
Please provide some insight and guidance for this problem space!