Hello!
Does it make sense to use XSLT to generate the XHTML or HTML5 output in a template, that already uses an engine (Smarty)?
It should be less data to transfer, but it would meat to give up all advantages of the template engine.
Hello!
Does it make sense to use XSLT to generate the XHTML or HTML5 output in a template, that already uses an engine (Smarty)?
It should be less data to transfer, but it would meat to give up all advantages of the template engine.
Using XSLT instead of Smarty doesn’t always mean less data to transfer. Infact, arguably, for simpler templates, Smarty templates are likely to be smaller in many cases. And as for the “data to transfer”, that depends entirely on the output of each, which you have great control over in either way.
However, if you use XML as a data store, using XSLT is likely going to be more efficient (though not because of “less data to transfer”) because with Smarty, you’d have to manually map each XML node into a variable, and then the variable to Smarty, while in XSLT, you map the node to its output.
Anything you may want to do with Smarty, you can do with XSLT by setting parameters for it. You’d generate the parameters with plain PHP code.