title: Embedded Parser Memory Use XML vs JSON vs?
body: <p>I have an embedded weberver which is currently used to administer various bits of hardware over a network.</p>
  
  <p>Currently it has a browser type web interface, but I need to enhance it to provide a REST API so that its functions can be automated and the obvious choice would be to use XML or JSON. </p>
  
  <p>The device only has 8MB of RAM and 4MB of flash so code size and memory usage are critical.</p>
  
  <p>The obvious choices are JSON and XML for the interface and I would be interested to know which you think would be the most efficient approach (or something else) and best library. (It's coded in C)</p>
  
  <p>An additional constraint I should mention is that whatever I spec I will be documenting and providing to customers to build against so human readable is better.</p>
  
  <p>This is the JSON library I've been looking at: <a href="http://zserge.bitbucket.org/jsmn.html" rel="nofollow">http://zserge.bitbucket.org/jsmn.html</a></p>
  
  <p>and this is the XML: <a href="http://expat.sourceforge.net/" rel="nofollow">http://expat.sourceforge.net/</a></p>