<?xml version="1.0"?>
<xsl:stylesheet 
 version="1.0"
 xmlns:xsl ="http://www.w3.org/1999/XSL/Transform" 
 xmlns:r   ="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 xmlns:c   ="http://www.w3.org/2002/12/cal/icaltzd#"
 xmlns:h   ="http://www.w3.org/1999/xhtml"
 xmlns:foaf="http://xmlns.com/foaf/0.1/"
>

<div xmlns="http://www.w3.org/1999/xhtml">
<p>This transforms html <tt>address</tt> tags with
vcards into foaf:maker statements.
</p>
<p>See: <a href="http://microformats.org/wiki/hcard">hCard</a>,
<a href="http://www.w3.org/2003/g/data-view">GRDDL</a>.
</p>
<address>Dan Connolly<br />
<small>$Revision: 1.1 $ of $Date: 2007/05/05 22:42:04 $</small>
</address>
</div>

<xsl:output indent="yes" method="xml" />

<xsl:param name="prodid" select='"-//connolly.w3.org//palmagent 0.6 (BETA)//EN"' />

<xsl:param name="CalNS">http://www.w3.org/2002/12/cal/icaltzd#</xsl:param>
<xsl:param name="XdtNS">http://www.w3.org/2001/XMLSchema#</xsl:param>

<xsl:template match="/">
  <r:RDF>
    <xsl:apply-templates />
  </r:RDF>
</xsl:template>

<xsl:template match="h:address[contains(concat(' ', normalize-space(@class), ' '),
  ' vcard ')]" >
  <xsl:if test="@id">
    <foaf:Document r:about="">
      <foaf:maker r:resource="#{@id}" />
    </foaf:Document>
  </xsl:if>
</xsl:template>


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

</xsl:stylesheet>

