<?xml version="1.0" encoding="UTF-8" ?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                              xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"
                              xmlns:amf="http://amf.openlib.org"
                              xmlns:dc="http://purl.org/dc/elements/1.1/"
                              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

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

<!-- by thomas krichel http://openlib.org/home/krichel
  Latest version at http://amf.openlib.org/tool/amf2oai_dc.xsl

-->


<!-- remove the default printing of text-->
<xsl:template match="text()">
</xsl:template>

<xsl:template match="amf:text|amf:collection">
<oai_dc:dc xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/
       http://www.openarchives.org/OAI/2.0/oai_dc.xsd">
<dc:identifier>
<xsl:value-of select="@id"/>
</dc:identifier>
<xsl:apply-templates/>
</oai_dc:dc>
<xsl:text>

</xsl:text>
</xsl:template>

<!--- creator -->
<xsl:template match="amf:hasauthor/amf:person|
                     amf:haseditor/amf:person|
                     amf:haseditor/amf:organization|
                     amf:hasauthor/amf:organization">
<dc:creator>
<xsl:value-of select="amf:name"/>
</dc:creator>
</xsl:template>

<!--- publisher -->
<xsl:template match="amf:haspublisher/amf:person|
                     amf:haspublisher/amf:organization">
<dc:creator>
<xsl:value-of select="amf:name"/>
</dc:creator>
</xsl:template>

<!-- title -->
<xsl:template match="amf:title">
<dc:title>
<xsl:value-of select="."/>
</dc:title>
</xsl:template>

<!-- type -->
<xsl:template match="amf:type">
<dc:type>
<xsl:value-of select="."/>
</dc:type>
</xsl:template>

<xsl:template match="amf:identifier|amf:file/amf:url">
 <dc:identifier>
 <xsl:value-of select="."/>
 </dc:identifier>
</xsl:template>

<!-- description -->
<xsl:template match="amf:abstract|amf:keywords|amf:description">
<dc:description>
<xsl:value-of select="."/>
</dc:description>
</xsl:template>

</xsl:stylesheet>


