<?xml version="1.0" encoding="utf-8"?>
			
			<rss version="2.0" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cc="http://web.resource.org/cc/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">

			<channel>
			<title>Jamie Krug&apos;s ColdFusion Blog - SitemapCFC</title>
			<link>http://jamiekrug.com/blog/index.cfm</link>
			<description>Jamie Krug&apos;s ColdFusion blog, regarding ColdFusion/CFML and other programming adventures as well as some learning experiences. EDB: Event Driven Blogging (in the event that I actually have something worth sharing:)</description>
			<language>en-us</language>
			<pubDate>Wed, 08 Sep 2010 19:37:42 -0400</pubDate>
			<lastBuildDate>Fri, 20 Mar 2009 09:24:00 -0400</lastBuildDate>
			<generator>BlogCFC</generator>
			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
			<managingEditor>jamie@jamiekrug.com</managingEditor>
			<webMaster>jamie@jamiekrug.com</webMaster>
			<itunes:subtitle></itunes:subtitle>
			<itunes:summary></itunes:summary>
			<itunes:category text="Technology" />
			<itunes:category text="Technology">
				<itunes:category text="Podcasting" />
			</itunes:category>
			<itunes:category text="Technology">
				<itunes:category text="Tech News" />
			</itunes:category>
			<itunes:keywords></itunes:keywords>
			<itunes:author></itunes:author>
			<itunes:owner>
				<itunes:email>jamie@jamiekrug.com</itunes:email>
				<itunes:name></itunes:name>
			</itunes:owner>
			<itunes:image href="" />
			<image>
				<url></url>
				<title>Jamie Krug&apos;s ColdFusion Blog</title>
				<link>http://jamiekrug.com/blog/index.cfm</link>
			</image>
			<itunes:explicit>no</itunes:explicit>
			
			
			
			
			
			<item>
				<title>Sitemaps.org Data Driven Sitemap XML Generator (sitemap.xml for Google, Yahoo!, MSN and others)</title>
				<link>http://jamiekrug.com/blog/index.cfm/2009/3/20/sitemaps-org-google-yahoo-msn-others-data-driven-sitemap-xml-generator</link>
				<description>
				
				&lt;strong&gt;Update:&lt;/strong&gt; Get SitemapCFC &lt;a href=&quot;http://code.google.com/p/sitemapcfc/&quot; title=&quot;SitemapCFC project home at Google Code&quot;&gt;at Google Code&lt;/a&gt; or &lt;a href=&quot;http://sitemapcfc.riaforge.org/&quot; title=&quot;SitemapCFC project home at RIAForge&quot;&gt;at RIAForge&lt;/a&gt;.

If you&apos;re not familiar with &lt;em&gt;Sitemaps&lt;/em&gt;, visit the &lt;a href=&quot;http://sitemaps.org/&quot; title=&quot;Sitemaps.org home - What are Sitemaps?&quot;&gt;sitemaps.org home page&lt;/a&gt;, which provides an overview of the &lt;a href=&quot;http://sitemaps.org/protocol.php&quot; title=&quot;Sitemaps.org Protocol - Sitemaps XML Format&quot;&gt;Sitemaps protocol&lt;/a&gt; (adopted by Google, Yahoo! and Microsoft, among others).

I wanted to generate a sitemap.xml file to submit to Google, Yahoo!, etc. based on data from a simple CMS application&apos;s database. I ran some quick searches and was surprised to not quickly find a CFC that did exactly what I was looking for. There are a few sitemap generators out there that crawl site links to produce a sitemap XML file, but I didn&apos;t find any that generated an XML file based on data. I know there are a number of applications that have built-in site generator support (like &lt;a href=&quot;http://blogcfc.riaforge.org/&quot;&gt;BlogCFC&lt;/a&gt; and probably most modern blog and CMS apps), but I didn&apos;t find anything generic and flexible enough for my needs. &lt;a href=&quot;http://www.coldfusionjedi.com/index.cfm/2006/11/16/Sitemap-Generator&quot;&gt;Ray Camden did share a UDF&lt;/a&gt; that handles the basics very nicely, but I wanted to be able to pass in different URL collection types with flexible key/column names. I&apos;d already cooked up two different (albeit simple) application-specific sitemap generators for apps that I maintain, so it was time to genericize and reuse!

I&apos;ll outline the Sitemap.cfc I created, its features and some examples. &lt;span style=&quot;text-decoration: line-through;&quot;&gt;I will update this post with a link to &lt;a href=&quot;http://sitemapcfc.riaforge.org/&quot; title=&quot;RIAForge - Open Source projects built on Adobe technology&quot;&gt;RIAForge&lt;/a&gt; once I have the project approved for upload there.&lt;/span&gt; If you&apos;re &lt;em&gt;not&lt;/em&gt; looking for a data-driven sitemap generator, but rather a &lt;em&gt;crawler&lt;/em&gt; or &lt;em&gt;spider&lt;/em&gt; style sitemap generator, then check out &lt;a href=&quot;http://googlesitemapxmlgenerator.riaforge.org/&quot;&gt;this &amp;quot;Google Sitemap XML Generator&amp;quot;&lt;/a&gt;. For a &lt;em&gt;data driven&lt;/em&gt; sitemap generator (or, if you want to use your own crawler and just need to model and generate a valid sitemap.xml file), read on...

I quickly put together a relatively simple Sitemap.cfc to suit my needs, but then I found myself adding more and more little enhancements. Since the sitemaps.org protocol is relatively simple, it wasn&apos;t too difficult to create a CFC to model the protocol. I tried to keep it simple, but flexible enough to take a collection of URLs (and relevant meta data) in just about any form and spit out a valid sitemap.xml file.

&lt;h2&gt;SitemapCFC Feature Overview&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Use a list, query or array (of structs) to initialize a sitemap object.&lt;/li&gt;
&lt;li&gt;Query column or struct key names used to initialize a Sitemap.cfc object are not important; an optional init() argument can be used to map to standard sitemaps.org protocol tag names.&lt;/li&gt;
&lt;li&gt;Write your sitemap.xml file to disk or dynamically send a sitemap XML document to the browser as binary page output (cfcontent type text/xml).&lt;/li&gt;
&lt;li&gt;Debugging methods available to access a Sitemap.cfc object&apos;s URL collection in the form of an array, an XML object or the raw XML string.&lt;/li&gt;
&lt;li&gt;XML document is schema validation ready.&lt;/li&gt;
&lt;li&gt;All initialization data values are cleaned (entity escaping, date/time format, valid string values, etc.) and validated.&lt;/li&gt;
&lt;li&gt;Date(/time) values for the &amp;lt;lastmod&amp;gt; tags can be passed in as any valid date/time string or object; they will be automatically converted to UTC in proper W3C Datetime format (again, per sitemaps.org protocol).&lt;/li&gt;
&lt;/ul&gt;

Read on for an [] of examples...
				 [More]
				</description>
						
				
				<category>CFML</category>				
				
				<category>SitemapCFC</category>				
				
				<pubDate>Fri, 20 Mar 2009 09:24:00 -0400</pubDate>
				<guid>http://jamiekrug.com/blog/index.cfm/2009/3/20/sitemaps-org-google-yahoo-msn-others-data-driven-sitemap-xml-generator</guid>
				
			</item>
			
		 	
			</channel></rss>