<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
xmlns:rawvoice="http://www.rawvoice.com/rawvoiceRssModule/"
>

<channel>
	<title>Solution Hacker &#187; YAML</title>
	<atom:link href="http://www.solutionhacker.com/tag/yaml/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.solutionhacker.com</link>
	<description>This blog provides solutions for enterpreneurs!</description>
	<lastBuildDate>Sun, 05 Feb 2012 00:45:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=342</generator>
<!-- podcast_generator="Blubrry PowerPress/2.0.4" -->
	<itunes:summary>This blog provides solutions for enterpreneurs!</itunes:summary>
	<itunes:author>Solution Hacker</itunes:author>
	<itunes:explicit>no</itunes:explicit>
	<itunes:image href="http://www.solutionhacker.com/wp-content/plugins/powerpress/itunes_default.jpg" />
	<itunes:subtitle>This blog provides solutions for enterpreneurs!</itunes:subtitle>
	<image>
		<title>Solution Hacker &#187; YAML</title>
		<url>http://www.solutionhacker.com/wp-content/plugins/powerpress/rss_default.jpg</url>
		<link>http://www.solutionhacker.com</link>
	</image>
		<item>
		<title>Data representation</title>
		<link>http://www.solutionhacker.com/implement-your-idea/build-your-website/data-representation/</link>
		<comments>http://www.solutionhacker.com/implement-your-idea/build-your-website/data-representation/#comments</comments>
		<pubDate>Sat, 15 Nov 2008 08:42:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Site Building]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[Serialization]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[XMLHttpRequest]]></category>
		<category><![CDATA[XStream]]></category>
		<category><![CDATA[YAML]]></category>

		<guid isPermaLink="false">http://www.solutionhacker.com/?p=191</guid>
		<description><![CDATA[<p>Data can be represented in <strong>text </strong>format for human and <strong>binary </strong>format for computer. Here my focus will be on text representation.<span style="font-size: 10pt;"><span style=""><br />
</span><br />
</span><u>For application, we commonly use <strong>XML </strong>because:</u></p>
<ol>
    <li>Its <strong>self-documenting</strong> format describes <strong>structure </strong>and <strong>f</strong><strong>ield names </strong>as well as <strong>specific values. </strong>And it is easily digested by both human and machine.</li>
    <li>It is <strong>platform-independent,</strong> thus relatively immune to changes in technology and facilitate in data exchange across heterogeneous systems.</li>
    <li>It supports Unicode.</li>
    <li>It can represent common computer science <strong>data structures</strong>: records, lists and trees.</li>
    <li>It allows <strong>validation </strong>using schema languages such as <strong>DTD </strong>and <strong>XSD. </strong>XSDs are far more powerful than DTDs in describing XML languages. They use a <strong>rich datatyping system</strong>, allow for more detailed constraints on an XML document's logical structure, and must be processed in a more robust validation framework.</li>
</ol>
<p>With all the above advantages, it quickly becomes the standard of data exchange especially in web service world. However, XML also carries its disadvantages like it is <strong>verbose </strong>and the <strong>hierarchical model for representation</strong> is limited in comparison to an <strong>object oriented graph</strong>.</p>
<p><u>Other options:</u></p>
<ol>
    <li>XML vs <strong>JSON </strong>- JSON is now more attractive than XML for kinds of data interchange that powers Web-based mashups and Web gadgets widgets. Why? Look at the articles below:<br />
    <ul>
        <li><a href="http://www.xml.com/pub/a/2005/11/09/fixing-ajax-xmlhttprequest-considered-harmful.html">Fixing AJAX: XMLHttpRequest considered Harmful</a> - <em>You don't see much <strong>AJAX </strong>examples that access third party web services like Amazon, Yahoo and Google. That is because all the newest web browsers impose a significant security restriction on the use of <strong>XMLHttpRequest</strong>. That restriction is that you aren't allowed to make XMLHttpRequest to any server except the server where your web page came from. If you attempt to do so, XMLHttpRequest will either fail or pop up warnings, depending on the browser you are using... Solution: </em><strong><em>Application Proxy, Apache Proxy or Use Script Tag Hack (On-demand Javascript).</em></strong></li>
        <li><a href="http://www.25hoursaday.com/weblog/PermaLink.aspx?guid=060ca7c3-b03f-41aa-937b-c8cba5b7f986">JSON vs XML: Browser Security Model</a> - <em>This article comments the solutions proposed above. It indicated that Script Tag approach is better than proxy.</em></li>
        <li><a href="http://simonwillison.net/2005/Dec/16/json/">JSON and Yahoo!'s Javascript API</a><em> - This article will give you example of how to use Script Tag to communicate with Yahoo Web service API and bypass the restriction of XMLHttpRequest. The way to bypass XHR restriction is not using XHR at all. </em><em>The cross-site requests are made by adding script tags to a document's HEAD <em>with DOM methods</em> (i.e. <code>.appendChild()</code>)</em></li>
        <li><a href="http://www.nczonline.net/archive/2008/1/534">Is JSON better than XML</a> (a good objective review)</li>
        <li>In conclusion, JSON enables you to use Script Tag approach to bypass XHR security restriction b/c JSON itself is part of Javasript. That makes JSON popular.</li>
    </ul>
    </li>
    <li><strong>YAML </strong>as an alternative of data serialization</li>
    <li><strong>Java Serialization </strong>will take object to binary representation (versioning headache). <strong>XStream </strong>is a simple library to serialize objects to XML and back again.</li>
</ol>
<p><u>For machine, data is represented in binary format:</u></p>
<ol>
    <li><a href="http://webster.cs.ucr.edu/AoA/DOS/pdf/">The art of assembly language </a>(a free book that you can read online)</li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Data can be represented in <strong>text </strong>format for human and <strong>binary </strong>format for computer. Here my focus will be on text representation.<span style="font-size: 10pt;"><span style=""><br />
</span><br />
</span><u>For application, we commonly use <strong>XML </strong>because:</u></p>
<ol>
<li>Its <strong>self-documenting</strong> format describes <strong>structure </strong>and <strong>f</strong><strong>ield names </strong>as well as <strong>specific values. </strong>And it is easily digested by both human and machine.</li>
<li>It is <strong>platform-independent,</strong> thus relatively immune to changes in technology and facilitate in data exchange across heterogeneous systems.</li>
<li>It supports Unicode.</li>
<li>It can represent common computer science <strong>data structures</strong>: records, lists and trees.</li>
<li>It allows <strong>validation </strong>using schema languages such as <strong>DTD </strong>and <strong>XSD. </strong>XSDs are far more powerful than DTDs in describing XML languages. They use a <strong>rich datatyping system</strong>, allow for more detailed constraints on an XML document&#8217;s logical structure, and must be processed in a more robust validation framework.</li>
</ol>
<p>With all the above advantages, it quickly becomes the standard of data exchange especially in web service world. However, XML also carries its disadvantages like it is <strong>verbose </strong>and the <strong>hierarchical model for representation</strong> is limited in comparison to an <strong>object oriented graph</strong>.</p>
<p><u>Other options:</u></p>
<ol>
<li>XML vs <strong>JSON </strong>- JSON is now more attractive than XML for kinds of data interchange that powers Web-based mashups and Web gadgets widgets. Why? Look at the articles below:
<ul>
<li><a href="http://www.xml.com/pub/a/2005/11/09/fixing-ajax-xmlhttprequest-considered-harmful.html">Fixing AJAX: XMLHttpRequest considered Harmful</a> &#8211; <em>You don&#8217;t see much <strong>AJAX </strong>examples that access third party web services like Amazon, Yahoo and Google. That is because all the newest web browsers impose a significant security restriction on the use of <strong>XMLHttpRequest</strong>. That restriction is that you aren&#8217;t allowed to make XMLHttpRequest to any server except the server where your web page came from. If you attempt to do so, XMLHttpRequest will either fail or pop up warnings, depending on the browser you are using&#8230; Solution: </em><strong><em>Application Proxy, Apache Proxy or Use Script Tag Hack (On-demand Javascript).</em></strong></li>
<li><a href="http://www.25hoursaday.com/weblog/PermaLink.aspx?guid=060ca7c3-b03f-41aa-937b-c8cba5b7f986">JSON vs XML: Browser Security Model</a> &#8211; <em>This article comments the solutions proposed above. It indicated that Script Tag approach is better than proxy.</em></li>
<li><a href="http://simonwillison.net/2005/Dec/16/json/">JSON and Yahoo!&#8217;s Javascript API</a><em> &#8211; This article will give you example of how to use Script Tag to communicate with Yahoo Web service API and bypass the restriction of XMLHttpRequest. The way to bypass XHR restriction is not using XHR at all. </em><em>The cross-site requests are made by adding script tags to a document&#8217;s HEAD <em>with DOM methods</em> (i.e. [code]]czoxNDpcIi5hcHBlbmRDaGlsZCgpXCI7e1smKiZdfQ==[[/code])</em></li>
<li><a href="http://www.nczonline.net/archive/2008/1/534">Is JSON better than XML</a> (a good objective review)</li>
<li>In conclusion, JSON enables you to use Script Tag approach to bypass XHR security restriction b/c JSON itself is part of Javasript. That makes JSON popular.</li>
</ul>
</li>
<li><strong>YAML </strong>as an alternative of data serialization</li>
<li><strong>Java Serialization </strong>will take object to binary representation (versioning headache). <strong>XStream </strong>is a simple library to serialize objects to XML and back again.</li>
</ol>
<p><u>For machine, data is represented in binary format:</u></p>
<ol>
<li><a href="http://webster.cs.ucr.edu/AoA/DOS/pdf/">The art of assembly language </a>(a free book that you can read online)</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.solutionhacker.com/implement-your-idea/build-your-website/data-representation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

