Project

General

Profile

1
<?xml version="1.0" encoding="UTF-8"?>
2
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3
                version="1.0">
4

    
5
	<xsl:param name="parentDatasourceId"/>
6
	<xsl:param name="namespacePrefix"/>
7

    
8
	<xsl:template match="/">
9
		<xsl:variable name="oName" select="normalize-space(//column[./@name='1'])"/>
10

    
11
		<xsl:choose>
12
			<xsl:when test="string-length($oName) &gt; 0">
13
				<record>
14
					<xsl:copy-of select=".//*[local-name()='header']"/>
15
					<metadata>
16
						<xsl:variable name="rid" select="normalize-space(//column[./@name='journalid'])"/>
17
						<xsl:variable name="datasourceId" select="concat($namespacePrefix, '::', $rid)"/>
18
						<xsl:variable name="namespacePrefix" select='format-number($rid, "00000")'/>
19

    
20
						<ROWS>
21
							<ROW table="datasources">
22
								<FIELD name="id">
23
									<xsl:value-of select="$datasourceId"/>
24
								</FIELD>
25
								<FIELD name="_dnet_resource_identifier_">
26
									<xsl:value-of select="$datasourceId"/>
27
								</FIELD>
28
								<FIELD name="officialname">
29
									<xsl:value-of select="$oName"/>
30
								</FIELD>
31
								<FIELD name="englishname">
32
									<xsl:value-of select="$oName"/>
33
								</FIELD>
34
								<FIELD name="od_contenttypes">
35
									<xsl:value-of select="string('Journal articles')"/>
36
								</FIELD>
37
								<FIELD name="websiteurl">
38
									<xsl:value-of select="normalize-space(//column[./@name='2'])"/>
39
								</FIELD>
40
								<FIELD name="namespaceprefix">
41
									<xsl:value-of select="concat('irdb___',$namespacePrefix)"/>
42
								</FIELD>
43
								<FIELD name="datasourceclass">pubsrepository::journal</FIELD>
44
								<FIELD name="collectedfrom">
45
									<xsl:value-of select="$parentDatasourceId"/>
46
								</FIELD>
47
							</ROW>
48
						</ROWS>
49
					</metadata>
50
				</record>
51
			</xsl:when>
52
			<xsl:otherwise>
53
				<JUNK/>
54
			</xsl:otherwise>
55
		</xsl:choose>
56
	</xsl:template>
57
</xsl:stylesheet>
(11-11/27)