I have in my language a group concept and a leaf concept that can appear in the XML output of my generator in multiple positions.
Of course I would like to only once define a model for the XML generator output and reuse it.
So I have a root concept (service) and a XML schema and xmlInternal file model in the generator
service.xml is the xmlInternal file model for the root node, request.xml and requestgroup.xml are the xmlInternal file models for the group or leaf concept (request) correspondingly
I want e.g. in the XML afterwards
So a requestgroup or request can appear in a service or another reuqest group.
My mapping looks like this at the moment:
and I get the <service> XML generated but empty
I try to use $MAP_SRCL$ macro inside the body of the service tag:
but I suppose I'm missing a mapping configuration for Request and RequestGroup. The question now is, it cannot be a root maping rule because Service is the only root concept.
I would have guessed a weaving rule as this would allow to insert the mapped output nodes of request and requestgroup to be inserted into the parent root service node.
But a weaving rule takes a "external template ref" and referencing the request.xml or requestgroup.xml generator models does not seem to be a valid option.
How can i do this?