Andrea Girotto
Jul 28, 2017 · 1 min read

I understand that mostly of your coding is web-related (as was mine several years ago), so I am surprised that you completely forgot about XML focusing on XSLT and specifically the “flow” XML + XSLT → (X)HTML, XML+ XSLT (Fo) → PDF, PCL… Using XML and XSLT (to generate markup) is so much better than any solution you listed. The transformation can be customized by parameters and the separation of concerns is “deeply respected”. Your solution (of using a compiled/generic language to generate HTML) is not optimal because any time you need to change a minimal part of the HTML or CSS you must rewrite the code. Having used XSLT, only a modification of the xml stylesheet is needed. The transformation can be server side (http://cocoon.apache.org/2.0/userdocs/concepts/) or client side (XSLT is part of HTML5 specification: https://html.spec.whatwg.org/multipage/scripting.html#scriptTagXSLT). This results into the program generating XML that is transformed by XSLT (either server-side or client-side) into HTML and CSS. A “site restyle” leads only to modifications at the XSLT. A new feature that involve a modification of the program and of the generated XML, usually does not break the XSLT.

    Andrea Girotto

    Written by