I think I'm familiar with the issue. I had a simliar issue when migrating my first Genero app over 10 years ago. We had it with both Toolbar and Topmenu, but it is easier to visualise with TopMenu. All our TopMenu's we wanted to have the same entries underneath File,Edit on the left hand side, and Help on the right hand side, what varied between style of program was the entries in the middle. Being good programmers we didn't want to repeat code so we had a left.4tm with File, Edit entries, and a right.4tm with Help entries, and each style of program having their own .4tm for the middle entries. So at runtime we had 3 .4tm files to deal with. The solution in our first version would take the 3 .4tm files, and combine them into 1 .4tm that was then loaded by the loadTopMenu method. The solution in a later version of the app was to do this merging and loading in memory using DOM tree manipulation rather than outputting an intermediate file.
I am not able to merge the two files 4tb due to the limitations of the libraries manipulation of XML files.
FUNCTION join_xml()
DEFINE domDoc1, domDoc2 om.DomDocument
DEFINE node1, node2 om.DomNode
LET domDoc1 = om.DomDocument.createFromXmlFile("./toolbar1.4tb")
LET domDoc2 = om.DomDocument.createFromXmlFile("./toolbar2.4tb")
LET node1 = domDoc1.getDocumentElement()
LET node2 = domDoc2.getDocumentElement()
...
END FUNCTION
I'm stuck at this point because in each of these 4tb files the root node is <ToolBar> and the file that I should produce, should contain two main nodes <ToolBar> but with the DOMDocument class I can't save the whole document as I can only do this with the class DomNode, which saves only ONE node <ToolBar>. I can't come out by processing the file with genero xml classes following your advice, so for the moment I chose to manually create and load a third file that brings together both the toolbar but I know that it is not the best practice, perhaps the worst I'd say.