<?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>Web Cash &#187; standards</title>
	<atom:link href="http://www.earn-web-cash.com/tag/standards/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.earn-web-cash.com</link>
	<description>Writing, Designing, and Making Money Online</description>
	<lastBuildDate>Sun, 04 Dec 2011 22:52:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
		<item>
		<title>Flash Movies: Standards Compliant Embedding</title>
		<link>http://www.earn-web-cash.com/2008/03/18/flash-movies-standards-compliant-embedding/</link>
		<comments>http://www.earn-web-cash.com/2008/03/18/flash-movies-standards-compliant-embedding/#comments</comments>
		<pubDate>Tue, 18 Mar 2008 22:27:13 +0000</pubDate>
		<dc:creator>Walkere</dc:creator>
				<category><![CDATA[HTML Tutorials]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[slideshow]]></category>
		<category><![CDATA[standards]]></category>
		<category><![CDATA[widget]]></category>

		<guid isPermaLink="false">http://www.earn-web-cash.com/2008/03/18/flash-movies-standards-compliant-embedding/</guid>
		<description><![CDATA[The other day, I was looking into using Picasa to create an image album and embed it as a slideshow on a website. Uploading the images and creating the album was easy. However, I noticed that the code Google creates to embed the slideshow (a flash file) is not standards compliant &#8211; it uses the [...]]]></description>
			<content:encoded><![CDATA[<p>The other day, I was looking into using Picasa to create an image album and embed it as a slideshow on a website.</p>
<p>Uploading the images and creating the album was easy.  However, I noticed that the code Google creates to embed the slideshow (a flash file) is not standards compliant &#8211; it uses the <code>&lt;embed&gt;</code> tag.</p>
<p>How can we convert this code to a standards compliant version?<br />
<span id="more-178"></span></p>
<h4>The Original Picasa Embed Code</h4>
<p>The code that Google generates to embed the flash file uses the embed element.  The embed tag includes all of the pertinent information &#8211; the swf file, the height, the width, and the parameters.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;embed <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;application/x-shockwave-flash&quot;</span></span>
<span style="color: #009900;">  <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://picasaweb.google.com/s/c/bin/slideshow.swf&quot;</span></span>
<span style="color: #009900;">  <span style="color: #000066;">width</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;288&quot;</span> <span style="color: #000066;">height</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;192&quot;</span></span>
<span style="color: #009900;">  flashvars<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;host=picasaweb.google.com&amp;RGB=0x000000&amp;feed=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2Fslowwalkere%2Falbumid%2F5178325186511467969%3Fkind%3Dphoto%26alt%3Drss&quot;</span></span>
<span style="color: #009900;">  pluginspage<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.macromedia.com/go/getflashplayer&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>embed&gt;</span></pre></div></div>

<p>The problem here is that the code uses the embed tag.  This is no longer recognized as a valid html element &#8211; although it still functions in most browsers.</p>
<h4>Converting Embed to Object</h4>
<p>We can, however, convert this embed element into an object element.  The object element <strong>is</strong> standards compliant, and <a href="http://www.alistapart.com/articles/flashsatay">with a few parameters</a> it is compatible across most browsers.</p>
<p>To do this, let&#8217;s identify the information that we&#8217;ll need from the original Picasa code.</p>
<p>Obviously, we&#8217;ll need the flash file.  This is the value of the &#8220;src=&#8221; attribute.  We&#8217;ll also need the height and width, which are pretty obvious.  Finally, we&#8217;ll need the parameters to be passed to the flash movie &#8211; located in the flashvars parameter.</p>
<p>Here&#8217;s what an object element might look like to display a flash movie.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">object</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;application/x-shockwave-flash&quot;</span></span>
<span style="color: #009900;">  <span style="color: #000066;">data</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;flash-file.swf&quot;</span> <span style="color: #000066;">height</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;400&quot;</span> <span style="color: #000066;">width</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;400&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">param</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;movie&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;flash-file.swf&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">object</span>&gt;</span></pre></div></div>

<p>We create the object and give it the attribute <code>type="application/x-shockwave-flash"</code>.  This tells the browser it is a flash movie.</p>
<p>We pass the name of the flash file with the data attribute and the &#8220;movie&#8221; param element &#8211; notice that the filename is passed twice here.</p>
<p>Finally, we pass the height and width parameters as attributes to the object element.</p>
<h4>Filling Out the Object</h4>
<p>Now we can take the values provided for us by Google and create a new, valid object to display the flash slideshow.</p>
<p>The only extra thing we need to know is that we can send another param element &#8211; name=&#8221;flashVars&#8221; &#8211; to contain the flash parameters.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">object</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;application/x-shockwave-flash&quot;</span></span>
<span style="color: #009900;">  <span style="color: #000066;">data</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://picasaweb.google.com/s/c/bin/slideshow.swf&quot;</span></span>
<span style="color: #009900;">  <span style="color: #000066;">width</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;288&quot;</span> <span style="color: #000066;">height</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;192&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">param</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;movie&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://picasaweb.google.com/s/c/bin/slideshow.swf&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">param</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;flashVars&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;host=picasaweb.google.com&amp;amp;RGB=0x000000&amp;amp;feed=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2Fslowwalkere%2Falbumid%2F5178325186511467969%3Fkind%3Dphoto%26alt%3Drss&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">object</span>&gt;</span></pre></div></div>

<p>This should do the trick and display our Flash slideshow in a standards compliant way.  You should also be able to apply this to any other widget that displays a flash movie.</p>
<p>Also, here are two minor things to keep in mind.</p>
<p>The param elements are self closing &#8211; i.e. <code>&lt;param /&gt;</code>.  The param element doesn&#8217;t contain any text, so it must be self closing to be standards compliant.</p>
<p>The flashVars value is constructed as a query string.  It utilizes ampersands (&amp;) to separate key/value pairs.  Ampersands are a standards no-no &#8211; they should be escaped as an html entity (<code>&amp;amp;</code>).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.earn-web-cash.com/2008/03/18/flash-movies-standards-compliant-embedding/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Tips to Ensure Your XML RSS Feed is Valid</title>
		<link>http://www.earn-web-cash.com/2008/03/15/valid-xml-rss-feed/</link>
		<comments>http://www.earn-web-cash.com/2008/03/15/valid-xml-rss-feed/#comments</comments>
		<pubDate>Sat, 15 Mar 2008 14:01:06 +0000</pubDate>
		<dc:creator>Walkere</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Feed]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[simplexml]]></category>
		<category><![CDATA[standards]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.earn-web-cash.com/2008/03/15/valid-xml-rss-feed/</guid>
		<description><![CDATA[Last month, I wrote on article on creating an RSS feed for your site. Some people have reported problems with the process &#8211; but these all come from malformed XML, not the PHP code supplied in the article. There are a few things you need to keep in mind while writing an XML document, or [...]]]></description>
			<content:encoded><![CDATA[<p>Last month, I wrote on article on <a href="http://www.earn-web-cash.com/2008/02/14/create-rss-feed-php/">creating an RSS feed for your site</a>.  Some people have reported problems with the process &#8211; but these all come from malformed XML, not the PHP code supplied in the article.</p>
<p>There are a few things you <strong>need</strong> to keep in mind while writing an XML document, or else the RSS reader will not be able to understand it.  It&#8217;s better to <a href="http://hsivonen.iki.fi/producing-xml/">think of writing XML as writing code than text</a>, because there are some strict syntax rules you need to adhere to.<br />
<span id="more-177"></span></p>
<h4>Balance Opening and Closing Tags</h4>
<p>One strict syntax rule of XML is that opening and closing tags must be balanced.  For every opening tag, there must be a closing tag.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;item<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/item<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;item<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;description<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/item<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>In this example, the first item element is invalid &#8211; because description has no closing tag.  The second example is valid, because description is closed.  You could also use a self-closing tag if description doesn&#8217;t contain a value.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;item<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;description</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/item<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>With a simple feed, it can be easy enough to keep tags balanced.  However, it&#8217;s a good idea to look into <a href="http://www.earn-web-cash.com/2008/02/21/create-rss-feed-simplexml/">using an XML parser like SimpleXML to build the feed</a>.  This ensures that the tags are balanced and that the XML is well-formed.</p>
<h4>Ampersands Are Not Allowed</h4>
<p>The lovely ampersand &#8211; &amp; &#8211; is not allowed to appear in an XML document without being escaped (<code>&amp;amp;</code>).</p>
<p>If a browser or feed reader encounters an ampersand that isn&#8217;t escaped and that isn&#8217;t being used to form a valid entity, the application will simply stop reading.  You might overlook this possible problem if your URLs use query strings &#8211; and thus have ampersands inside them.</p>
<p>The solution is to escape all of the URLs and data that is going into your feed.  The reader will convert <code>&amp;amp;</code> back into &amp; so that your links work correctly.  PHP offers a function to help you do that.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$escapedText</span> <span style="color: #339933;">=</span> <span style="color: #990000;">htmlentities</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$unescapedText</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Pass all of the text that needs to be escaped (like your URLs) through the htmlentities function, and your problems will be solved.  Incidentally, this will also escape &gt; and &lt; characters.</p>
<h4>No Non-Breaking Spaces!</h4>
<p>The final tip deals with invalid entities, like <code>&amp;nbsp;</code>.  As mentioned before, ampersands are a strict no-no.  They can be used to form entity codes, but they cannot be used by themselves.</p>
<p>If you attempt to create an entity that the XML processor doesn&#8217;t recognize, it won&#8217;t read it as an entity &#8211; it will read it as an ampersand with some text following.  For example, <code>&amp;bob;</code> would be read by an XML processor as an ampersand and the word &#8220;bob;&#8221;.</p>
<p>It would then promptly stop processing your feed.</p>
<p>One common way for this to break your feed is the non-breaking space character &#8211; <code>&amp;nbsp;</code>.  These often serve no purpose in the document, but you might get them littered around your source code if you use a WYSIWYG editor.</p>
<p>You could get rid of these by filtering your output through a function that does a str_replace of <code>&amp;nbsp;</code> with &#8216; &#8216;.</p>
<p>If the non-breaking space character serves a purpose in your document, you can preserve it for the browser but make the XML processor ignore it.  This is where CDATA comes in.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><span style="color: #339933;">&lt;![CDATA[This is a description with content that</span>
<span style="color: #339933;">&lt;strong&gt;shouldn't&lt;/strong&gt; be interpeted</span>
<span style="color: #339933;">by the &amp;nbsp; XML processor.]]&gt;</span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>When you wrap text inside that tag &#8211; <code>&lt;![CDATA[</code> and <code>]]&gt;</code> &#8211; you tell the processor to ignore the text and spit it out as is.  This can help your non-breaking space character make it to the user.  You may also want to use this if your descriptions and content include HTML tags.</p>
<h4>Browse the Spec</h4>
<p>These are a couple of tips to help you address some of the more common things that will break your XML documents.</p>
<p>However, there are many other minor errors you can come across.  The only way to learn about them and solve them is through two things &#8211; research and trial and error.</p>
<p>You may want to take some time to browse the <a href="http://www.xml.com/axml/testaxml.htm">XML specification</a> as well as read forums for problems that other people have.  Then, test things out and find out what doesn&#8217;t work.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.earn-web-cash.com/2008/03/15/valid-xml-rss-feed/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

