|
| 1 | +<?xml version="1.0" encoding="utf-8"?> |
| 2 | +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://datacite.org/schema/kernel-4"> |
| 3 | + <xsl:output method="xml" encoding="utf-8"/> |
| 4 | + |
| 5 | + <xsl:template match="/"> |
| 6 | + <resource |
| 7 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 8 | + xsi:schemaLocation="http://datacite.org/schema/kernel-4 http://schema.datacite.org/meta/kernel-4.1/metadata.xsd"> |
| 9 | + <xsl:apply-templates select="//objects/objekte" /> |
| 10 | + </resource> |
| 11 | + </xsl:template> |
| 12 | + |
| 13 | + <xsl:template match="objekte"> |
| 14 | + <identifier identifierType="DOI">___DOI_PLACEHOLDER___</identifier> |
| 15 | + <xsl:if test="count(_nested__objekte__obj_autoren/objekte__obj_autoren) or count(_nested__objekte__obj_autoren_lok/objekte__obj_autoren_lok)"> |
| 16 | + <creators> |
| 17 | + <xsl:for-each select="_nested__objekte__obj_autoren/objekte__obj_autoren"> |
| 18 | + <creator> |
| 19 | + <creatorName nameType="Personal"><xsl:value-of select="custom/string[@name='conceptName']" /></creatorName> |
| 20 | + </creator> |
| 21 | + </xsl:for-each> |
| 22 | + <xsl:for-each select="_nested__objekte__obj_autoren_lok/objekte__obj_autoren_lok"> |
| 23 | + <creator> |
| 24 | + <xsl:choose> |
| 25 | + <!-- TODO: Bessere Unterstützung Mehrsprachigkeit --> |
| 26 | + <xsl:when test="obj_autor_lok/lokal_klass_person/_standard/de-DE"> |
| 27 | + <creatorName nameType="Personal"><xsl:value-of select="obj_autor_lok/lokal_klass_person/_standard/de-DE" /></creatorName> |
| 28 | + </xsl:when> |
| 29 | + <xsl:otherwise> |
| 30 | + <creatorName nameType="Personal"><xsl:value-of select="obj_autor_lok/lokal_klass_person/_standard/en-US" /></creatorName> |
| 31 | + </xsl:otherwise> |
| 32 | + </xsl:choose> |
| 33 | + </creator> |
| 34 | + </xsl:for-each> |
| 35 | + </creators> |
| 36 | + </xsl:if> |
| 37 | + <titles> |
| 38 | + <xsl:if test="obj_titel/de-DE and string-length(obj_titel/de-DE)"><title xml:lang="de-DE"><xsl:value-of select="obj_titel/de-DE" /></title></xsl:if> |
| 39 | + <xsl:if test="obj_titel/en-US and string-length(obj_titel/en-US)"><title xml:lang="en-US"><xsl:value-of select="obj_titel/en-US" /></title></xsl:if> |
| 40 | + <!-- TODO: Weitere Titel --> |
| 41 | + </titles> |
| 42 | + <publisher>heidICON, Heidelberg University Library</publisher> |
| 43 | + <publicationYear><xsl:value-of select="substring(_last_modified,1,4)" /></publicationYear> |
| 44 | + <xsl:if test="count(_nested__objekte__obj_schlagworte/objekte__obj_schlagworte) or count(_nested__objekte__obj_schlagworte_lok/objekte__obj_schlagworte_lok)"> |
| 45 | + <subjects> |
| 46 | + <xsl:for-each select="_nested__objekte__obj_schlagworte/objekte__obj_schlagworte"> |
| 47 | + <subject xml:lang="de-DE"><xsl:value-of select="custom/string[@name='conceptName']" /></subject> |
| 48 | + </xsl:for-each> |
| 49 | + <xsl:for-each select="_nested__objekte__obj_schlagworte_lok/objekte__obj_schlagworte_lok"> |
| 50 | + <xsl:if test="obj_schlagwort_lok/lokal_klass_sach/_standard/de-DE and string-length(obj_schlagwort_lok/lokal_klass_sach/_standard/de-DE)"><subject><xsl:value-of select="obj_schlagwort_lok/lokal_klass_sach/_standard/de-DE" /></subject></xsl:if> |
| 51 | + <xsl:if test="obj_schlagwort_lok/lokal_klass_sach/_standard/en-US and string-length(obj_schlagwort_lok/lokal_klass_sach/_standard/en-US)"><subject><xsl:value-of select="obj_schlagwort_lok/lokal_klass_sach/_standard/en-US" /></subject></xsl:if> |
| 52 | + </xsl:for-each> |
| 53 | + </subjects> |
| 54 | + </xsl:if> |
| 55 | + <xsl:call-template name="asset"> |
| 56 | + <xsl:with-param name="assetnode" select="_reverse_nested__ressourcen__lk_objekt_id/*[local-name()='ressourcen'][1]/asset" /> |
| 57 | + </xsl:call-template> |
| 58 | + <xsl:if test="obj_beschreibung and string-length(obj_beschreibung)"> |
| 59 | + <descriptions> |
| 60 | + <xsl:if test="obj_beschreibung/de-DE and string-length(obj_beschreibung/de-DE)"><description xml:lang="de-DE" descriptionType="Abstract"><xsl:value-of select="obj_beschreibung/de-DE" /></description></xsl:if> |
| 61 | + <xsl:if test="obj_beschreibung/en-US and string-length(obj_beschreibung/en-US)"><description xml:lang="en-US" descriptionType="Abstract"><xsl:value-of select="obj_beschreibung/en-US" /></description></xsl:if> |
| 62 | + </descriptions> |
| 63 | + </xsl:if> |
| 64 | + </xsl:template> |
| 65 | + |
| 66 | + <xsl:template match="ressourcen"> |
| 67 | + <titles> |
| 68 | + <xsl:if test="lk_objekt_id/objekte/_standard/de-DE and string-length(lk_objekt_id/objekte/_standard/de-DE)"><title xml:lang="de-DE"><xsl:value-of select="lk_objekt_id/objekte/_standard/de-DE" /></title></xsl:if> |
| 69 | + <xsl:if test="lk_objekt_id/objekte/_standard/en-US and string-length(lk_objekt_id/objekte/_standard/en-US)"><title xml:lang="en-US"><xsl:value-of select="lk_objekt_id/objekte/_standard/en-US" /></title></xsl:if> |
| 70 | + <!-- TODO: Weitere Titel --> |
| 71 | + </titles> |
| 72 | + <xsl:call-template name="asset"> |
| 73 | + <xsl:with-param name="assetnode" select="asset" /> |
| 74 | + </xsl:call-template> |
| 75 | + </xsl:template> |
| 76 | + |
| 77 | + <xsl:template name="asset"> |
| 78 | + <xsl:param name="assetnode" /> |
| 79 | + <resourceType> |
| 80 | + <xsl:choose> |
| 81 | + <xsl:when test="$assetnode/files/*[local-name()='file'][1]/class='image'"><xsl:attribute name="resourceTypeGeneral">Image</xsl:attribute>Image</xsl:when> |
| 82 | + <xsl:when test="$assetnode/files/*[local-name()='file'][1]/class='audio'"><xsl:attribute name="resourceTypeGeneral">Sound</xsl:attribute>Audio</xsl:when> |
| 83 | + <xsl:when test="$assetnode/files/*[local-name()='file'][1]/class='video'"><xsl:attribute name="resourceTypeGeneral">Audiovisual</xsl:attribute>Video</xsl:when> |
| 84 | + <xsl:when test="$assetnode/files/*[local-name()='file'][1]/class='office'"><xsl:attribute name="resourceTypeGeneral">Text</xsl:attribute>Text/Office</xsl:when> |
| 85 | + <xsl:otherwise><xsl:attribute name="resourceTypeGeneral">Other</xsl:attribute>Other</xsl:otherwise> |
| 86 | + </xsl:choose> |
| 87 | + </resourceType> |
| 88 | + </xsl:template> |
| 89 | +</xsl:stylesheet> |
0 commit comments