Skip to content

Commit

Permalink
#1149 Bug xslt mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
haogatyp committed Nov 9, 2023
1 parent 5b44a67 commit 2cb1b40
Show file tree
Hide file tree
Showing 7 changed files with 129 additions and 129 deletions.
2 changes: 1 addition & 1 deletion modules/oai/views/scripts/index/oai-pmh.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@
<xsl:choose>
<xsl:when test="$oai_verb!='ListIdentifiers' and @ServerState!='deleted'">
<metadata>
<xsl:apply-templates select="." mode="metadata_prefix_mode" />
<xsl:apply-templates select="." />
</metadata>
</xsl:when>
</xsl:choose>
Expand Down
84 changes: 42 additions & 42 deletions modules/oai/views/scripts/index/prefixes/XMetaDissPlus.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -66,24 +66,24 @@
xsi:schemaLocation="http://www.d-nb.de/standards/xmetadissplus/ https://d-nb.info/standards/schema/xmetadissplus.xsd">

<!-- dc:title -->
<xsl:apply-templates select="TitleMain" mode="metadata_prefix_mode" />
<xsl:apply-templates select="TitleSub" mode="metadata_prefix_mode" />
<xsl:apply-templates select="TitleMain" />
<xsl:apply-templates select="TitleSub" />
<!-- dc:creator -->
<xsl:apply-templates select="PersonAuthor" mode="metadata_prefix_mode" />
<xsl:apply-templates select="@CreatingCorporation" mode="metadata_prefix_mode" />
<xsl:apply-templates select="@ContributingCorporation" mode="metadata_prefix_mode" />
<xsl:apply-templates select="PersonAuthor" />
<xsl:apply-templates select="@CreatingCorporation" />
<xsl:apply-templates select="@ContributingCorporation" />
<!-- dc:subject -->
<xsl:apply-templates select="Collection[@RoleName='ddc' and @Visible=1]" mode="metadata_prefix_mode" />
<xsl:apply-templates select="Subject[@Type='swd']" mode="metadata_prefix_mode" />
<xsl:apply-templates select="Subject[@Type='uncontrolled']" mode="metadata_prefix_mode" />
<xsl:apply-templates select="Collection[@RoleName='ddc' and @Visible=1]" />
<xsl:apply-templates select="Subject[@Type='swd']" />
<xsl:apply-templates select="Subject[@Type='uncontrolled']" />
<!-- dc:abstract -->
<xsl:apply-templates select="TitleAbstract" mode="metadata_prefix_mode" />
<xsl:apply-templates select="TitleAbstract" />
<!-- dc:publisher -->
<xsl:apply-templates select="ThesisPublisher" mode="metadata_prefix_mode" />
<xsl:apply-templates select="ThesisPublisher" />
<!-- dc:contributor -->
<xsl:apply-templates select="PersonAdvisor" mode="metadata_prefix_mode" />
<xsl:apply-templates select="PersonReferee" mode="metadata_prefix_mode" />
<xsl:apply-templates select="PersonEditor" mode="metadata_prefix_mode" />
<xsl:apply-templates select="PersonAdvisor" />
<xsl:apply-templates select="PersonReferee" />
<xsl:apply-templates select="PersonEditor" />

<xsl:choose>
<xsl:when test="ThesisDateAccepted">
Expand Down Expand Up @@ -129,10 +129,10 @@
<!-- dc:identifier -->
<xsl:choose>
<xsl:when test="Identifier[@Type = 'urn']">
<xsl:apply-templates select="Identifier[@Type = 'urn']" mode="metadata_prefix_mode" />
<xsl:apply-templates select="Identifier[@Type = 'urn']" />
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="Identifier[@Type = 'doi']" mode="metadata_prefix_mode" />
<xsl:apply-templates select="Identifier[@Type = 'doi']" />
</xsl:otherwise>
</xsl:choose>

Expand All @@ -145,7 +145,7 @@
</xsl:for-each>

<!-- dc:source must appear after dc:identifier -->
<xsl:apply-templates select="TitleParent" mode="metadata_prefix_mode" />
<xsl:apply-templates select="TitleParent" />

<!-- weird DNB constraint: dc:language must appear after dcterms:medium -->
<dc:language xsi:type="dcterms:ISO639-2">
Expand All @@ -158,11 +158,11 @@
<xsl:apply-templates select="Series" mode="xmetadissplusPeriodicalPart" />
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="Series" mode="metadata_prefix_mode" />
<xsl:apply-templates select="Series" />
</xsl:otherwise>
</xsl:choose>

<xsl:apply-templates select="Licence" mode="metadata_prefix_mode" />
<xsl:apply-templates select="Licence" />

<!-- thesis.degree only, if type doctoral or habilitation -->
<xsl:if test="@Type='bachelorthesis' or @Type='doctoralthesis' or @Type='habilitation' or @Type='masterthesis'
Expand Down Expand Up @@ -228,12 +228,12 @@
<ddb:fileNumber>
<xsl:value-of select="count(File)"/>
</ddb:fileNumber>
<xsl:apply-templates select="File" mode="metadata_prefix_mode" />
<xsl:apply-templates select="File" />
<xsl:if test="File">
<xsl:apply-templates select="TransferUrl" mode="metadata_prefix_mode" />
<xsl:apply-templates select="TransferUrl" />
</xsl:if>

<xsl:apply-templates select="Identifier[@Type = 'url']" mode="metadata_prefix_mode" />
<xsl:apply-templates select="Identifier[@Type = 'url']" />

<ddb:identifier ddb:type="URL">
<xsl:value-of select="@frontdoorurl" />
Expand All @@ -248,7 +248,7 @@
</xMetaDiss:xMetaDiss>
</xsl:template>

<xsl:template match="TitleMain" mode="metadata_prefix_mode">
<xsl:template match="TitleMain" >
<dc:title xsi:type="ddb:titleISO639-2">
<xsl:attribute name="lang">
<xsl:value-of select="php:functionString('Opus\Common\Language::getLanguageCode', @Language)" />
Expand All @@ -264,7 +264,7 @@
</dc:title>
</xsl:template>

<xsl:template match="TitleSub" mode="metadata_prefix_mode">
<xsl:template match="TitleSub" >
<dcterms:alternative xsi:type="ddb:talternativeISO639-2">
<xsl:attribute name="lang">
<xsl:value-of select="php:functionString('Opus\Common\Language::getLanguageCode', @Language)" />
Expand All @@ -280,7 +280,7 @@
</dcterms:alternative>
</xsl:template>

<xsl:template match="PersonAuthor" mode="metadata_prefix_mode">
<xsl:template match="PersonAuthor" >
<dc:creator xsi:type="pc:MetaPers">
<pc:person>
<xsl:if test="normalize-space(@IdentifierGnd)">
Expand Down Expand Up @@ -321,7 +321,7 @@
</dc:creator>
</xsl:template>

<xsl:template match="@CreatingCorporation" mode="metadata_prefix_mode">
<xsl:template match="@CreatingCorporation" >
<dc:creator xsi:type="pc:MetaPers">
<pc:person>
<pc:name type="otherName" otherNameType="organisation">
Expand All @@ -333,7 +333,7 @@
</dc:creator>
</xsl:template>

<xsl:template match="@ContributingCorporation" mode="metadata_prefix_mode">
<xsl:template match="@ContributingCorporation" >
<dc:creator xsi:type="pc:MetaPers">
<pc:person>
<pc:name type="otherName" otherNameType="organisation">
Expand All @@ -345,25 +345,25 @@
</dc:creator>
</xsl:template>

<xsl:template match="Collection[@RoleName='ddc' and @Visible=1]" mode="metadata_prefix_mode">
<xsl:template match="Collection[@RoleName='ddc' and @Visible=1]" >
<dc:subject xsi:type="xMetaDiss:DDC-SG">
<xsl:value-of select="@Number" />
</dc:subject>
</xsl:template>

<xsl:template match="Subject[@Type='swd']" mode="metadata_prefix_mode">
<xsl:template match="Subject[@Type='swd']" >
<dc:subject xsi:type="xMetaDiss:SWD">
<xsl:value-of select="@Value" />
</dc:subject>
</xsl:template>

<xsl:template match="Subject[@Type='uncontrolled']" mode="metadata_prefix_mode">
<xsl:template match="Subject[@Type='uncontrolled']" >
<dc:subject xsi:type="xMetaDiss:noScheme">
<xsl:value-of select="@Value" />
</dc:subject>
</xsl:template>

<xsl:template match="TitleAbstract" mode="metadata_prefix_mode">
<xsl:template match="TitleAbstract" >
<dcterms:abstract xsi:type="ddb:contentISO639-2" ddb:type="noScheme">
<xsl:attribute name="lang">
<xsl:value-of select="php:functionString('Opus\Common\Language::getLanguageCode', @Language)" />
Expand All @@ -372,7 +372,7 @@
</dcterms:abstract>
</xsl:template>

<xsl:template match="PersonAdvisor" mode="metadata_prefix_mode">
<xsl:template match="PersonAdvisor" >
<dc:contributor xsi:type="pc:Contributor" type="dcterms:ISO3166" thesis:role="advisor">
<pc:person>
<xsl:if test="normalize-space(@IdentifierGnd)">
Expand Down Expand Up @@ -413,7 +413,7 @@
</dc:contributor>
</xsl:template>

<xsl:template match="PersonReferee" mode="metadata_prefix_mode">
<xsl:template match="PersonReferee" >
<dc:contributor xsi:type="pc:Contributor" type="dcterms:ISO3166" thesis:role="referee">
<pc:person>
<xsl:if test="normalize-space(@IdentifierGnd)">
Expand Down Expand Up @@ -454,7 +454,7 @@
</dc:contributor>
</xsl:template>

<xsl:template match="PersonEditor" mode="metadata_prefix_mode">
<xsl:template match="PersonEditor" >
<dc:contributor xsi:type="pc:Contributor" type="dcterms:ISO3166" thesis:role="editor">
<pc:person>
<xsl:if test="normalize-space(@IdentifierGnd)">
Expand Down Expand Up @@ -495,7 +495,7 @@
</dc:contributor>
</xsl:template>

<xsl:template match="ThesisPublisher" mode="metadata_prefix_mode">
<xsl:template match="ThesisPublisher" >
<dc:publisher xsi:type="cc:Publisher" type="dcterms:ISO3166">
<cc:universityOrInstitution>
<cc:name>
Expand All @@ -511,13 +511,13 @@
</dc:publisher>
</xsl:template>

<xsl:template match="Identifier[@Type = 'urn']" mode="metadata_prefix_mode">
<xsl:template match="Identifier[@Type = 'urn']" >
<dc:identifier xsi:type="urn:nbn">
<xsl:value-of select="@Value" />
</dc:identifier>
</xsl:template>

<xsl:template match="Identifier[@Type = 'doi']" mode="metadata_prefix_mode">
<xsl:template match="Identifier[@Type = 'doi']" >
<dc:identifier xsi:type="doi:doi">
<xsl:value-of select="@Value" />
</dc:identifier>
Expand All @@ -529,33 +529,33 @@
</ddb:identifier>
</xsl:template>

<xsl:template match="Licence" mode="metadata_prefix_mode">
<xsl:template match="Licence" >
<dc:rights>
<xsl:value-of select="@NameLong" />
</dc:rights>
</xsl:template>

<xsl:template match="File" mode="metadata_prefix_mode">
<xsl:template match="File" >
<ddb:fileProperties ddb:fileName="{@PathName}" ddb:fileSize="{@FileSize}">
<xsl:attribute name="ddb:fileID">
<xsl:text>file</xsl:text><xsl:value-of select="../@Id"/>-<xsl:value-of select="position()-1"/>
</xsl:attribute>
</ddb:fileProperties>
</xsl:template>

<xsl:template match="TransferUrl" mode="metadata_prefix_mode">
<xsl:template match="TransferUrl" >
<ddb:transfer ddb:type="dcterms:URI">
<xsl:value-of select="@PathName" />
</ddb:transfer>
</xsl:template>

<xsl:template match="Identifier[@Type = 'url']" mode="metadata_prefix_mode">
<xsl:template match="Identifier[@Type = 'url']" >
<ddb:identifier ddb:type="URL">
<xsl:value-of select="@Value" />
</ddb:identifier>
</xsl:template>

<xsl:template match="TitleParent" mode="metadata_prefix_mode">
<xsl:template match="TitleParent" >
<dc:source xsi:type="ddb:noScheme">
<xsl:value-of select="@Value" />
<xsl:if test="../@Volume != ''">
Expand All @@ -582,7 +582,7 @@
</dc:source>
</xsl:template>

<xsl:template match="Series" mode="metadata_prefix_mode">
<xsl:template match="Series" >
<dcterms:isPartOf xsi:type="ddb:noScheme">
<xsl:value-of select="@Title" />
<xsl:text> ; </xsl:text>
Expand Down
2 changes: 1 addition & 1 deletion modules/oai/views/scripts/index/prefixes/copy_xml.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

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

<xsl:template match="Opus_Document" mode="metadata_prefix_mode">
<xsl:template match="Opus_Document" >
<xsl:copy-of select="."/>
</xsl:template>

Expand Down
12 changes: 6 additions & 6 deletions modules/oai/views/scripts/index/prefixes/epicur.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

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

<xsl:template match="Opus_Document" mode="metadata_prefix_mode">
<xsl:template match="Opus_Document" >
<epicur
xsi:schemaLocation="urn:nbn:de:1111-2004033116 http://www.persistent-identifier.de/xepicur/version1.0/xepicur.xsd"
xmlns="urn:nbn:de:1111-2004033116"
Expand All @@ -59,7 +59,7 @@

<record>
<!-- Identifier URN -->
<xsl:apply-templates select="Identifier[@Type = 'urn']" mode="metadata_prefix_mode" />
<xsl:apply-templates select="Identifier[@Type = 'urn']" />

<resource>
<identifier scheme="url" role="primary">
Expand All @@ -71,24 +71,24 @@
</format>
</resource>

<xsl:apply-templates select="File" mode="metadata_prefix_mode"/>
<xsl:apply-templates select="File" />

</record>

</epicur>
</xsl:template>


<xsl:template match="Identifier[@Type = 'urn']" mode="metadata_prefix_mode">
<xsl:template match="Identifier[@Type = 'urn']" >
<identifier scheme="urn:nbn:de">
<xsl:value-of select="@Value" />
</identifier>
</xsl:template>

<!-- skip container file -->
<xsl:template match="File[@DnbContainer='1']" mode="metadata_prefix_mode" />
<xsl:template match="File[@DnbContainer='1']" />

<xsl:template match="File" mode="metadata_prefix_mode">
<xsl:template match="File" >
<resource>
<identifier scheme="url">
<xsl:value-of select="@url"/>
Expand Down
14 changes: 7 additions & 7 deletions modules/oai/views/scripts/index/prefixes/marc21.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
>
<xsl:output method="xml" indent="yes"/>

<xsl:template match="Opus_Document" mode="metadata_prefix_mode">
<xsl:template match="Opus_Document" >
<marc:collection xmlns:marc="http://www.loc.gov/MARC21/slim"
xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd">
<marc:record>
Expand Down Expand Up @@ -232,7 +232,7 @@
</xsl:for-each>

<!-- PersonAutor, nur der erste Autor -->
<xsl:apply-templates select="./PersonAuthor[position() = 1]" mode="metadata_prefix_mode">
<xsl:apply-templates select="./PersonAuthor[position() = 1]" >
<xsl:with-param name="tag">100</xsl:with-param>
<xsl:with-param name="role">aut</xsl:with-param>
</xsl:apply-templates>
Expand Down Expand Up @@ -436,25 +436,25 @@
</marc:datafield>

<!-- Sonstige Autoren -->
<xsl:apply-templates select="./PersonAuthor[position() &gt; 1]" mode="metadata_prefix_mode">
<xsl:apply-templates select="./PersonAuthor[position() &gt; 1]" >
<xsl:with-param name="tag">700</xsl:with-param>
<xsl:with-param name="role">aut</xsl:with-param>
</xsl:apply-templates>

<!-- PersonEditor -->
<xsl:apply-templates select="./PersonEditor" mode="metadata_prefix_mode">
<xsl:apply-templates select="./PersonEditor" >
<xsl:with-param name="tag">700</xsl:with-param>
<xsl:with-param name="role">edt</xsl:with-param>
</xsl:apply-templates>

<!-- PersonAdvisor -->
<xsl:apply-templates select="./PersonAdvisor" mode="metadata_prefix_mode">
<xsl:apply-templates select="./PersonAdvisor" >
<xsl:with-param name="tag">700</xsl:with-param>
<xsl:with-param name="role">dgs</xsl:with-param>
</xsl:apply-templates>

<!-- PersonContributor -->
<xsl:apply-templates select="./PersonContributor" mode="metadata_prefix_mode">
<xsl:apply-templates select="./PersonContributor" >
<xsl:with-param name="tag">700</xsl:with-param>
<xsl:with-param name="role">ctb</xsl:with-param>
</xsl:apply-templates>
Expand Down Expand Up @@ -590,7 +590,7 @@
</marc:collection>
</xsl:template>

<xsl:template match="PersonAuthor|PersonEditor|PersonAdvisor|PersonContributor" mode="metadata_prefix_mode">
<xsl:template match="PersonAuthor|PersonEditor|PersonAdvisor|PersonContributor" >
<xsl:param name="tag"/>
<xsl:param name="role"/>
<marc:datafield ind1="1" ind2=" " tag='{$tag}'>
Expand Down
Loading

0 comments on commit 2cb1b40

Please sign in to comment.