SHS` wrote:even a simple XSL for transforming Atom or RSS2 into XHTML is quite "eep":
Hey, this code is so cluttered because its idea is cluttered. It tries to transform from two, different file formats in only one template - this is not simple. The obvious way of getting this done is to make 2 separate templates...
Using XSLT as templating engine wouldn't be so intricate. Just replace
- Code: Select all
<!-- BEGIN foo -->
with
- Code: Select all
<x:template match="foo">
Due to recurrent, functional nature of XSLT, in many cases you can even reduce the complexity of templates by splitting them into smaller, reusable ones. Componentization is possible.
But even if you still claim XSLT is hard to learn or use - this standard is widely supported by many development environments, giving you ability to make templates easily. Even in WYSIWYG mode. Can you say so about phpBB's native templating syntax? Is it supported by whaterer?
Next adventage is security. HTML injection, XSS? No way.
Also - language packs would be just XML files, not dangerous PHP code.
You can't produce mal-formed output.
If client supports XSLT, processing transformation can be delegated to him, reducing server load.
The only one real disadventage I can see is performance of generating input. It must be DOM, which is probably slower than PHP associative arrays
