function loadXMLs(str) 
	{
	try //Internet Explorer
	  {
	  xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
	  xmlDoc.async="false";
	  xmlDoc.loadXML(str);
	  return(xmlDoc); 
	  }
	catch(e)
	  {
	  try //Firefox, Mozilla, Opera, etc.
		{
		parser=new DOMParser();
		xmlDoc=parser.parseFromString(str,"text/xml");
		return(xmlDoc);
		}
	  catch(e) {alert(e.message)}
	  }
	return(null);
	}
xmlstr='<rss version="2.0"> <channel> <title>Recruiter - Industry Trends</title> <link>http://www.recruiter.co.uk</link> <description>http://www.recruiter.co.uk</description> <image> <url>http://www.recruiter.co.uk/magazine/graphics/logo.png 					</url> <title></title> <link>http://www.recruiter.co.uk</link> </image> <item> <title>Public sector staff could cross over</title> <link>http://www.recruiter.co.uk/public-sector-staff-could-cross-over/1006694.article</link> <guid isPermaLink="true">http://www.recruiter.co.uk/public-sector-staff-could-cross-over/1006694.article</guid> <description>James Stevenson, Managing director, Morgan HuntThe implications of the Budget may be more profound than expected for the whole economy, not just the public sector</description> <pubDate>Wed, 1 Sep 2010 00:00 GMT</pubDate> </item> <item> <title>A cloud with a silver lining</title> <link>http://www.recruiter.co.uk/a-cloud-with-a-silver-lining/1006543.article</link> <guid isPermaLink="true">http://www.recruiter.co.uk/a-cloud-with-a-silver-lining/1006543.article</guid> <description>As workers feel more confident about the economy, millions will look to move, providing recruiters with new opportunities</description> <pubDate>Wed, 18 Aug 2010 00:00 GMT</pubDate> </item> <item> <title>Knowledge is power for opportunity</title> <link>http://www.recruiter.co.uk/knowledge-is-power-for-opportunity/1006267.article</link> <guid isPermaLink="true">http://www.recruiter.co.uk/knowledge-is-power-for-opportunity/1006267.article</guid> <description>Miles Davis Managing director, BBL Medical - an HCL company Whatever the future holds for recruitment, there will always be opportunities and for many recruiters this will lead to taking a more specialist approach</description> <pubDate>Wed, 21 Jul 2010 00:00 GMT</pubDate> </item> <item> <title>Fractional work. The next small thing?</title> <link>http://www.recruiter.co.uk/fractional-work-the-next-small-thing?/1006100.article</link> <guid isPermaLink="true">http://www.recruiter.co.uk/fractional-work-the-next-small-thing?/1006100.article</guid> <description>The term ’career’ may soon be a thing of the past, as the global workforce structure changes over time</description> <pubDate>Wed, 7 Jul 2010 00:00 GMT</pubDate> </item> </channel> </rss> 	';
xmlDoc = loadXMLs(xmlstr);
var txt = '';
var txt = '';
items = xmlDoc.getElementsByTagName("item");
	for (i=0; i<1; i++) {
	
		var title="";
		var hlink="";
		var descr="";
		var pubdate="";
	
		
		if (items[i].getElementsByTagName("title")[0].length != 0)
			title = items[i].getElementsByTagName("title")[0].childNodes[0].nodeValue;
		if (items[i].getElementsByTagName("link")[0].length != 0)
			hlink = items[i].getElementsByTagName("link")[0].childNodes[0].nodeValue;
		if (items[i].getElementsByTagName("description")[0].childNodes.length != 0)
			descr = items[i].getElementsByTagName("description")[0].childNodes[0].nodeValue;
			var len = 200;
				if (descr) {
					if (descr.length > len) {
						descr = descr.substring(0, len);
						descr = descr.replace(/\w+$/, "");
						descr += "...";
					  }
					}
		
		if (items[i].getElementsByTagName("pubDate")[0].length != 0)
			pubdate = items[i].getElementsByTagName("pubDate")[0].childNodes[0].nodeValue;txt +='<div class="sleeve">';
txt +='<h2><a href="'+ hlink +'">' + title + '</a></h2>';
txt +='<p class="meta"><span class="date">' + pubdate + '</span></p>';
txt +='<p>'+ descr + '</p>';
txt += '</div>';
}
document.write (txt);
