
Ask HN: Should I make a new XML template engine? - mttx
Several times over the past few months, I&#x27;ve found myself needing to programatically create XML documents (HTML plus some other flavours).  Before this I hadn&#x27;t rally had too much experience with XML manipulations.<p>I&#x27;ve been using Vue for a while now and it&#x27;s in-element directives for templating logic are just great, but there are no similarly simple templating engines out there.  Everything else requires extra &#x27;stuff&#x27; in the template.<p>I&#x27;ve had a look at vue-template-compiler and it seems that adapting it to my purpose wouldn&#x27;t be too much effort.<p>Is this a good idea? Is there anything else like this out there? Written in javascript? Would you use it?
======
ktpsns
There are plenty of XML template languages, for instance Genshi (for Python;
[http://genshi.edgewall.org/](http://genshi.edgewall.org/) ), which is kind of
an extension to XSL. However, compared to text-only template engines, they are
typically much slower.

If you want to master the complexity problem arising in large templating
projects, you might want to consider logicless template languages instead,
which are at the other end of the scala -- lightweight and fast.

------
flukus
Knowing what sort of data and from what format would be helpful. XML documents
are just text documents though, so you can go from very simple bash scripts,
m4 templates, moustache templates, and many others.

Personally I go for shell scripts (and heredocs) for simple things and awk +
m4 for more complex data driven things. Anything more complicated than that
and fprintf from a real language is better, although less ergonomic.

------
eesmith
Mustache templating language?

