This is more a design question than anything else I guess. Here is the scenario:
SOAP template < header template < custom content xml template
I have several content xml files. There is only one header template and only one SOAP template. This part of the design I cannot change. I wish I could, but I can't.
The SOAP template and template wrapper will be appended with XSL.
So I have
java objects that represent the data that needs to be transformed to the content xml. To make matters worse, the company could very well be changing the xml format in the future. So it seams to me that this is a good place to draw a line in the code to separate presentation and content. Am I doing ok or am I way off here?
The real question here is how do I get the data in an xml format? The first thing I thought of was DOM builder. But the XML format could change. It would sure be nice to use XSL for that so if they changed the xml format I would not have to change DOM code. But XSL is for transforming XML, not the java objects I have. So now I am stuck. Here are a couple of ideas I have had:
1. Just use DOM to generate my own proprietary XML that is then transformed with XSL into whatever the latest standard is at the time.
2. Have a blank XML file and transform it passing parameters to the XSL (this is nice because it skips the overhead of building the original proprietary xml, which will become trash the moment I have the result from the XSL...)
3. Do what everybody else here is doing and build the xml with a StringBuffer append().append.().append()... and duplicate the code whenever you need it...

not!
Any thoughts?