Is it possible to generate plain-old XML using Haml?
Posted
by lsdr
on Stack Overflow
See other posts from Stack Overflow
or by lsdr
Published on 2010-05-10T18:38:07Z
Indexed on
2010/05/10
18:44 UTC
Read the original article
Hit count: 240
I've been working on a piece of software where I need to generate a custom XML file to send back to a client application. The current solutions on Ruby/Rails world for generating XML files are slow, at best. Using builder or event Nokogiri, while have a nice syntax and are maintainable solutions, they consume too much time and processing.
I definetly could go to ERB, which provides a good speed at the expense of building the whole XML by hand.
HAML is a great tool, have a nice and straight-forward syntax and is fairly fast. But I'm struggling to build pure XML files using it. Which makes me wonder, is it possible at all?
Does any one have some pointers to some code or docs showing how to do this, build a full, valid XML from HAML?
© Stack Overflow or respective owner