title: Is it practical to combine XML Schema and an XML-to-JSON conversion?
body: <p>I have to specify a JSON data structure; that data structure will be part of an interface description, the data will be processed by JavaScript. JSON is set for the data transmission. In other projects, where we used XML instead of JSON, I have used rich XML schemas for this. Unfortunately, I cannot do that now.</p>
  
  <p>I did some researching and found <a href="http://json-schema.org/" rel="nofollow noreferrer">JSON Schema</a>. 
  However, this is still draft status, which makes me feel a bit uneasy to use it in this context.</p>
  
  <p>I also came across <a href="https://stackoverflow.com/questions/5113711/convert-xml-to-json-format">this question</a> discussing how to map XML to JSON. There seems to be a standard (?) conversion in the <a href="http://www.json.org/javadoc/org/json/XML.html#toJSONObject%28java.lang.String%29" rel="nofollow noreferrer">XML class</a> in the org.json namespace. It appears that the conversion is rather straight-forward for XML documents without mixed content.</p>
  
  <p>So the idea is to use XML Schema to describe the data structure, use our existing XML processing (editing, transformation, validation, ...) tools as long as possible on the server side and convert the XML DOM to JSON just before delivering the data to the JSON consumer. </p>
  
  <p>Data transmission is one-way only and we would not have mixed-content XML.</p>
  
  <p>Maybe someone has tried this before? Would that be a practical approach in the sense that the the semantics of the XML Schema are still clear enough for the client-side programmers when (conceptually) applied to the JSON document?  Are there any particular pitfalls to be aware of? </p>