A quick and dirty XML generator in JavaScript

June 2nd, 2009

Here’s a quick XML generator (pure-string, no DOM involved) that I originally wrote for converting a jsUnity test result into JSUnit format, but which can serve a more general purpose. Without even bothering to write a new class, I simply extend an Array instance with a few helpers:

Note: I simply did this because using one of the existing HTML templating libraries out there would be an overkill for the task at hand.

Add a Comment