<!-- $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:doap  ="http://usefulinc.com/ns/doap#"
    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/" 
    xmlns:swed ="http://www.swed.org.uk/2004/02/swed#"

    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

-->

<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><a href="http://usefulinc.com/doap">DOAP</a> converter for <a href="http://www.w3.org/2001/sw/BestPractices/">SWBP</a> 
<a href="http://esw.w3.org/topic/SemanticWebBestPracticesTaskForceOnApplicationsAndDemos">ATDF</a> <a href="http://esw.w3.org/mt/esw/archives/cat_applications_and_demos.html">weblog</a> data</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="mailto:libby.miller@bristol.ac.uk">Libby Miller</a>, based on work by 
<a href="../../../People/Connolly/">Dan Connolly</a>, Aug 2000<br />
amended by <a href="mailto:danbri@w3.org">Dan Brickley</a>, Nov 2000, 
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="blogbody"]'>

        <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>

	  <doap:Project>


	     <xsl:variable name="title" select='h:h3[@class="title"]'/>
	     <xsl:variable name="tishort" select='substring-after($title,"ADTF: ")'/>

	  <doap:name><xsl:value-of select='normalize-space($tishort)'/></doap:name>

	  <doap:description><xsl:value-of select='normalize-space(h:div/h:p/h:span[@class="description"])'/>
	  </doap:description>
          <doap:created><xsl:value-of select='h:div/h:p/h:span[@class="date"]'/></doap:created>

	  <doap:homepage rdf:resource="{$itemURI}"/>
	  <xsl:variable name="author_person" select='h:div/h:p/*[@class="author_person"]'/>
	  <xsl:if test='$author_person'>
		<doap:developer>
			<foaf:Person>
				<foaf:name>
				<xsl:value-of select='normalize-space(h:div/h:p/h:span[@class="author_person"]/h:a)'/>
				</foaf:name>
				<xsl:variable name="author_mbox" select='normalize-space(h:div/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:div/h:p/*/h:span[@class="author_organization"]/h:a/@href)'/>
				<foaf:workplaceHomepage rdf:resource="{$author_organization}"/>
			</foaf:Person>
		</doap:developer>
	  </xsl:if>

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

	  <xsl:for-each select='h:span[@class="skos"]'>

	     <xsl:variable name="url" select='h:a/@href'/>
	     <xsl:variable name="skos" select='substring-before($url,".html")'/>
	     <swed:has_topic rdf:resource="{$skos}"/>

	</xsl:for-each>

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

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

</xsl:template>

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

</xsl:transform>
