<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 3, 2017, at 5:00 AM, Roy Henderson via swift-users &lt;<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Alegreya-Regular; font-size: 15px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">I would welcome guidance regarding whether I should use JSON or XML to store the data on the web server? The effort to generate either format will be similar so my real decision driver is on the client side.</span></div></blockquote></div><br class=""><div class="">Probably JSON. It’s usually a lot easier for clients to parse than XML. If you’re thinking about web clients, JSON is the most natural data format for JavaScript to work with. Another issue is that even generating XML can be a minefield unless you have a solid library to do it for you — I used to work on an RSS/Atom reader, and encountered so many news feeds that generated broken XML due to ignoring subtleties of quoting and name spacing. And parsing broken XML is even more difficult than parsing correct XML, because a regular XML parser is required to reject it entirely.</div><div class=""><br class=""></div><div class="">(But XML does have the advantage of a richer data model, with names to identify different elements, which makes it more self-describing; in JSON you often have to have either an informal schema describing what different objects represent, or explicitly add a property like “type”: to identify an object. This actually helps a lot if you’re parsing to native objects, since you can easily set up a mapping from XML element names to native classes.)</div><div class=""><br class=""></div><div class="">—Jens</div></body></html>