{"id":166,"date":"2004-08-04T13:27:53","date_gmt":"2004-08-04T19:27:53","guid":{"rendered":"http:\/\/www.mooreds.com\/wordpress\/?p=166"},"modified":"2004-08-04T13:27:53","modified_gmt":"2004-08-04T19:27:53","slug":"xml-for-data-transmission","status":"publish","type":"post","link":"https:\/\/www.mooreds.com\/wordpress\/archives\/166","title":{"rendered":"XML for data transmission"},"content":{"rendered":"<p>I was using XML as a file format for a <a href='http:\/\/www.mooreds.com\/weblog\/archives\/000162.html'>recent project<\/a>.  Not a <a href='http:\/\/www.w3.org\/TR\/'>standardized dialect<\/a>, just an ad hoc, custom flavor whipped up to hold the data of particular interest.  Now, I&#8217;ve used many file formats and always thought XML was a bit hyped up.  After all, it&#8217;s bulky and angle brackets can be a bit tedious to wade through.  In addition, parsing it is hard (creating it is difficult too, if you want to do so by creating a DOM tree).  Not too hard, you say.  Well, compare the joy of a <a href='http:\/\/java.sun.com\/j2se\/1.4.2\/docs\/api\/java\/util\/StringTokenizer.html'>StringTokenizer<\/a> parsing a pipe delimited line to the pain of traversing around a <a href='http:\/\/www.w3.org\/TR\/DOM-Level-2-Core\/introduction.html'>DOM<\/a> tree (to say nothing of the &#8220;if&#8221; hell of a <a href='http:\/\/www.saxproject.org\/apidoc\/org\/xml\/sax\/helpers\/DefaultHandler.html'>SAX handler<\/a>).  <\/p>\n<p>However, XML does have strong points.  Storing hierarchical data in XML is easier.  And, as far as I&#8217;m concerned, XML&#8217;s killer feature as a file transport format is its self-documenting nature.  Sure, you can put headers at the top of a pipe delimited file, but it&#8217;s easy enough to forget them.  Omitting the XML tags isn&#8217;t really possible&#8211;you can choose obscure names for the tags that cloud the meaning of the data, but that&#8217;s about the worst you can do.  Using a custom flavor of XML as a data transmission format can be a really good idea; it just means you&#8217;ll have a helper class to do the node traversing contortions everytime you want to read it.  (I&#8217;m purposefully ignoring the technologies like JAX because I haven&#8217;t used them.)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was using XML as a file format for a recent project. Not a standardized dialect, just an ad hoc, custom flavor whipped up to hold the data of particular [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-166","post","type-post","status-publish","format-standard","hentry","category-programming"],"_links":{"self":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/166","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/comments?post=166"}],"version-history":[{"count":0,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/166\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/media?parent=166"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/categories?post=166"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/tags?post=166"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}