I beleive XSLT will be a better choice as its faster and suits the requirements, but you may find DOM easier to use/implement your logic.
Journey is as important as the Destination.<br /> <br />PMP, SCJP, SCJD, SCEA (Part 1), SCMAD, SCDJWS
posted 17 years ago
Thanks for the replies. The app will be merging data from different sources, but a requirement is also to be able to choose what elements to include or not in the final document ( some elements are removed if user decides not needed). this is making it more complex, so maybe DOM is the road to go down? I am a novice to XSLT, so how straightforward is it to write a template that can then be applied to other XML documents ( with different elements) to do the merging without making many changes? many thanks for your help
Leverager of our synergies
posted 17 years ago
It may take a while, maybe a month or two, to become comfortable with XSLT's way of thinking. After that, it will be probably easier to solve problems with XSLT then with DOM. However, if your project has to be finished, as usual, yesterday and you do not have this time or you do not plan to use XSLT after this single project, then learning XSLT may be overhead. how straightforward is it to write a template that can then be applied to other XML documents Typically in XSLT stylesheet we specify concrete elements, so writing a generic XSLT is not really straightforward. You can use such patterns as node() - match any element //*[name()=$elementName] - match elements with a name specified in the elementName variable there are a lot of useful recipes on http://www.dpawson.co.uk/xsl/sect2/sect21.html - in case you will decide to use XSLT. a requirement is also to be able to choose what elements to include or not in the final document (some elements are removed if user decides not needed). This will also complicate your XSLT. Not that it is impossible, but there is no way to communicate with a user "from" XSLT at run-time. You can either pass a user choice as a parameter to XSLT stylesheet, or to put it in another XML file (XSLT accepts only XML documents as an input) and make your XSLT read second XML document via document('filename.xml') function.
[This message has been edited by Mapraputa Is (edited August 07, 2001).]