<xsl:transform
    xmlns:xsl ="http://www.w3.org/1999/XSL/Transform" version="1.0"
    xmlns:h   ="http://www.w3.org/1999/xhtml"
    xmlns:r   ="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:m="http://www.w3.org/2001/12/09mr#"
    xmlns:mr="http://www.w3.org/2000/11/mr76/minutes#"
    xmlns:conf="http://www.w3.org/2002/06/conf#"
    xmlns:contact="http://www.w3.org/2000/10/swap/pim/contact#"
    >

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

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

<xsl:template match="*[contains(@class, 'vevent')]">
  <xsl:variable name="startElt"
		select=".//*[contains(@class, 'dtstart')]" />
  <xsl:variable name="linkElt"
		select=".//*[contains(@class, 'url')]" />
  <xsl:variable name="locationLink"
		select=".//*[contains(@class, 'location')]
			//*[contains(@class, 'url')]" />
  <m:Teleconference>
    <conf:start>
      <xsl:value-of select="normalize-space($startElt)" />
    </conf:start>
    <conf:bridge r:resource="{$locationLink/@href}" />
    <conf:group>
      <r:Description>
	<contact:homePage r:resource="{$linkElt/@href}" />
	<contact:name><xsl:value-of select="$linkElt" /></contact:name>
      </r:Description>
    </conf:group>

    <mr:agenda>
      <r:Seq>
	<xsl:apply-templates />
      </r:Seq>
    </mr:agenda>
  </m:Teleconference>
</xsl:template>

<xsl:template match="h:ol/h:li[@class='vtodo']">
  <xsl:variable
      name="summaryElt"
      select='*[contains(@class, "summary")]'
      />

  <xsl:variable
      name="from"
      select='*[contains(@class, "organizer")]'
      />

  <r:li>
    <r:Description>
      <!-- why dc:title rather than rdfs:label? -->
      <dc:title>
	<xsl:value-of select="normalize-space($summaryElt)" />
      </dc:title>
      <xsl:if test="$from">
	<mr:from>
	  <xsl:value-of select="normalize-space($from)" />
	</mr:from>
      </xsl:if>
    </r:Description>
  </r:li>
</xsl:template>

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

</xsl:transform>