<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
		xmlns:dc="http://purl.org/dc/elements/1.1/"
		xmlns:h="http://www.w3.org/1999/xhtml"
		xmlns:m="http://www.w3.org/2001/12/09mr#"
		xmlns:mr="http://www.w3.org/2000/11/mr76/minutes#"
		xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
		exclude-result-prefixes="h"
                version="1.0">

<xsl:output method="xml" encoding="utf-8" indent="yes"/>

<xsl:preserve-space elements="*"/>

<xsl:template match="/">
  <rdf:RDF>
    <m:Teleconference>
      <mr:agenda>
	<rdf:Seq>
	  <xsl:apply-templates select="//h:li[@class='agendum']"/>
	</rdf:Seq>
      </mr:agenda>
    </m:Teleconference>
  </rdf:RDF>
</xsl:template>

<xsl:template match="h:li">
  <xsl:variable name="agendum">
    <xsl:text></xsl:text>
    <xsl:number from="h:body" level="multiple"/>
    <xsl:text>. </xsl:text>
    <xsl:apply-templates mode="text"/>
  </xsl:variable>

  <rdf:li rdf:parseType="Resource">
    <dc:title>
      <xsl:value-of select="normalize-space($agendum)"/>
    </dc:title>
  </rdf:li>
</xsl:template>

<xsl:template match="text()" mode="text">
  <xsl:value-of select="."/>
</xsl:template>

<xsl:template match="h:a|h:span" mode="text">
  <xsl:apply-templates mode="text"/>
</xsl:template>

<xsl:template match="*|comment()|processing-instruction()" mode="text">
  <!-- nop -->
</xsl:template>

</xsl:stylesheet>
