diff --git a/import/xsl/doaj.xsl b/import/xsl/doaj.xsl index 611bf64f45a6ff17f4b635aa3486c455c013def5..615de066bf03aaa8fd458d218725c9eb2369c4d9 100644 --- a/import/xsl/doaj.xsl +++ b/import/xsl/doaj.xsl @@ -3,17 +3,17 @@ xmlns:php="http://php.net/xsl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/2001/XMLSchema-instance" - xmlns:doaj="http://www.doaj.org/schemas/"> + xmlns:oai_doaj="http://doaj.org/features/oai_doaj/1.0/"> <xsl:output method="xml" indent="yes" encoding="utf-8"/> - <xsl:param name="institution">My University</xsl:param> + <xsl:param name="institution">Directory of Open Access Journals</xsl:param> <xsl:param name="collection">DOAJ</xsl:param> - <xsl:template match="doaj:record"> + <xsl:template match="oai_doaj:doajArticle"> <add> <doc> <!-- ID --> <!-- Important: This relies on an <identifier> tag being injected by the OAI-PMH harvester. --> <field name="id"> - <xsl:value-of select="//doaj:doajIdentifier"/> + <xsl:value-of select="//identifier"/> </field> <!-- RECORDTYPE --> @@ -22,13 +22,13 @@ <!-- FULLRECORD --> <!-- disabled for now; records are so large that they cause memory problems! <field name="fullrecord"> - <xsl:copy-of select="php:function('VuFind::xmlAsText', /doaj:record)"/> + <xsl:copy-of select="php:function('VuFind::xmlAsText', /oai_doaj:record)"/> </field> --> <!-- ALLFIELDS --> <field name="allfields"> - <xsl:value-of select="normalize-space(string(/doaj:record))"/> + <xsl:value-of select="normalize-space(string(/oai_doaj:doajArticle))"/> </field> <!-- INSTITUTION --> @@ -42,16 +42,11 @@ </field> <!-- LANGUAGE --> - <!-- TODO: add language support; in practice, there don't seem to be - many records with <language> tags in them. If we encounter any, - the code below is partially complete, but we probably need to - build a new language map for ISO 639-2b, which is the standard - specified by the DOAJ XML schema. - <xsl:if test="/doaj:record/doaj:language"> - <xsl:for-each select="/doaj:record/doaj:language"> + <xsl:if test="/oai_doaj:doajArticle/oai_doaj:language"> + <xsl:for-each select="/oai_doaj:doajArticle/oai_doaj:language"> <xsl:if test="string-length() > 0"> <field name="language"> - <xsl:value-of select="php:function('VuFind::mapString', normalize-space(string(.)), 'language_map_iso639-1.properties')"/> + <xsl:value-of select="php:function('VuFind::mapString', normalize-space(string(.)), 'language_map.properties')"/> </field> </xsl:if> </xsl:for-each> @@ -62,8 +57,8 @@ <field name="format">Article</field> <!-- AUTHOR --> - <xsl:if test="//doaj:authors/doaj:author/doaj:name"> - <xsl:for-each select="//doaj:authors/doaj:author/doaj:name"> + <xsl:if test="//oai_doaj:authors/oai_doaj:author/oai_doaj:name"> + <xsl:for-each select="//oai_doaj:authors/oai_doaj:author/oai_doaj:name"> <xsl:if test="normalize-space()"> <field name="author"> <xsl:value-of select="normalize-space()"/> @@ -79,69 +74,69 @@ </xsl:if> <!-- TITLE --> - <xsl:if test="//doaj:title[normalize-space()]"> + <xsl:if test="//oai_doaj:title[normalize-space()]"> <field name="title"> - <xsl:value-of select="//doaj:title[normalize-space()]"/> + <xsl:value-of select="//oai_doaj:title[normalize-space()]"/> </field> <field name="title_short"> - <xsl:value-of select="//doaj:title[normalize-space()]"/> + <xsl:value-of select="//oai_doaj:title[normalize-space()]"/> </field> <field name="title_full"> - <xsl:value-of select="//doaj:title[normalize-space()]"/> + <xsl:value-of select="//oai_doaj:title[normalize-space()]"/> </field> <field name="title_sort"> - <xsl:value-of select="php:function('VuFind::stripArticles', string(//doaj:title[normalize-space()]))"/> + <xsl:value-of select="php:function('VuFind::stripArticles', string(//oai_doaj:title[normalize-space()]))"/> </field> </xsl:if> <!-- PUBLISHER --> - <xsl:if test="//doaj:publisher[normalize-space()]"> + <xsl:if test="//oai_doaj:publisher[normalize-space()]"> <field name="publisher"> - <xsl:value-of select="//doaj:publisher[normalize-space()]"/> + <xsl:value-of select="//oai_doaj:publisher[normalize-space()]"/> </field> </xsl:if> <!-- SERIES --> - <xsl:if test="//doaj:journalTitle[normalize-space()]"> + <xsl:if test="//oai_doaj:journalTitle[normalize-space()]"> <field name="series"> - <xsl:value-of select="//doaj:journalTitle[normalize-space()]"/> + <xsl:value-of select="//oai_doaj:journalTitle[normalize-space()]"/> </field> </xsl:if> <!-- ISSN --> - <xsl:if test="//doaj:issn[normalize-space()]"> + <xsl:if test="//oai_doaj:issn[normalize-space()]"> <field name="issn"> - <xsl:value-of select="//doaj:issn[normalize-space()]"/> + <xsl:value-of select="//oai_doaj:issn[normalize-space()]"/> </field> </xsl:if> <!-- ISSN --> - <xsl:if test="//doaj:eissn[normalize-space()]"> + <xsl:if test="//oai_doaj:eissn[normalize-space()]"> <field name="issn"> - <xsl:value-of select="//doaj:eissn[normalize-space()]"/> + <xsl:value-of select="//oai_doaj:eissn[normalize-space()]"/> </field> </xsl:if> <!-- PUBLISHDATE --> - <xsl:if test="//doaj:publicationDate"> + <xsl:if test="//oai_doaj:publicationDate"> <field name="publishDate"> - <xsl:value-of select="//doaj:publicationDate"/> + <xsl:value-of select="//oai_doaj:publicationDate"/> </field> <field name="publishDateSort"> - <xsl:value-of select="//doaj:publicationDate"/> + <xsl:value-of select="//oai_doaj:publicationDate"/> </field> </xsl:if> <!-- DESCRIPTION --> - <xsl:if test="//doaj:abstract"> + <xsl:if test="//oai_doaj:abstract"> <field name="description"> - <xsl:value-of select="//doaj:abstract" /> + <xsl:value-of select="//oai_doaj:abstract" /> </field> </xsl:if> <!-- SUBJECT --> - <xsl:if test="//doaj:keywords"> - <xsl:for-each select="//doaj:keywords/doaj:keyword"> + <xsl:if test="//oai_doaj:keywords"> + <xsl:for-each select="//oai_doaj:keywords/oai_doaj:keyword"> <xsl:if test="string-length() > 0"> <field name="topic"> <xsl:value-of select="normalize-space()"/> @@ -151,13 +146,13 @@ </xsl:if> <!-- URL --> - <xsl:if test="//doaj:fullTextUrl"> + <xsl:if test="//oai_doaj:fullTextUrl"> <xsl:choose> - <xsl:when test="contains(//doaj:fullTextUrl, '://')"> - <field name="url"><xsl:value-of select="//doaj:fullTextUrl[normalize-space()]"/></field> + <xsl:when test="contains(//oai_doaj:fullTextUrl, '://')"> + <field name="url"><xsl:value-of select="//oai_doaj:fullTextUrl[normalize-space()]"/></field> </xsl:when> <xsl:otherwise> - <field name="url">http://<xsl:value-of select="//doaj:fullTextUrl[normalize-space()]"/></field> + <field name="url">http://<xsl:value-of select="//oai_doaj:fullTextUrl[normalize-space()]"/></field> </xsl:otherwise> </xsl:choose> </xsl:if>