When "Saving as SVG" in Illustrator, this is the typical result:
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 15.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="841.89px" height="595.28px" viewBox="0 0 841.89 595.28" style="enable-background:new 0 0 841.89 595.28;"
xml:space="preserve">
<g id="symbol1" ... >
<path ... />
<path ... />
<path ... />
</g>
</svg>
I'd like to know if there's any kind of JavaScript templating library (like mustache, handlebars etc.) that would allow me to use SVG in a similar fashion as HTML?
That would allow me to save a bunch of SVG element templates and set their style attributes and content dynamically ...
According to https://groups.google.com/forum/#!topic/d3-js/qVZ7hacBGrE you can use underscore templates.
The forum also discusses an alternative: