<!-- $Id: home2rssical.xsl,v 1.3 2003/04/16 17:30:26 lmiller Exp $ -->
<xsl:transform 
    xmlns:xsl  ="http://www.w3.org/1999/XSL/Transform" version="1.0"
    xmlns:rdf  ="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:rdfs ="http://www.w3.org/2000/02/rdfschema#"
    xmlns      ="http://purl.org/rss/1.0/"
    xmlns:foaf  ="http://xmlns.com/foaf/0.1/"
    xmlns:ical ="http://www.w3.org/2002/12/cal/ical#" 
    xmlns:dc   ="http://purl.org/dc/elements/1.1/" 
    xmlns:h    ="http://www.w3.org/1999/xhtml"
    xmlns:uri  ="http://www.w3.org/2000/07/uri43/uri.xsl?template="
    xmlns:hr   ="http://www.w3.org/2000/08/w3c-synd/#"
    xmlns:ev   ="http://purl.org/rss/1.0/modules/event/" 
    exclude-result-prefixes="uri"
    >

 <!-- 

adapted 2004-06-22 for BPWG
http://esw.w3.org/topic/SemanticWebBestPracticesTaskForceOnApplicationsAndDemos
http://esw.w3.org/mt/esw/archives/cat_applications_and_demos.html

xalan doesn't grok relative URIs in imports. Sigh.
<xsl:import href="../../07/uri43/uri.xsl"/>
-->

<xsl:import href="http://www.w3.org/2000/07/uri43/uri.xsl"/>
<xsl:param name="Base"/>
<xsl:param name="Channel"/>
<xsl:param name="Page"/>

<xsl:variable name="Profile"
select='"http://swordfish.rdfweb.org/discovery/2004/06/adtf/#"'/>


<xsl:output method="xml" indent="yes" encoding="utf-8"/>
 <!-- @@ encoding="us-ascii" is not honored by XT;
      per http://www.jclark.com/xml/xt.html
	Version 19991105 -->
<div xmlns="http://www.w3.org/1999/xhtml">

<div>
<h2>Share and Enjoy</h2>

<p>Copyright (c) 2000 W3C (MIT, INRIA, Keio), released under the <a
href="http://www.w3.org/Consortium/Legal/copyright-software-19980720">
W3C Open Source License</a> of August 14 1998.  </p>
</div>

<address><a href="../../../People/Connolly/">Dan Connolly</a>, Aug 2000<br />
ammended by <a href="mailto:danbri@w3.org">Dan Brickley</a>, Nov 2000 <br />
$Revision: 1.3 $ of $Date: 2003/04/16 17:30:26 $ by $Author: lmiller $<br />
ammended by <a href="mailto:libby.miller@bristol.ac.uk">Libby Miller</a>,
April 2003, June 2004
</address>
</div>

<xsl:template match='h:html
	      [h:head/@profile=$Profile]'>
  <xsl:processing-instruction name="xml-stylesheet">href="http://www.w3.org/2000/08/w3c-synd/style.css" type="text/css"</xsl:processing-instruction>
  <rdf:RDF>

      <xsl:for-each select='.//h:div[@class="item"]'>
        <xsl:variable name="itemURI">
	  <xsl:call-template name="uri:expand">
	    <xsl:with-param name="there"
		      select='.//h:a[@rel="url"]/@href'/>
            <xsl:with-param name="base" select="$Base"/>
	  </xsl:call-template>
	</xsl:variable>

	  <rdf:Description>

	  <dc:title><xsl:value-of select='normalize-space(../h:h3[@class="title"])'/></dc:title>
	  <dc:description><xsl:value-of select='normalize-space(h:p/h:span[@class="description"])'/>
	  </dc:description>
          <dc:date><xsl:value-of select='h:p/h:span[@class="date"]'/></dc:date>

	  <foaf:homepage rdf:resource="{$itemURI}"/>
	  <xsl:variable name="author_person" select='h:p/*[@class="author_person"]'/>
	  <xsl:if test='$author_person'>
		<dc:creator>
			<foaf:Person>
				<foaf:name>
				<xsl:value-of select='normalize-space(h:p/h:span[@class="author_person"]/h:a)'/>
				</foaf:name>
				<xsl:variable name="author_mbox" select='normalize-space(h:p/h:span[@class="author_person"]/h:a/@href)'/>
				<foaf:mbox rdf:resource="{$author_mbox}"/>
				<xsl:variable name="author_organization" select='normalize-space(h:p/*/h:span[@class="author_organization"]/h:a/@href)'/>
				<foaf:workplaceHomepage rdf:resource="{$author_organization}"/>
			</foaf:Person>
		</dc:creator>
	  </xsl:if>

	  <xsl:variable name="contact_person" select='h:p/*[@class="contact_person"]'/>
	  <xsl:if test='$contact_person'>
		<dc:creator><!--fixme - shoudl not be creator-->
			<foaf:Person>
				<foaf:name>
				<xsl:value-of select='normalize-space(h:p/h:span[@class="contact_person"]/h:a)'/>
				</foaf:name>
				<xsl:variable name="contact_mbox" select='normalize-space(h:p/h:span[@class="contact_person"]/h:a/@href)'/>
				<foaf:mbox rdf:resource="{$contact_mbox}"/>
				<xsl:variable name="contact_organization" select='normalize-space(h:p/*/h:span[@class="contact_organization"]/h:a/@href)'/>
				<foaf:workplaceHomepage rdf:resource="{$contact_organization}"/>
			</foaf:Person>
		</dc:creator>
	  </xsl:if>
<!--
	  <dc:subject rdf:resource=""/>
-->

	<rdfs:seeAlso rdf:resource="{h:p/h:a/@href}"/>
	</rdf:Description>

      </xsl:for-each>
  </rdf:RDF>

</xsl:template>

<!-- don't pass text thru -->
<xsl:template match="text()|@*">
</xsl:template>

</xsl:transform>
