myevents.xsl 1.51 KB
<?xml version="1.0"?>
<xsl:stylesheet 
 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"
 version="1.0"
>

<div xmlns="http://www.w3.org/1999/xhtml">
<p>This transformation says "I'll be at all these events";
i.e. it makes an <tt>ical:attendee</tt>
link between all <tt>vevent</tt> ids on a page and
the <tt>vcard</tt> id on the page.
</p>
<p>See: <a href="http://microformats.org/wiki/hcard">hCard</a>,
<a href="http://microformats.org/wiki/hcalendar">hCalendar</a>,
<a href="http://www.w3.org/2003/g/data-view">GRDDL</a>.
</p>
<address>Dan Connolly<br />
<small>$Revision: 1.1 $ of $Date: 2006/11/14 00:04:50 $</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="*[contains(concat(' ', normalize-space(@class), ' '),
  ' vevent ')]" >

  <xsl:variable name="me" select="//*[contains(concat(' ', normalize-space(@class), ' '),
  ' vcard ')]/@id"/>
  <c:Vevent r:about="#{@id}">
    <c:attendee r:resource="#{$me}" />
  </c:Vevent>
</xsl:template>


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

</xsl:stylesheet>