<?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/"
	>

<channel>
	<title>Gabriel Jones &#187; xml</title>
	<atom:link href="http://gabrieljones.com/tag/xml/feed/" rel="self" type="application/rss+xml" />
	<link>http://gabrieljones.com</link>
	<description>Web Developer Weblog</description>
	<lastBuildDate>Fri, 29 Jul 2011 13:27:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Writing Good XHTML</title>
		<link>http://gabrieljones.com/the-perfect-xhtml/</link>
		<comments>http://gabrieljones.com/the-perfect-xhtml/#comments</comments>
		<pubDate>Wed, 23 May 2007 02:29:45 +0000</pubDate>
		<dc:creator>Gabriel</dc:creator>
				<category><![CDATA[html]]></category>
		<category><![CDATA[xhtml]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://gabrieljones.com/?p=14</guid>
		<description><![CDATA[A recent project has forced me to take a closer look at how valid HTML code really is.  My task was to improve performance, validate, and standardize the code.  In later articles I will discuss my research, development, and conclusions to improving the company&#8217;s site performance.  But for now, I am going [...]]]></description>
			<content:encoded><![CDATA[<p>A recent project has forced me to take a closer look at how valid HTML code really is.  My task was to improve performance, validate, and standardize the code.  In later articles I will discuss my research, development, and conclusions to improving the company&#8217;s site performance.  But for now, I am going to focus on how to write the perfect XHTML document.</p>
<p>XHTML is a set of document types that reproduce and extend HTML 4, are XML based, and are designed to work with both XML-based and HTML-based user agents.  That is, XHTML must conform not only to HTML standards, but conform strictly to XML standards as well.</p>
<p>The differences in HTML and XHTML are strict conformity.  A best practice for both standard HTML and XHTML is to conform to one of three DTD&#8217;s, Strict, Transitional, or Frameset, and to declare the DOCTYPE. Which can be written as follows:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&amp;lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&amp;gt;</pre></td></tr></table></div>

<p>The root element of the document <strong>must</strong> be <em>html</em>, and <strong>must</strong> contain the XML namespace (<em>xmlns</em>) declaration.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&amp;lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;&amp;gt;</pre></td></tr></table></div>

<p>According to W3C, its a good idea to have an xml declaration, but it is not required.  I personally leave xml declarations for xml only documents.</p>
<p>As said earlier, the major difference between HTML and XHTML is strict conformity, the documents <strong>must</strong> be well-formed. Elements must be properly nested.</p>
<p><span style="color: green">Correctly</span> nested element:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&amp;lt;p&amp;gt;Lorem ipsum dolor sit amet, &amp;lt;i&amp;gt;consectetuer&amp;lt;/i&amp;gt; adipiscing elit.&amp;lt;/p&amp;gt;</pre></td></tr></table></div>

<p><span style="color: red">Incorrecly</span> nested element:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&amp;lt;p&amp;gt;Lorem ipsum dolor sit amet, &amp;lt;i&amp;gt;consectetuer adipiscing elit.&amp;lt;/p&amp;gt;&amp;lt;/i&amp;gt;</pre></td></tr></table></div>

<p>Because XHTML is interpreted as XML documents, all tags must be lowercase, because XML is case-sensitive. This also pertains to tag attributes as well.  It is best practice to create all markup language in lowercase whenever possible.</p>
<p><span style="color: green">Correct</span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&amp;lt;strong&amp;gt;Hello World&amp;lt;/strong&amp;gt;</pre></td></tr></table></div>

<p><span style="color: red">Incorrect</span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&amp;lt;STRONG&amp;gt;Hello World&amp;lt;/STRONG&amp;gt;</pre></td></tr></table></div>

<p>XML does not allow end tags to be omitted, thus, all non-empty tags <strong>must</strong> be closed.  If an element is empty, it must be properly closed. The only tag that does not close is the DOCTYPE declaration as it is not part of the XHTML document.</p>
<p><span style="color: green">Good</span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&amp;lt;br /&amp;gt;</pre></td></tr></table></div>

<p><span style="color: red">Bad</span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&amp;lt;br&amp;gt;</pre></td></tr></table></div>

<p>All attribute values <strong>must</strong> be contained in quotes and minimized attributes are unsupported.</p>
<p><span style="color: green">Good</span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&amp;lt;input checked=&quot;checked&quot; type=&quot;checkbox&quot; /&amp;gt;</pre></td></tr></table></div>

<p><span style="color: red">Bad</span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&amp;lt;input checked type=checkbox /&amp;gt;</pre></td></tr></table></div>

<p>It is best practice to wrap your script content in CDATA elements to avoid parsing of HTML markup such as <span style="color: green">&lt;</span> and <span style="color: green">&amp;</span>.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;
&amp;lt; ![CDATA[
// script content here
]]&amp;gt;
&amp;lt;/script&amp;gt;</pre></td></tr></table></div>

<p>The <strong>id</strong> attribute is replacing the <strong>name</strong> attribute in future versions of XHTML.  Currently it is best practice to have both named attributes of the same value until future releases of XHTML where then it will be best practice to remove the <strong>name</strong> attribute all together.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&amp;lt;form id=&quot;commentform&quot; name=&quot;commentform&quot; method=&quot;post&quot;&amp;gt;&amp;lt;/form&amp;gt;</pre></td></tr></table></div>

<p>Today it is standard to have alt tags for images, objects, and buttons. However, not all browsers support the alt attribute, so title is used instead.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&amp;lt;img src='image.jpg' title='My Image' /&amp;gt;</pre></td></tr></table></div>

<p>As long as you follow these standards throughout your entire document you will have a valid XHTML document.</p>
]]></content:encoded>
			<wfw:commentRss>http://gabrieljones.com/the-perfect-xhtml/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>JSON or XML</title>
		<link>http://gabrieljones.com/json-or-xml/</link>
		<comments>http://gabrieljones.com/json-or-xml/#comments</comments>
		<pubDate>Wed, 23 Aug 2006 02:04:26 +0000</pubDate>
		<dc:creator>Gabriel</dc:creator>
				<category><![CDATA[json]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://gabrieljones.com/?p=8</guid>
		<description><![CDATA[JSON is a human readable lightweight data-interchange format, and is based on JavaScript, hence the acronym, JavaScript Object Notation.  JSON is totally language independent, but its syntax is loosely based on the C family of languages, so integration with languages such as C, C++, C#, and Java are fairly straightforward.

XML is also human readable, [...]]]></description>
			<content:encoded><![CDATA[<p>JSON is a human readable lightweight data-interchange format, and is based on JavaScript, hence the acronym, JavaScript Object Notation.  JSON is totally language independent, but its syntax is loosely based on the C family of languages, so integration with languages such as C, C++, C#, and Java are fairly straightforward.<br />
<span id="more-8"></span></p>
<p>XML is also human readable, and the most common form of transportation for SOA (service-oriented architecture) and data transfer.  XML is completely platform and language independent.</p>
<p>The advantages to JSON over XML are as follows:</p>
<ul>
<li>Common browsers parse JSON faster than XML.</li>
<li>JSON constructs can be loose interpretations of the server-side language being utilized, ie. Java.</li>
<li>JSON is stable and follows a strict methodology.</li>
</ul>
<p>The advantages to XML over JSON are as follows:</p>
<ul>
<li>Widely more adapted across all languages and platforms.</li>
<li>Calling existing services that use XML as a transport already exist, ie. XML-RPC, SOAP, WSDL</li>
<li>XML can be transformed on the fly with XSLT.</li>
</ul>
<p>JSON libraries have been built for many of the common languages today, including, ActionScript, ColdFusion, Perl, Python, PHP, and the entire C family, including Java.</p>
<p>XML libraries have been built for most all languages. API&#8217;s include, XSLT, XPath, XQuery, and more. And you have a vast amount of open source projects in web development revolving around Ajax, Asynchronous JavaScript and XML, currently the biggest buzz word in the development community.</p>
<p>Future articles will reflect benchmark testing of these two data-transfer models, hopefully demystifying and questions I may have in regards to performance.</p>
]]></content:encoded>
			<wfw:commentRss>http://gabrieljones.com/json-or-xml/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Generate Google Sitemaps</title>
		<link>http://gabrieljones.com/generate-google-sitemaps/</link>
		<comments>http://gabrieljones.com/generate-google-sitemaps/#comments</comments>
		<pubDate>Thu, 23 Jun 2005 01:34:02 +0000</pubDate>
		<dc:creator>Gabriel</dc:creator>
				<category><![CDATA[google]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://gabrieljones.com/?p=4</guid>
		<description><![CDATA[On June 2nd of this year, Google Inc. announced a new service, Google Sitemaps. Following this idea, webmasters now have the ability to create an xml document that maps site URL&#8217;s.  Google will then read the sitemap .xml file on a regular basis, to extract all current content on the site.
The catch is that [...]]]></description>
			<content:encoded><![CDATA[<p>On June 2nd of this year, Google Inc. announced a new service, <a title="Google Sitemaps" href="http://www.google.com/webmasters/sitemaps/docs/en/about.html">Google Sitemaps</a>. Following this idea, webmasters now have the ability to create an xml document that maps site URL&#8217;s.  Google will then read the sitemap .xml file on a regular basis, to extract all current content on the site.</p>
<p>The catch is that you need to generate this .xml file to Googles standard, which is provided in an .XSD file, <a title="XSD" href="http://www.google.com/schemas/sitemap/0.84/sitemap.xsd">here</a>. Once the sitemap .xml file is built, move it to your web server, then go <a title="Sitemaps" href="http://www.google.com/webmasters/sitemaps/">here</a> and submit your sitemap to Google.</p>
<p>If you would wish to just have it generated for you. Go <a title="Sitemap Generator" href="http://www.portalapp.com/google-sitemap.asp">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://gabrieljones.com/generate-google-sitemaps/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

