*I'm not sure that I get what we are trying to achieve with main modules here:*
- Should I create a main module in which I import all library modules so they inherit the output option? - Or should I convert all modules with functions that are not using rest path to main modules so I can declare the output option? - What are other consequences of using main modules? How will I import a main module to make its functions available to other modules?
*My scheme is:*
User comes in with one of:
- http://host:port/menu?id=x in menu.xqm - http://host:port/topic?id=y in topic.xqm
Both menu.xqm and topic.xqm import a module with common functions (contentrefs.xqm) that resolve content references, for example: contentref:fill-with-product-name(content as node(), product as xs:string)
contentref:fill-with-product-name is the one that makes the node replacement (similar to the flower example).
*My 'scheme'-related question is:*
Should contentrefs.xqm really be converted to a main module?