title: SVG serialization
body: <p>I have RaphaelJS based canvas, where user can do some work.  I need to do 2 things:</p>
  
  <ol>
  <li>Save users work into database</li>
  <li>Rastersize SVG (I use Apache Batik for that task)</li>
  </ol>
  
  <p>For 1 <a href="https://github.com/jspies/raphael.serialize" rel="nofollow">https://github.com/jspies/raphael.serialize</a> dumps Raphael's canvas to json, then jQuery.getJSON() to send it to the backend, where I need to convert it back to SVG to feed into Batik.</p>
  
  <p>Does this flow seem reasonable?  SVG -> JSON -> SVG conversion seems a bit overhead, is there a better way to do this?</p>
  
  <p>Backend runs python/django.  I use standard json package for JSON -> SVG, but sometimes it fails with syntax errors in the incoming json (mainly in font style properties).  Did anyone face these issues?</p>
  
  <p>What's the best way to store this data in the database? Just as a string?</p>