- npm updates, delete cd 0.3.3
- aslo add collection for GetRecord request - add src/utils/utility-functions.ts - don't create empty xml caches
This commit is contained in:
parent
ea568123f1
commit
10b1fb0c86
10 changed files with 133 additions and 77 deletions
|
@ -8,8 +8,6 @@
|
|||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd">
|
||||
|
||||
<!--<xsl:param name="urnResolverUrl" />-->
|
||||
|
||||
<!-- add include here for each new metadata format -->
|
||||
<xsl:include href="assets/oai_datacite.xslt" />
|
||||
<xsl:include href="assets/oai_2_iso19139.xslt" />
|
||||
|
@ -47,11 +45,56 @@
|
|||
|
||||
<xsl:variable name="langCodes" select="document('assets/langCodeMap.xml')/langCodeMap/langCode"/>
|
||||
|
||||
<!-- Characters we'll support.
|
||||
We could add control chars 0-31 and 127-159, but we won't. -->
|
||||
<xsl:variable name="ascii"> !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~</xsl:variable>
|
||||
<xsl:variable name="latin1"> ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ</xsl:variable>
|
||||
<!-- Characters that usually don't need to be escaped -->
|
||||
<xsl:variable name="safe">!'()*-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~</xsl:variable>
|
||||
<xsl:variable name="hex" >0123456789ABCDEF</xsl:variable>
|
||||
|
||||
<xsl:template name="url-encode">
|
||||
<xsl:param name="str"/>
|
||||
<xsl:if test="$str">
|
||||
<xsl:variable name="first-char" select="substring($str,1,1)"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains($safe,$first-char)">
|
||||
<xsl:value-of select="$first-char"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:variable name="codepoint">
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains($ascii,$first-char)">
|
||||
<xsl:value-of select="string-length(substring-before($ascii,$first-char)) + 32"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="contains($latin1,$first-char)">
|
||||
<xsl:value-of select="string-length(substring-before($latin1,$first-char)) + 160"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:message terminate="no">Warning: string contains a character that is out of range! Substituting "?".</xsl:message>
|
||||
<xsl:text>63</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="hex-digit1" select="substring($hex,floor($codepoint div 16) + 1,1)"/>
|
||||
<xsl:variable name="hex-digit2" select="substring($hex,$codepoint mod 16 + 1,1)"/>
|
||||
<xsl:value-of select="concat('%',$hex-digit1,$hex-digit2)"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:if test="string-length($str) > 1">
|
||||
<xsl:call-template name="url-encode">
|
||||
<xsl:with-param name="str" select="substring($str,2)"/>
|
||||
</xsl:call-template>
|
||||
</xsl:if>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!--create the head of oai response -->
|
||||
<xsl:template match="/root">
|
||||
<!-- stylesheet for browser -->
|
||||
<xsl:processing-instruction name="xml-stylesheet">
|
||||
<xsl:text>type="text/xsl" href="../assets/oai2_style.xslt" title="Defaultstyle"</xsl:text>
|
||||
<xsl:text>type="text/xsl" href="assets/oai2_style.xslt"</xsl:text>
|
||||
</xsl:processing-instruction>
|
||||
|
||||
<OAI-PMH xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd">
|
||||
|
@ -416,7 +459,10 @@
|
|||
<xsl:apply-templates select="Identifier" mode="oai_dc" />
|
||||
</xsl:if> -->
|
||||
<dc:identifier>
|
||||
<xsl:value-of select="@landingpage" />
|
||||
<xsl:value-of select="string(@landingpage)" />
|
||||
<!-- <xsl:call-template name="url-encode">
|
||||
<xsl:with-param name="str" select="@landingpage"/>
|
||||
</xsl:call-template> -->
|
||||
</dc:identifier>
|
||||
<!-- dc:language -->
|
||||
<xsl:apply-templates select="@Language" mode="oai_dc" />
|
||||
|
@ -553,21 +599,23 @@
|
|||
<xsl:value-of select="@Value" />
|
||||
</dc:subject>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="Collection" mode="oai_dc">
|
||||
<dc:subject>
|
||||
<!-- <xsl:if test="@Language != ''">
|
||||
<xsl:attribute name="xml:lang">
|
||||
<xsl:value-of select="@Language" />
|
||||
</xsl:attribute>
|
||||
</xsl:if> -->
|
||||
<xsl:attribute name="xml:lang">
|
||||
<xsl:value-of select="@Language" />
|
||||
</xsl:attribute>
|
||||
</xsl:if> -->
|
||||
<xsl:value-of select="concat(string(@Collectionrole.Name), ':', string(@Number))" />
|
||||
</dc:subject>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="Reference" mode="oai_dc">
|
||||
<dc:relation>
|
||||
<xsl:value-of select="@Value" />
|
||||
<xsl:value-of select="string(@Value)" />
|
||||
<!-- <xsl:call-template name="url-encode">
|
||||
<xsl:with-param name="str" select="@Value"/>
|
||||
</xsl:call-template> -->
|
||||
</dc:relation>
|
||||
</xsl:template>
|
||||
|
||||
|
@ -673,7 +721,10 @@
|
|||
<xsl:template match="Identifier" mode="oai_dc">
|
||||
<dc:relation>
|
||||
<!-- <xsl:value-of select="concat($doiLink, @Value)" /> -->
|
||||
<xsl:value-of select="concat($doiPrefix, @Value)" />
|
||||
<xsl:value-of select="concat($doiPrefix, string(@Value))" />
|
||||
<!-- <xsl:call-template name="url-encode">
|
||||
<xsl:with-param name="str" select="concat($doiPrefix, @Value)"/>
|
||||
</xsl:call-template> -->
|
||||
</dc:relation>
|
||||
</xsl:template>
|
||||
|
||||
|
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue