<?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>Ben HusonBen Huson &raquo; &#187; XML &amp; RSS</title>
	<atom:link href="http://www.benhuson.co.uk/category/web_developer/xml_rss/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.benhuson.co.uk</link>
	<description>Web Designer and Developer</description>
	<lastBuildDate>Tue, 20 Jul 2010 21:03:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Mac OS X SOAP Client &#8211; Fixed for Leopard</title>
		<link>http://www.benhuson.co.uk/2009/10/28/mac-os-x-soap-client-fixed-for-leopard/</link>
		<comments>http://www.benhuson.co.uk/2009/10/28/mac-os-x-soap-client-fixed-for-leopard/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 23:28:36 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[XML & RSS]]></category>
		<category><![CDATA[Applications]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Web Services]]></category>
		<category><![CDATA[WSDL]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.benhuson.co.uk/?p=1157</guid>
		<description><![CDATA[Upgraded to OS X Snow Leopard, Yeah&#8230; Mac OS X SOAP Client not working, boo&#8230; Mac OS X SOAP Client is a great little app which can be used to access and query XML Web Services. I was very disappointed that after upgrading to Snow Leopard the XML result preview tab kept crashing the application. [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Upgraded to OS X Snow Leopard, Yeah&#8230;<br />
Mac OS X SOAP Client not working, boo&#8230;</strong><br />
<img class="size-full wp-image-1159 alignright" title="Mac SOAP Client" src="http://www.benhuson.co.uk/wp-content/uploads/mac-soap-client-logo.gif" alt="Mac SOAP Client" width="150" height="150" /><br />
Mac OS X <a href="http://ditchnet.org/soapclient">SOAP Client</a> is a great little app which can be used to access and query XML Web Services. I was very disappointed that after upgrading to Snow Leopard the XML result preview tab kept crashing the application.</p>
<p>Fortunately the application is now an open source project available on <a href="http://code.google.com/p/mac-soapclient/">Google Code</a> and it was only a short matter of time before <a href="http://code.google.com/p/mac-soapclient/issues/detail?id=15">someone came up with a fix</a> &#8211; thank you Howard.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benhuson.co.uk/2009/10/28/mac-os-x-soap-client-fixed-for-leopard/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Integrating Google XML Sitemaps with Your WordPress Plugin</title>
		<link>http://www.benhuson.co.uk/2009/07/12/integrate-google-xml-sitemaps/</link>
		<comments>http://www.benhuson.co.uk/2009/07/12/integrate-google-xml-sitemaps/#comments</comments>
		<pubDate>Sun, 12 Jul 2009 19:22:50 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[SEO]]></category>
		<category><![CDATA[Web Developer]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[XML & RSS]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[WP e-Commerce]]></category>
		<category><![CDATA[XML Sitemaps]]></category>

		<guid isPermaLink="false">http://www.benhuson.co.uk/?p=822</guid>
		<description><![CDATA[Note: Please read my more recent post about Integrating Google XML Sitemaps with the latest version of WP e-Commerce using a plugin by Lee Willis. One plugin I recommend that everyone should add to their WordPress installation is the Google XML Sitemaps plugin. This plugin will automatically generate an XML sitemap of your posts and [...]]]></description>
			<content:encoded><![CDATA[<p><div class="note"><div class="noteclassic"><strong>Note:</strong> Please read my more recent post about <a href="http://www.benhuson.co.uk/2009/11/28/wp-e-commerce-xml-sitemap-wordpress-plugin/">Integrating Google XML Sitemaps</a> with the latest version of WP e-Commerce using a <a href="http://www.leewillis.co.uk/wordpress-plugins/">plugin by Lee Willis</a>.</div></div></p>
<p><strong>One plugin I recommend that everyone should add to their WordPress installation is the </strong><a href="http://wordpress.org/extend/plugins/google-sitemap-generator/"><strong>Google XML Sitemaps plugin</strong></a><strong>. </strong></p>
<p>This plugin will automatically generate an <a href="http://www.sitemaps.org/">XML sitemap</a> of your posts and pages and ping supporting search engines to notify them that the sitemap has been updated.</p>
<p>But the best thing about this plugin for other plugin developers is it provides hooks so you can &#8216;borrow&#8217; it&#8217;s functionality so that your plugin can add additional pages into the XML sitemap that is generated.</p>
<p>So if you&#8217;re a WordPress plugin developer, read on&#8230;</p>
<p><span id="more-822"></span></p>
<h3>How to add pages to the XML sitemap</h3>
<p>To illustrate how to implement the XML Sitemaps hook, I will base the example on the <a href="http://www.instinct.co.nz/3-7-1-feature-prioritization/trackback/">WP e-Commerce plugin</a> (please note, I originally implemeted this with version 3.6.12 of the WP e-Commerce plugin so it may not work with more recent versions). We will create a function that will add all of this plugin&#8217;s product pages into the XML sitemap produced by Google XML Sitemaps.</p>
<p>The Google XML Sitemaps plugin provides the hook &#8220;sm_buildmap&#8221; which gets triggered whenever the plugin re-builds the sitemap file. We are going to create a function &#8220;wp_ecommerce_sm&#8221; which will get called by this hook.</p>
<p>So, here&#8217;s the function code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> wp_ecommerce_sm<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">;</span>
   <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">class_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'GoogleSitemapGenerator'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$generatorObject</span> <span style="color: #339933;">=</span> <span style="color: #339933;">&amp;</span>GoogleSitemapGenerator<span style="color: #339933;">::</span><span style="color: #004000;">GetInstance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT DISTINCT * FROM `&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">prefix</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;product_list` WHERE `active` IN('1') ORDER BY `id` DESC&quot;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$product_list</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_results</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #339933;">,</span> ARRAY_A<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$product_list</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$product</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
         <span style="color: #000088;">$purchase_link</span> <span style="color: #339933;">=</span> wpsc_product_url<span style="color: #009900;">&#40;</span><span style="color: #000088;">$product</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
         <span style="color: #000088;">$purchase_link</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&amp;amp;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&amp;'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$purchase_link</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
         <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$generatorObject</span> <span style="color: #339933;">!=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$generatorObject</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">AddUrl</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$purchase_link</span><span style="color: #339933;">,</span> <span style="color: #990000;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;daily&quot;</span><span style="color: #339933;">,</span> <span style="color:#800080;">0.5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;sm_buildmap&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;wp_ecommerce_sm&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h3>The main points to note in this function are&#8230;</h3>
<p>Check that the Google XML Sitemaps exists (is installed):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">class_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'GoogleSitemapGenerator'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></pre></td></tr></table></div>

<p>Get an instance of the Google XML Sitemap plugin:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>4
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$generatorObject</span> <span style="color: #339933;">=</span> <span style="color: #339933;">&amp;</span>GoogleSitemapGenerator<span style="color: #339933;">::</span><span style="color: #004000;">GetInstance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Loop through all our additional pages that we want to add to the sitemap, in this case the WP e-Commerce product pages:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>5
6
7
8
9
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT DISTINCT * FROM `&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">prefix</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;product_list` WHERE `active` IN('1') ORDER BY `id` DESC&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$product_list</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_results</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #339933;">,</span> ARRAY_A<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$product_list</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$product</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #666666; font-style: italic;">// Add pages to sitemap here</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>And within our loop, add our pages like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>10
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$generatorObject</span> <span style="color: #339933;">!=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$generatorObject</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">AddUrl</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$purchase_link</span><span style="color: #339933;">,</span> <span style="color: #990000;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;daily&quot;</span><span style="color: #339933;">,</span> <span style="color:#800080;">0.5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>And lastly we need to add the hook to call this function whenever the XML sitemap is rebuilt:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;sm_buildmap&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;wp_ecommerce_sm&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3>Is that all there is to it?</h3>
<p>Well, not really. Your still have to trigger the sitemap to re-build to include your new pages. You can do this manually by going to your XML Sitemaps setting page and clicking the link to rebuild to force the sitemap to re-build. Ideally however you would try to get your plugin to do this automatically whenever you add/edit/delete one of your pages. I couldn&#8217;t find an obvious hook to easily do this so that is something I would like to see adding in a future version of the <a href="http://www.arnebrachhold.de/projects/wordpress-plugins/google-xml-sitemaps-generator/trackback/">Google XML Sitemaps</a> plugin.</p>
<h3>Download</h3>
<p>Download the above code packaged as a WordPress plugin using the link below:</p>
<a href="http://www.benhuson.co.uk/downloads/wp-e-commerce-smphp.zip" title="WP e-Commerce XML Sitemap Plugin (20)" >Click here to download...</a>
]]></content:encoded>
			<wfw:commentRss>http://www.benhuson.co.uk/2009/07/12/integrate-google-xml-sitemaps/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Loading XML files in Flash over an SSL Connection in Internet Explorer</title>
		<link>http://www.benhuson.co.uk/2008/03/27/flash-xml-files-ssl/</link>
		<comments>http://www.benhuson.co.uk/2008/03/27/flash-xml-files-ssl/#comments</comments>
		<pubDate>Thu, 27 Mar 2008 11:08:51 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Web Developer]]></category>
		<category><![CDATA[XML & RSS]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[SSL]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.benhuson.co.uk/2008/03/27/flash-xml-files-ssl/</guid>
		<description><![CDATA[If you have a Flash site which loads dynamically generated XML file using SSL, you may have experienced this problem. Loading XML files in Flash over an SSL Connection fails in Internet Explorer if the Pragma:no-cache or Cache-control:no-cache HTTP headers are set on the XML file. By default, all dynamically generated files are returned by [...]]]></description>
			<content:encoded><![CDATA[<p>If you have a Flash site which loads dynamically generated XML file using SSL, you may have experienced this problem.</p>
<p>Loading XML files in Flash over an SSL Connection fails in Internet Explorer if the Pragma:no-cache or Cache-control:no-cache HTTP headers are set on the XML file. By default, all dynamically generated files are returned by the server with the Pragma:no-cache header so that they are not cached by the browser.</p>
<p>To ensure that Flash loads the XML successfully, you should use the following function in PHP near the top of your code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">session_cache_limiter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'private_no_expire'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.benhuson.co.uk/2008/03/27/flash-xml-files-ssl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
