Possible to separate query logic and XML generation?
I have a module that exports relational data as XML.
It is hardcoding tags etc, and my assignment is to rewrite it to use "modern" XML functionality - preferably SQL/XML.
We have other modules that are calling XMLElement etc. directly in queries on the source tables (with lots of complex "business logic" like joins, filters, aggregations...).
This looks like a bad mixing of concerns to me:
- The source (database) and target (XML) schema are both subject to change - independently
- I want to generate several target XMLs from the same query logic
So my question is this: