Kjeld Sigtermans wrote:I assumed high performance to be almost always an obvious requirement. Maybe I should have been more clear and have said: elegant as well as fast. But then again I still don't think the XSLT solution hereabove is elegant... and requirements change all the time.
High performance is not always a requirement. Sometimes you need a quick and dirty program to do something
once. If it takes 10 minutes instead of 10 seconds you don't really care. But you dismissed XSLT as "not fast" just
based on some rumours or vague opinion. That statement qualifies as "premature optimization". I'm willing to bet
(or at least consider the possibility) that the XSLT solution is going to be similar in performance to whatever you put
together in a DOM.
Personally I think that writing an extension of an identity template is far more elegant than writing some DOM code
to implement the rules. But I'm a mathematician so I use the mathematician's definition of "elegant". There is almost
no DOM code which I would consider "elegant".
And yes, you do have to choose whether you want to include XSLT in the set of languages which you want to have
in your environment. If you want to reject it because it's yet another language to learn, then you could certainly do
that (and call it an architectural decision). I find it to be a useful tool myself.