<xsl:stylesheet
  version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
  xmlns:foaf="http://xmlns.com/foaf/0.1/"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:saxon="http://icl.com/saxon">

    <xsl:output method="xml" indent="yes"/>
    <saxon:preview mode="preview" elements="project" />

    <xsl:template match="project-listing">
      <rdf:RDF>
         <rdf:Description about="">
            <dc:title>RDF version of Freshmeat project data</dc:title>
            <dc:description>RDF version of Freshmeat project data, generated using an XSLT stylesheet applied to
            the http://freshmeat.net/backend/ data.</dc:description>
            <foaf:maker>
                <foaf:Person>
                    <foaf:name>Leigh Dodds</foaf:name>
                    <foaf:mbox_sha1sum>1bca73e5c6916c738d6ec7cc0597ad0e395e7ace</foaf:mbox_sha1sum>
                    <rdfs:seeAlso rdf:resource="http://www.ldodds.com/ldodds.rdf"/>
                </foaf:Person>
            </foaf:maker>
            <dc:source rdf:resource="http://freshmeat.net/backend/fm-projects.rdf"/>
         </rdf:Description>

        <xsl:apply-templates/>
      </rdf:RDF>

    </xsl:template>


    <xsl:template match="project" mode="preview">

            <foaf:Project>

                <xsl:if test="projectname_full != ''">
                  <dc:title><xsl:value-of select="projectname_full"/></dc:title>
                </xsl:if>

                <xsl:if test="desc_short != ''">
                  <dc:description><xsl:value-of select="desc_short"/></dc:description>
                </xsl:if>

                <xsl:if test="url_project_page != ''">
                  <foaf:page rdf:resource="{url_project_page}"/>
                </xsl:if>

                <xsl:if test="url_changelog != ''">
                <foaf:page rdf:resource="{url_changelog}"/>
                </xsl:if>
                
				<xsl:if test="url_homepage != ''">
                <foaf:homepage rdf:resource="{url_homepage}"/>
				</xsl:if>
            </foaf:Project>

            <xsl:if test="screenshot_thumb != ''">
                <foaf:Image rdf:resource="{screenshot_thumb}">
                    <foaf:depicts rdf:resource="{url_homepage}"/>
                </foaf:Image>
            </xsl:if>
    </xsl:template>

    <xsl:template match="*" mode="preview"/>

</xsl:stylesheet>
