Commit a0e052df authored by Steinberg, Jan's avatar Steinberg, Jan
Browse files

new test for giga import etc.

parent 102d7a69
......@@ -51,8 +51,9 @@ public class XmlXsltBundlesStreamSource implements BundlesStreamSource {
public Stream<Bundle> getBundlesStream() {
try {
TransformerFactory factory = TransformerFactory.newInstance("org.apache.xalan.processor.TransformerFactoryImpl", TransformerFactoryImpl.class.getClassLoader() );
Templates xslTemplate = factory.newTemplates( new StreamSource( new StringReader(xslt) ) );
StringReader strReader = new StringReader(xslt);
StreamSource streamSource = new StreamSource( strReader );
Templates xslTemplate = factory.newTemplates( streamSource );
Source xmlInput = new StreamSource( new StringReader(xmlPayload) );
......
......@@ -276,6 +276,33 @@ public class XmlXsltBundlesStreamSourceTest {
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.type.stock")).count() );
assertEquals("monograph", metadata.stream().filter(m -> m.getKey().equals("dc.type.stock")).findFirst().get().getValue() );
}
@Test
public void testGigaXml() throws IOException {
String gigaXmlString = IOUtils.toString(
getClass().
getClassLoader().
getResourceAsStream("xml/africa-spectrum/10.1177_186810261804700101.xml"), StandardCharsets.UTF_8);
LOG.info("gigaXmlString={}", gigaXmlString);
String xsltString = IOUtils.toString(
getClass().
getClassLoader().
getResourceAsStream("xslt/giga-2-xmlbundle.xslt"), StandardCharsets.UTF_8);
LOG.info("xsltString={}", xsltString);
XmlXsltBundlesStreamSource underTest = new XmlXsltBundlesStreamSource(gigaXmlString, xsltString, 6666);
Stream<Bundle> stream = underTest.getBundlesStream();
assertEquals(2, stream.count() );
assertEquals( "xmlxslt-bundlessource-6666", underTest.getReference() );
LOG.info("Under Test Ref: {}", underTest.getReference());
Bundle testBundle = underTest.getBundlesStream().filter(b -> b.getReference().equals("CCA@@10.1177_186810261804700101") ).findFirst().get();
assertEquals(1, testBundle.getMetadata().stream().filter(m -> m.getKey().equals("dc.title")).count() );
assertEquals("“Project Battle” or “Policy War”?: Protest, Advocacy, and the Outcomes of Environmental Contention in China", testBundle.getMetadata().stream().filter(m -> m.getKey().equals("dc.title")).findFirst().get().getValue() );
}
@Test
public void testTranscriptVerlagOnix() throws IOException {
......
<?xml version="1.0" encoding="UTF-8"?>
<OAI-PMH xmlns="http://www.openarchives.org/OAI/2.0/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<responseDate>2017-09-06T14:00:51Z</responseDate>
<request verb="GetRecord" identifier="oai:hup.sub.uni-hamburg.de.giga:article/1052" metadataPrefix="xMetaDissPlus">https://journals.sub.uni-hamburg.de/giga/afsp/oai</request>
<GetRecord>
<record>
<header>
<identifier>oai:hup.sub.uni-hamburg.de.giga:article/1052</identifier>
<datestamp>2017-08-04T09:30:43Z</datestamp>
<setSpec>afsp:ANAREP</setSpec>
</header>
<metadata>
<xMetaDiss:xMetaDiss xmlns:xMetaDiss="http://www.d-nb.de/standards/xmetadissplus/"
xmlns:cc="http://www.d-nb.de/standards/cc/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:dcmitype="http://purl.org/dc/dcmitype/"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:pc="http://www.d-nb.de/standards/pc/"
xmlns:urn="http://www.d-nb.de/standards/urn/"
xmlns:hdl="http://www.d-nb.de/standards/hdl/"
xmlns:doi="http://www.d-nb.de/standards/doi/"
xmlns:thesis="http://www.ndltd.org/standards/metadata/etdms/1.0/"
xmlns:ddb="http://www.d-nb.de/standards/ddb/"
xmlns:dini="http://www.d-nb.de/standards/xmetadissplus/type/"
xmlns="http://www.d-nb.de/standards/subject/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
<dc:title xsi:type="ddb:titleISO639-2" lang="ger">Pressefreiheit und das nigerianische Gesetz zur Internetkriminalität von 2015: eine Bewertung</dc:title>
<dc:title xsi:type="ddb:titleISO639-2" lang="eng">Press Freedom and Nigeria’s Cybercrime Act of 2015: An Assessment</dc:title>
<dc:creator xsi:type="pc:MetaPers">
<pc:person>
<pc:name type="nameUsedByThePerson">
<pc:foreName>Raymond</pc:foreName>
<pc:surName>Adibe</pc:surName>
</pc:name>
</pc:person>
</dc:creator>
<dc:creator xsi:type="pc:MetaPers">
<pc:person>
<pc:name type="nameUsedByThePerson">
<pc:foreName>Cyril Chinedu</pc:foreName>
<pc:surName>Ike</pc:surName>
</pc:name>
</pc:person>
</dc:creator>
<dc:creator xsi:type="pc:MetaPers">
<pc:person>
<pc:name type="nameUsedByThePerson">
<pc:foreName>Celestine Uchechukwu</pc:foreName>
<pc:surName>Udeogu</pc:surName>
</pc:name>
</pc:person>
</dc:creator>
<dc:subject xsi:type="dcterms:DDC">070, 320, 323, 324</dc:subject>
<dc:subject xsi:type="xMetaDiss:noScheme">Politische Wissenschaft</dc:subject>
<dc:subject xsi:type="xMetaDiss:noScheme">political science</dc:subject>
<dc:subject xsi:type="xMetaDiss:noScheme">Politisches System, Massenmedien, Internet, Journalisten, Rechtsstaatlichkeit/Rechtsstaat, Kommunikations- und Medienkontrolle, Pressefreiheit, Medienrecht</dc:subject>
<dc:subject xsi:type="xMetaDiss:noScheme">political systems, mass media, Internet, journalists, rule of law, communication and media control, freedom of the press, media law</dc:subject>
<dcterms:abstract xsi:type="ddb:contentISO639-2" lang="ger">Die Autoren dieses Beitrags prüfen den nigerianischen Cybercrime Act von 2015 sowie dessen Auswirkungen auf die Informationsfreiheit im Internet im liberal-autoritär regierten Nigeria. Insbesondere untersuchen sie, inwieweit der Charakter der politischen Führung des Landes dazu beiträgt, dass das Gesetz in rechtswidriger Weise angewendet wird mit dem Ziel, die Pressefreiheit zu unterminieren. Die Autoren legen dar, dass sich die Position Nigerias auf der Rangliste der Pressefreiheit im Internet seit Inkrafttreten des Cybercrime Act im Jahr 2015 kontinuierlich verschlechtert hat. Sie plädieren für einen ganzheitlichen demokratischen Ansatz, der von einer untrennbaren Verbindung von ökonomischer und politischer Freiheit ausgeht.</dcterms:abstract>
<dcterms:abstract xsi:type="ddb:contentISO639-2" lang="eng">This study assesses the Cybercrime Act 2015 and its implications for online press freedom in the liberal authoritarian state of Nigeria. Specifically, the study examines how the character of political leadership in Nigeria leads to wrongful application of the act to undermine the independence of the press. The study shows that Nigeria’s online press freedom index has consistently worsened since the introduction of the Cybercrime Act in 2015, and it recommends the promotion of a holistic democratic project that recognises economic and political freedom as being inextricably linked.</dcterms:abstract>
<dc:publisher xsi:type="cc:Publisher">
<cc:universityOrInstitution>
<cc:name>German Institute of Global and Area Studies (GIGA)</cc:name>
<cc:place>Hamburg</cc:place>
</cc:universityOrInstitution>
<cc:address>Neuer Jungfernstieg 21, 20354 Hamburg</cc:address>
</dc:publisher>
<dc:publisher xsi:type="cc:Publisher">
<cc:universityOrInstitution>
<cc:name>Hamburg University Press</cc:name>
<cc:place>Hamburg</cc:place>
</cc:universityOrInstitution>
<cc:address>Von-Melle-Park 3, 20146 Hamburg</cc:address>
</dc:publisher>
<dcterms:issued xsi:type="dcterms:W3CDTF">2017-08-04</dcterms:issued>
<dc:type xsi:type="dini:PublType">article</dc:type>
<dc:identifier xsi:type="urn:nbn">urn:nbn:de:gbv:18-4-10521</dc:identifier>
<dcterms:medium xsi:type="dcterms:IMT">application/pdf</dcterms:medium>
<dc:language xsi:type="dcterms:ISO639-2">eng</dc:language>
<dcterms:isPartOf xsi:type="ddb:ZSTitelID">1868-6869</dcterms:isPartOf>
<dcterms:isPartOf xsi:type="ddb:ZS-Volume">52</dcterms:isPartOf>
<dcterms:isPartOf xsi:type="ddb:ZS-Issue">2</dcterms:isPartOf>
<dc:rights xsi:type="ddb:noScheme">&lt;p&gt;Die Autoren des übermittelten Beitrags sichern das Folgende zu: &lt;br /&gt;&lt;br /&gt; 1. Sie wurden von ihren Ko-Autoren autorisiert, die folgenden Vereinbarungen einzugehen. &lt;br /&gt;&lt;br /&gt; 2. Das eingereichte Manuskript wurde von ihnen selbst verfasst und noch nicht an anderer Stelle veröffentlicht (außer in Form einer Zusammenfassung oder im Rahmen eines veröffentlichten Vortrags, Berichts oder Arbeitspapiers). Eine Veröffentlichung des Manuskriptes wird nicht gleichzeitig an anderer Stelle geprüft. Der Veröffentlichung stimmen alle beteiligten Autoren zu und alle diese Autoren sind auch berechtigt, Vereinbarungen zu treffen. &lt;br /&gt;&lt;br /&gt; 3. Sie sichern die Freiheit von Rechten Dritter an den dem Verlag eingeräumten Nutzungsrechten sowie ihre Verfügungsbefugnis über dieselben zu. Dies gilt auch in Bezug auf die durch sie beschafften fremden Text- und/oder Bildvorlagen. &lt;br /&gt;&lt;br /&gt; 4. Ihr Manuskript enthält nichts, was ungesetzlich oder ehrenrührig wäre oder im Falle einer Veröffentlichung einen Vertrags- oder Vertrauensbruch oder Geheimnisverrat darstellen würde. &lt;br /&gt;&lt;br /&gt; 5. Werden die Vertragsparteien einzeln oder gemeinsam durch Dritte wegen der Leistungen der Autoren nach Absatz 1, 2, 3 oder 4 auf Schadensersatz und/oder Kosten einer Rechtsverfolgung in Anspruch genommen, so stellen die Autoren den Verlag von Ansprüchen Dritter frei und erstatten dem Verlag anfallende notwendige Rechtskosten.&lt;br /&gt;&lt;br /&gt; 6. Sie stimmen den folgenden Lizenz- und Copyrightbestimmungen zu: &lt;br /&gt;&lt;br /&gt; &lt;/p&gt;&lt;ul&gt;&lt;strong&gt;Copyright-Vereinbarung&lt;/strong&gt;&lt;br /&gt;Autoren, die in Africa Spectrum veröffentlichen, stimmen den folgenden Bedingungen zu: &lt;br /&gt;1. Das Copyright für Beiträge verbleibt bei den Autoren; sie überlassen der Zeitschrift Africa Spectrum das Recht der Erstveröffentlichung in gedruckter Form und im Internet. Die Beiträge werden im Rahmen der &lt;a href=&quot;http://creativecommons.org/licenses/by-nd/3.0/de/deed.de&quot; target=&quot;_blank&quot;&gt;Creative Commons Attribution-No Derivative Works License&lt;/a&gt; verbreitet, die anderen Personen die Teilhabe erlaubt, wenn sie auf die Autoren sowie die Erstveröffentlichung in dieser Zeitschrift hinweisen und die Beiträge nicht verändern oder abwandeln. Die Lizenz bezieht sich sowohl auf elektronische als auch auf gedruckte Versionen der Beiträge. &lt;br /&gt;2. Autoren sind berechtigt, separate, zusätzliche vertragliche Vereinbarungen zur nicht-exklusiven Verbreitung der von Africa Spectrum publizierten Version ihres Beitrags einzugehen (z.B. über ein institutionelles Repositorium oder in einem Sammelband), wenn sie auf die Erstveröffentlichung in Africa Spectrum hinweisen. &lt;br /&gt;3. Die Autoren gewähren dem GIGA das Recht, gedruckte Exemplare der Zeitschrift an Bibliotheken und Personen zu verkaufen sowie den Beitrag selbst, seinen Titel und seine Zusammenfassung in Datenbanken, bei Abstract-, Index- und ähnlichen Informationsdienstleistern einzugeben. &lt;br /&gt;4. Gerichtsstand ist Hamburg. &lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://creativecommons.org/licenses/by-nd/3.0/de/legalcode&quot; target=&quot;_blank&quot;&gt;Zum Volltext der Creative Commons-Lizenz&lt;/a&gt;&lt;/ul&gt;</dc:rights>
<dc:rights xsi:type="ddb:noScheme">&lt;p&gt;&lt;strong&gt;Authors' Certification&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;In submitting the manuscript, the authors certify that: &lt;br /&gt;&lt;br /&gt; 1. They are authorised by their co-authors to enter into these arrangements. &lt;br /&gt;&lt;br /&gt; 2. The submitted manuscript is original and has not been published before (except in the form of an abstract or as part of a published lecture, review, thesis or working paper), that it is not under consideration for publication elsewhere, that its publication has been approved by all the authors and that the authors have full authority to enter into this agreement. &lt;br /&gt;&lt;br /&gt; 3. They warrant and represent that they have the full power and authority to enter into and execute this agreement and to convey the rights granted herein, and that such rights are not now subject to prior assignment, transfer or other encumbrance. This also applies to the text and photo originals attained from other sources (for which the authors have secured the right to reproduce any material that has already been published or copyrighted elsewhere). &lt;br /&gt;&lt;br /&gt; 4. Their manuscript contains nothing that is unlawful, libellous, or which would, if published, constitute a breach of contract or of confidence or of commitment given to secrecy. &lt;br /&gt;&lt;br /&gt; 5. In the event that the parties to this agreement, either individually or collectively, are held responsible for damages or the costs of a legal process undertaken by a third party as a result of the authors’ actions under points 1, 2, 3, and 4, the authors agree to release the publisher from the claims of the third party and to compensate the publisher for any resulting legal costs. &lt;br /&gt;&lt;br /&gt;6. They agree to the following license and copyright agreement: &lt;/p&gt;&lt;ul&gt;&lt;strong&gt;Copyright Agreement&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt; Authors who publish with this journal agree to the following terms:&lt;br /&gt; 1. Authors retain copyright and grant the journal right of first publication in print and online. The work is distributed under the &lt;a href=&quot;http://creativecommons.org/licenses/by-nd/3.0/de/deed.en&quot; target=&quot;_blank&quot;&gt;Creative Commons Attribution-No Derivative Works License&lt;/a&gt;, which allows others to share the work with an acknowledgement of the work's authorship and initial publication in this journal. However, the work may not be altered or transformed. The license is valid for both electronic and paper copies. &lt;br /&gt; 2. Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgement of its initial publication in this journal.&lt;br /&gt; 3. Authors grant GIGA commercial rights to produce hardcopy volumes of the journal for sale to libraries and individuals, as well as to integrate the work, its title, and its abstract in databases, abstracting and indexing services, and other similar information sources.&lt;br /&gt; 4. Court of jurisdiction is Hamburg, Germany. &lt;a href=&quot;http://creativecommons.org/licenses/by-nd/3.0/de/legalcode&quot; target=&quot;_blank&quot;&gt;&lt;br /&gt;&lt;br /&gt;The full legal code of this license&lt;/a&gt; (in German)&lt;/ul&gt;</dc:rights>
<ddb:fileNumber>1</ddb:fileNumber>
<ddb:fileProperties ddb:fileName="1052-1090-1-PB.pdf">1052-1090-1-PB.pdf</ddb:fileProperties>
<ddb:transfer ddb:type="dcterms:URI">https://journals.sub.uni-hamburg.de/giga/afsp/article/download/1052/1059</ddb:transfer>
<ddb:identifier ddb:type="URL">https://journals.sub.uni-hamburg.de/giga/afsp/article/view/1052</ddb:identifier>
<ddb:rights ddb:kind="free"/>
</xMetaDiss:xMetaDiss>
</metadata>
</record>
</GetRecord>
</OAI-PMH>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:cc="http://www.d-nb.de/standards/cc/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:dcmitype="http://purl.org/dc/dcmitype/"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:ddb="http://www.d-nb.de/standards/ddb/"
xmlns:dini="http://www.d-nb.de/standards/xmetadissplus/type/"
xmlns:doi="http://www.d-nb.de/standards/doi/"
xmlns:hdl="http://www.d-nb.de/standards/hdl/"
xmlns:mml="http://www.w3.org/1998/Math/MathML"
xmlns:nlm="http://dtd.nlm.nih.gov/publishing/2.3"
xmlns:oai="http://www.openarchives.org/OAI/2.0/"
xmlns:oai_marc="http://www.openarchives.org/OAI/1.1/oai_marc"
xmlns:pc="http://www.d-nb.de/standards/pc/"
xmlns:thesis="http://www.ndltd.org/standards/metadata/etdms/1.0/"
xmlns:urn="http://www.d-nb.de/standards/urn/"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xMetaDiss="http://www.d-nb.de/standards/xmetadissplus/"
xmlns:xoai="http://www.lyncode.com/xoai"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
<xsl:output indent="yes" exclude-result-prefixes="#all"/>
<xsl:strip-space elements="*"/>
<!-- <xsl:message terminate="no">here is the tree at the current node <xsl:copy-of select="."/> </xsl:message> -->
<!-- <xsl:message terminate="no">here is some message for stderr, e.g. <xsl:value-of select='text()' /> </xsl:message> -->
<!--
<xsl:for-each select="./*">
<xsl:message terminate="no">a child=<xsl:value-of select="name()"/></xsl:message>
</xsl:for-each>
-->
<!-- override default template -->
<xsl:template match="*" />
<xsl:template match="/article">
<xsl:element name="bundles">
<xsl:element name="bundle">
<xsl:element name="metadata">
<xsl:variable name="ddaReference" select="concat(front/journal-meta/journal-id[@journal-id-type='publisher-id'], '@@', front/article-meta/article-id[@pub-id-type='publisher-id'])" />
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'internal.dda.reference'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="$ddaReference"/>
</xsl:call-template>
<xsl:apply-templates select="front/journal-meta" />
<xsl:apply-templates select="front/article-meta" />
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.type.stock'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'article'"/>
</xsl:call-template>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.language'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'en'"/>
</xsl:call-template>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.type.document'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'32'"/>
</xsl:call-template>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.rights.licence'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'2'"/>
</xsl:call-template>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.description.pubstatus'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'1'"/>
</xsl:call-template>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.publisher.country'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'DEU'"/>
</xsl:call-template>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'ssoar.urn.registration'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'false'"/>
</xsl:call-template>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'internal.status'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'formal und inhaltlich fertig erschlossen'"/>
</xsl:call-template>
<xsl:choose>
<xsl:when test="/article/@article-type ='research-article'">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.description.review'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'1'"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.description.review'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'2'"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
</xsl:element>
<xsl:element name="bundle">
<xsl:element name="metadata">
<xsl:variable name="ddaReference" select="concat(front/journal-meta/journal-id[@journal-id-type='publisher-id'], '@@', front/article-meta/article-id[@pub-id-type='publisher-id'])" />
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'internal.dda.reference'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="$ddaReference"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:template>
<xsl:template match="front/journal-meta">
<xsl:apply-templates select="journal-title-group/journal-title"/>
</xsl:template>
<xsl:template match="front/article-meta">
<xsl:apply-templates select="article-id[@pub-id-type='doi']"/>
<xsl:apply-templates select="title-group/article-title"/>
<xsl:apply-templates select="title-group/trans-title-group/trans-title"/>
<xsl:apply-templates select="contrib-group/contrib[@contrib-type='author']"/>
<xsl:apply-templates select="abstract"/>
<xsl:apply-templates select="trans-abstract"/>
<xsl:apply-templates select="kwd-group[@xml:lang='de']/kwd"/>
<xsl:apply-templates select="kwd-group[@xml:lang!='de']/kwd"/>
<xsl:apply-templates select="volume"/>
<xsl:apply-templates select="issue"/>
<xsl:apply-templates select="fpage"/>
<xsl:apply-templates select="pub-date[@pub-type='epub-ppub']"/>
</xsl:template>
<xsl:template match="article-id[@pub-id-type='doi']">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.identifier.doi'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="concat('https://doi.org/', text())"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="title-group/article-title">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.title'"/>
<xsl:with-param name="language" select="'en'"/>
<xsl:with-param name="value" select="normalize-space(text())"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="title-group/trans-title-group/trans-title">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.title.alternative'"/>
<xsl:with-param name="language" select="../@xml:lang"/>
<xsl:with-param name="value" select="normalize-space(text())"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="contrib-group/contrib[@contrib-type='author']">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.contributor.author'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="concat(name/surname, ', ', name/given-names)"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="abstract">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.description.abstract'"/>
<xsl:with-param name="language" select="'en'"/>
<xsl:with-param name="value" select="normalize-space(.)"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="trans-abstract">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.description.abstract'"/>
<xsl:with-param name="language" select="@xml:lang"/>
<xsl:with-param name="value" select="normalize-space(.)"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="kwd-group[@xml:lang='de']/kwd">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.subject.other'"/>
<xsl:with-param name="language" select="'de'"/>
<xsl:with-param name="value" select="text()"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="kwd-group[@xml:lang!='de']/kwd">
<xsl:choose>
<xsl:when test="../kwd-group[@xml:lang='de']/kwd">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.subject.other'"/>
<xsl:with-param name="language" select="'de'"/>
<xsl:with-param name="value" select="text()"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.subject.other'"/>
<xsl:with-param name="language" select="'en'"/>
<xsl:with-param name="value" select="text()"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="volume">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.source.volume'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="."/>
</xsl:call-template>
</xsl:template>
<xsl:template match="issue">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.source.issue'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="."/>
</xsl:call-template>
</xsl:template>
<xsl:template match="fpage">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.source.pageinfo'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="concat(., '-', ../lpage)"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="pub-date[@pub-type='epub-ppub']">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.date.issued'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="year/text()"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="journal-title-group/journal-title">
<xsl:choose>
<xsl:when test="text() = 'Africa Spectrum'">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.source.journal'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'10'"/>
</xsl:call-template>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.identifier.issn'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'1868-6869'"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="text() = 'Journal of Current Chinese Affairs'">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.source.journal'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'192'"/>
</xsl:call-template>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.identifier.issn'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'1868-4874'"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="text() = 'Journal of Politics in Latin America'">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.source.journal'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'202'"/>
</xsl:call-template>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.identifier.issn'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'1868-4890'"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="text() = 'Journal of Current Southeast Asian Affairs'">
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.source.journal'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'193'"/>
</xsl:call-template>
<xsl:call-template name="new-metadatum">
<xsl:with-param name="key" select="'dc.identifier.issn'"/>
<xsl:with-param name="language" select="''"/>
<xsl:with-param name="value" select="'1868-4882'"/>
</xsl:call-template>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template name="new-metadatum">
<xsl:param name="key" />
<xsl:param name="language" />
<xsl:param name="value" />
<xsl:element name="metadatum">
<xsl:element name="key">
<xsl:value-of select="$key" />
</xsl:element>
<xsl:element name="language">
<xsl:value-of select="$language" />
</xsl:element>
<xsl:element name="value">
<xsl:value-of select="$value" />
</xsl:element>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
......@@ -2,9 +2,10 @@
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:pica="info:srw/schema/5/picaXML-v1.0"
exclude-result-prefixes="pica"
>
<xsl:output indent="yes"/>
<xsl:output indent="yes" />
<xsl:strip-space elements="*"/>
<!-- <xsl:message terminate="no">here is the tree at the current node <xsl:copy-of select="."/> </xsl:message> -->
<!-- <xsl:message terminate="no">here is some message for stderr, e.g. <xsl:value-of select='text()' /> </xsl:message> -->
......@@ -46,8 +47,19 @@
<identifier>
<issn>0343-3668</issn>
</identifier>
<xsl:for-each select="record/datafield">
<xsl:if test="./tag = '31A'">
<source>
<volume>
<xsl:value-of select="./subfield/content"/>
</volume>
</source>
</xsl:if>
</xsl:for-each>
<xsl:apply-templates select="pica:record" />
</dc>
<xsl:apply-templates select="pica:record" />
</publication>
</xsl:template>
<xsl:template match="pica:record">
......@@ -58,7 +70,7 @@
<xsl:apply-templates select="pica:datafield[@tag='028C']"/>
<xsl:apply-templates select="pica:datafield[@tag='009P']"/>
</xsl:template>
<!--xsl:template match="pica:datafield[@tag='021A']">
<dc>
<title>
......@@ -66,85 +78,72 @@
</title>
</dc>
</xsl:template-->
<xsl:template match="pica:datafield[@tag='031A']">
<dc>
<source>
<xsl:if test="pica:subfield[@code='d']/text()">
<volume>
<xsl:value-of select="pica:subfield[@code='d']/text()"/>
</volume>
</xsl:if>
<xsl:if test="pica:subfield[@code='h']/text()">
<pageinfo>
<xsl:value-of select="pica:subfield[@code='h']/text()"/>
</pageinfo>
</xsl:if>
</source>
<xsl:if test="pica:subfield[@code='j']/text()">
<date>
<issued>
<xsl:value-of select="pica:subfield[@code='j']/text()"/>
</issued>
</date>
<source>
<xsl:if test="pica:subfield[@code='d']/text()">
<volume>
<xsl:value-of select="pica:subfield[@code='d']/text()"/>
</volume>
</xsl:if>
<xsl:if test="pica:subfield[@code='h']/text()">
<pageinfo>
<xsl:value-of select="pica:subfield[@code='h']/text()"/>
</pageinfo>
</xsl:if>
</source>
<xsl:if test="pica:subfield[@code='j']/text()">
<date>
<issued>
<xsl:value-of select="pica:subfield[@code='j']/text()"/>
</issued>
</date>
</xsl:if>
<xsl:choose>
<xsl:when test="string-length(/pica:record/pica:datafield[@tag='039I']/pica:subfield[@code='t']/text()) > 0">
<title>
<xsl:value-of select="/pica:record/pica:datafield[@tag='039I']/pica:subfield[@code='t']/text()"/>
</title>
</xsl:when>
<xsl:otherwise>
<title>
<xsl:value-of select="/pica:record/pica:datafield[@tag='021A']/pica:subfield[@code='a']/text()"/>
<xsl:if test="/pica:record/pica:datafield[@tag='021A']/pica:subfield[@code='d']">
<xsl:text>: </xsl:text>
<xsl:value-of select="/pica:record/pica:datafield[@tag='021A']/pica:subfield[@code='d']/text()"/>
</xsl:if>
<xsl:choose>
<xsl:when test="string-length(/pica:record/pica:datafield[@tag='039I']/pica:subfield[@code='t']/text()) > 0">
<title>
<xsl:value-of select="/pica:record/pica:datafield[@tag='039I']/pica:subfield[@code='t']/text()"/>
</title>
</xsl:when>
<xsl:otherwise>
<title>
<xsl:value-of select="/pica:record/pica:datafield[@tag='021A']/pica:subfield[@code='a']/text()"/>
<xsl:if test="/pica:record/pica:datafield[@tag='021A']/pica:subfield[@code='d']">
<xsl:text>: </xsl:text>
<xsl:value-of select="/pica:record/pica:datafield[@tag='021A']/pica:subfield[@code='d']/text()"/>
</xsl:if>
</title>
</xsl:otherwise>
</xsl:choose>
</dc>
</xsl:template>
</title>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="pica:datafield[@tag='028A']">
<dc>