<?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>Blog of a LAMP Developer based in Richmond, Surrey &#187; xml</title>
	<atom:link href="http://www.lampdeveloper.co.uk/tag/xml/feed" rel="self" type="application/rss+xml" />
	<link>http://www.lampdeveloper.co.uk</link>
	<description>A day in the life of a Lamp Developer</description>
	<lastBuildDate>Sat, 13 Nov 2010 11:16:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Validating XML files, including Google sitemap and atom XML using PHP</title>
		<link>http://www.lampdeveloper.co.uk/php/validating-xml-files-including-google-sitemap-and-atom-xml-using-php.html</link>
		<comments>http://www.lampdeveloper.co.uk/php/validating-xml-files-including-google-sitemap-and-atom-xml-using-php.html#comments</comments>
		<pubDate>Wed, 11 Aug 2010 15:07:05 +0000</pubDate>
		<dc:creator>Jamie</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[google sitemap]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.lampdeveloper.co.uk/?p=187</guid>
		<description><![CDATA[The following method is pulled from a class, in a php command line tool, that I created to generate google sitemap files and also Google Base atom files.
What I wanted to do was, vailidate the generated xml files against a schema, before saving them.
You can do this via the command using xmllint.
xmllint &#8211;schema atom.xsd.xml &#8211;valid [...]]]></description>
			<content:encoded><![CDATA[<p>The following method is pulled from a class, in a php command line tool, that I created to generate google sitemap files and also Google Base atom files.</p>
<p>What I wanted to do was, vailidate the generated xml files against a schema, before saving them.</p>
<p>You can do this via the command using xmllint.</p>
<p>xmllint &#8211;schema atom.xsd.xml &#8211;valid &#8211;noout /xmlfiles/.test.xml.tmp</p>
<p>However you can easily do this in PHP.</p>
<p>Here are the schema files. <a rel="attachment wp-att-190" href="http://www.lampdeveloper.co.uk/php/validating-xml-files-including-google-sitemap-and-atom-xml-using-php.html/attachment/siteindex"></a></p>
<p><a rel="attachment wp-att-191" href="http://www.lampdeveloper.co.uk/php/validating-xml-files-including-google-sitemap-and-atom-xml-using-php.html/attachment/sitemap"></a><a rel="attachment wp-att-190" href="http://www.lampdeveloper.co.uk/php/validating-xml-files-including-google-sitemap-and-atom-xml-using-php.html/attachment/siteindex">siteindex</a><br />
<a rel="attachment wp-att-191" href="http://www.lampdeveloper.co.uk/php/validating-xml-files-including-google-sitemap-and-atom-xml-using-php.html/attachment/sitemap">sitemap</a><br />
<a rel="attachment wp-att-189" href="http://www.lampdeveloper.co.uk/php/validating-xml-files-including-google-sitemap-and-atom-xml-using-php.html/attachment/atom-xsd">atom.xsd</a></p>
<pre name="code" class="php">

static function validate_google_xml($xmlfile, $type)
{

print(&quot;Validating {$xmlfile} \n&quot;);

$xdoc = new DomDocument;
if($type == &#039;siteindex&#039;)
{
$schema = self::$scriptDir.&#039;siteindex.xsd&#039;;
@$xdoc-&gt;Load($xmlfile);
if (@$xdoc-&gt;schemaValidate($schema))
{
return true;
}
}elseif($type == &#039;sitemap&#039;)
{
$schema = self::$scriptDir.&#039;sitemap.xsd&#039;;
//echo $schema ; die;
@$xdoc-&gt;Load($xmlfile);
if (@$xdoc-&gt;schemaValidate($schema))
{
return true;
}

}elseif($type == &#039;atom&#039;)
{
$schema = self::$scriptDir.&#039;atom.xsd.xml&#039;;
//echo $schema ; die;
@$xdoc-&gt;Load($xmlfile);
if (@$xdoc-&gt;schemaValidate($schema))
{
return true;
}

}

}
</pre>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=Blog%20of%20a%20LAMP%20Developer%20based%20in%20Richmond%2C%20Surrey&amp;siteurl=http%3A%2F%2Fwww.lampdeveloper.co.uk%2F&amp;linkname=Validating%20XML%20files%2C%20including%20Google%20sitemap%20and%20atom%20XML%20using%20PHP&amp;linkurl=http%3A%2F%2Fwww.lampdeveloper.co.uk%2Fphp%2Fvalidating-xml-files-including-google-sitemap-and-atom-xml-using-php.html"><img src="http://www.lampdeveloper.co.uk/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Save/Bookmark"/></a>

	</p>]]></content:encoded>
			<wfw:commentRss>http://www.lampdeveloper.co.uk/php/validating-xml-files-including-google-sitemap-and-atom-xml-using-php.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generating a file list, for a Joomla Component XML info file</title>
		<link>http://www.lampdeveloper.co.uk/linux/generating-a-file-list-for-a-joomla-component-xml-info-file.html</link>
		<comments>http://www.lampdeveloper.co.uk/linux/generating-a-file-list-for-a-joomla-component-xml-info-file.html#comments</comments>
		<pubDate>Tue, 08 Dec 2009 10:00:07 +0000</pubDate>
		<dc:creator>Jamie</dc:creator>
				<category><![CDATA[Apple OSX]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[generate]]></category>
		<category><![CDATA[joomla]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.lampdeveloper.co.uk/?p=161</guid>
		<description><![CDATA[I&#8217;ve had to do some work for a company recently.
It involved me creating Joomla components and those annoying XML files, listing all the files and folders to install.
If you want a quick command to generate the xml, you can cd to the directory then run
find * -type f -exec  echo &#8216;&#60;filename&#62;&#8217;{}&#8217;&#60;/filename&#62;&#8217; \;
find * -type d [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve had to do some work for a company recently.</p>
<p>It involved me creating Joomla components and those annoying XML files, listing all the files and folders to install.</p>
<p>If you want a quick command to generate the xml, you can cd to the directory then run</p>
<p>find * -type f -exec  echo &#8216;&lt;filename&gt;&#8217;{}&#8217;&lt;/filename&gt;&#8217; \;</p>
<p>find * -type d -exec  echo &#8216;&lt;folder&gt;&#8217;{}&#8217;&lt;/folder&gt;&#8217; \;</p>
<p>Then you can copy the output from the terminal and paste between the files tags.</p>
<p>&lt;files folder=&#8221;components/com_test&#8221;&gt;<br />
&lt;filename&gt;controller.php&lt;/filename&gt;<br />
&lt;filename&gt;css/test.css&lt;/filename&gt;<br />
&lt;filename&gt;views/test/tmpl/index.html&lt;/filename&gt;<br />
&lt;filename&gt;test.php&lt;/filename&gt;<br />
&lt;folder&gt;css&lt;/folder&gt;<br />
&lt;folder&gt;images&lt;/folder&gt;<br />
&lt;folder&gt;install_sql&lt;/folder&gt;<br />
&lt;folder&gt;models&lt;/folder&gt;<br />
&lt;folder&gt;player&lt;/folder&gt;<br />
&lt;folder&gt;views&lt;/folder&gt;<br />
&lt;folder&gt;views/user&lt;/folder&gt;<br />
&lt;folder&gt;views/user/tmpl&lt;/folder&gt;<br />
&lt;folder&gt;views/test&lt;/folder&gt;<br />
&lt;folder&gt;views/test/tmpl&lt;/folder&gt;<br />
&lt;/files&gt;</p>
<p>I repeated this for the administrator/components/com_test and components/com_test folders</p>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=Blog%20of%20a%20LAMP%20Developer%20based%20in%20Richmond%2C%20Surrey&amp;siteurl=http%3A%2F%2Fwww.lampdeveloper.co.uk%2F&amp;linkname=Generating%20a%20file%20list%2C%20for%20a%20Joomla%20Component%20XML%20info%20file&amp;linkurl=http%3A%2F%2Fwww.lampdeveloper.co.uk%2Flinux%2Fgenerating-a-file-list-for-a-joomla-component-xml-info-file.html"><img src="http://www.lampdeveloper.co.uk/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Save/Bookmark"/></a>

	</p>]]></content:encoded>
			<wfw:commentRss>http://www.lampdeveloper.co.uk/linux/generating-a-file-list-for-a-joomla-component-xml-info-file.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

