- Timestamp:
- 11/02/10 10:36:32 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
metadata/trunk/toolkit/xslt/olac2cmdi.xsl
r818 r829 2 2 <xsl:stylesheet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 3 3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" 4 xmlns:dc="http://purl.org/dc/elements/1.1/" 4 xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" 5 5 xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" 6 6 xmlns:defns="http://www.openarchives.org/OAI/2.0/" 7 7 xmlns:olac="http://www.language-archives.org/OLAC/1.0/" 8 xmlns:olac11="http://www.language-archives.org/OLAC/1.1/" 8 9 xsi:schemaLocation=" http://purl.org/dc/elements/1.1/ http://www.language-archives.org/OLAC/1.0/dc.xsd http://purl.org/dc/terms/ http://www.language-archives.org/OLAC/1.0/dcterms.xsd http://www.language-archives.org/OLAC/1.0/ http://www.language-archives.org/OLAC/1.0/olac.xsd http://www.language-archives.org/OLAC/1.0/third-party/software.xsd "> 9 10 … … 12 13 <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> 13 14 14 <!-- identity copy -->15 <!-- <xsl:template match="@*|node()">16 <xsl:copy>17 <xsl:apply-templates select="@*|node()"/>18 </xsl:copy>19 </xsl:template>20 -->21 22 15 <xsl:template match="/"> 23 16 <CMD 24 xsi:schemaLocation="http://www.clarin.eu/cmd http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/profiles/clarin.eu:cr1:p_12 71859438236/xsd">17 xsi:schemaLocation="http://www.clarin.eu/cmd http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/profiles/clarin.eu:cr1:p_1288172614026/xsd"> 25 18 <Header> 26 19 <MdCreator>olac2cmdi.xsl</MdCreator> … … 41 34 <xsl:value-of select="//defns:identifier"/> 42 35 </MdSelfLink> 43 <MdProfile>clarin.eu:cr1:p_12 71859438236</MdProfile>36 <MdProfile>clarin.eu:cr1:p_1288172614026</MdProfile> 44 37 </Header> 45 38 <Resources> … … 49 42 </Resources> 50 43 <Components> 51 <olac> 52 44 <OLAC-DcmiTerms> 45 46 <xsl:apply-templates select="//dcterms:abstract"/> 47 <xsl:apply-templates select="//dcterms:accessRights"/> 48 <xsl:apply-templates select="//dcterms:accrualMethod"/> 49 <xsl:apply-templates select="//dcterms:accrualPeriodicity"/> 50 <xsl:apply-templates select="//dcterms:accrualPolicy"/> 51 <xsl:apply-templates select="//dcterms:alternative"/> 52 <xsl:apply-templates select="//dcterms:audience"/> 53 <xsl:apply-templates select="//dcterms:available"/> 54 <xsl:apply-templates select="//dcterms:bibliographicCitation"/> 55 <xsl:apply-templates select="//dcterms:conformsTo"/> 56 53 57 <xsl:apply-templates select="//dc:contributor"/> 54 58 <xsl:apply-templates select="//dc:coverage"/> 59 60 <xsl:apply-templates select="//dcterms:created"/> 61 55 62 <xsl:apply-templates select="//dc:creator"/> 56 63 <xsl:apply-templates select="//dc:date"/> 64 65 <xsl:apply-templates select="//dcterms:dateAccepted"/> 66 <xsl:apply-templates select="//dcterms:dateCopyrighted"/> 67 <xsl:apply-templates select="//dcterms:dateSubmitted"/> 68 57 69 <xsl:apply-templates select="//dc:description"/> 70 71 <xsl:apply-templates select="//dcterms:educationLevel"/> 72 <xsl:apply-templates select="//dcterms:extent"/> 73 58 74 <xsl:apply-templates select="//dc:format"/> 75 76 <xsl:apply-templates select="//dcterms:hasFormat"/> 77 <xsl:apply-templates select="//dcterms:hasPart"/> 78 <xsl:apply-templates select="//dcterms:hasVersion"/> 79 59 80 <xsl:apply-templates select="//dc:identifier"/> 81 82 <xsl:apply-templates select="//dc:instructionalMethod"/> 83 84 <xsl:apply-templates select="//dcterms:isFormatOf"/> 85 <xsl:apply-templates select="//dcterms:isPartOf"/> 86 <xsl:apply-templates select="//dcterms:isReferencedBy"/> 87 <xsl:apply-templates select="//dcterms:isReplacedBy"/> 88 <xsl:apply-templates select="//dcterms:isRequiredBy"/> 89 <xsl:apply-templates select="//dcterms:issued"/> 90 <xsl:apply-templates select="//dcterms:isVersionOf"/> 91 60 92 <xsl:apply-templates select="//dc:language"/> 93 94 <xsl:apply-templates select="//dcterms:license"/> 95 <xsl:apply-templates select="//dcterms:mediator"/> 96 <xsl:apply-templates select="//dcterms:medium"/> 97 <xsl:apply-templates select="//dcterms:modified"/> 98 <xsl:apply-templates select="//dcterms:provenance"/> 99 61 100 <xsl:apply-templates select="//dc:publisher"/> 101 102 <xsl:apply-templates select="//dcterms:references"/> 103 62 104 <xsl:apply-templates select="//dc:relation"/> 105 106 <xsl:apply-templates select="//dcterms:replaces"/> 107 <xsl:apply-templates select="//dcterms:requires"/> 108 63 109 <xsl:apply-templates select="//dc:rights"/> 110 111 <xsl:apply-templates select="//dcterms:rightsHolder"/> 112 64 113 <xsl:apply-templates select="//dc:source"/> 114 115 <xsl:apply-templates select="//dcterms:spatial"/> 116 65 117 <xsl:apply-templates select="//dc:subject"/> 118 119 <xsl:apply-templates select="//dcterms:tableOfContents"/> 120 <xsl:apply-templates select="//dcterms:temporal"/> 121 66 122 <xsl:apply-templates select="//dc:title"/> 67 123 <xsl:apply-templates select="//dc:type"/> 68 69 </olac> 124 125 <xsl:apply-templates select="//dcterms:valid"/> 126 127 </OLAC-DcmiTerms> 70 128 </Components> 71 129 </CMD> … … 73 131 74 132 <xsl:template match="dc:contributor"> 75 < olac-contributor>133 <contributor> 76 134 <xsl:if test="@xsi:type='olac:role'"> 77 135 <xsl:attribute name="olac-role"> 78 <xsl:value-of select="@olac:code"/> 136 <!-- note: namespace wildcard necessary to match with both OLAC 1.0 and 1.1 --> 137 <xsl:value-of select="@*:code"/> 79 138 </xsl:attribute> 80 139 </xsl:if> 81 <xsl:value-of select="."/> 82 </olac-contributor> 83 </xsl:template> 84 85 86 <xsl:template match="dc:creator"> 87 <olac-creator> 88 <xsl:value-of select="."/> 89 </olac-creator> 90 </xsl:template> 91 92 <xsl:template match="dc:date"> 93 <olac-date> 94 <xsl:value-of select="."/> 95 </olac-date> 140 <xsl:value-of select="."/> 141 </contributor> 96 142 </xsl:template> 97 143 98 144 <xsl:template match="dc:description"> 99 <olac-description> 100 <xsl:apply-templates select="./@xml:lang"/> 101 <xsl:value-of select="."/> 102 </olac-description> 103 </xsl:template> 104 105 <xsl:template match="dc:format"> 106 <olac-format> 107 <xsl:value-of select="."/> 108 </olac-format> 109 </xsl:template> 110 111 <xsl:template match="dc:identifier"> 112 <olac-identifier> 113 <xsl:value-of select="."/> 114 </olac-identifier> 115 </xsl:template> 116 117 <xsl:template match="dc:language"> 118 <olac-language> 119 <xsl:value-of select="."/> 120 </olac-language> 145 <description> 146 <xsl:apply-templates select="./@xml:lang"/> 147 <xsl:value-of select="."/> 148 </description> 121 149 </xsl:template> 122 150 123 151 <xsl:template match="dc:language[@xsi:type='olac:language']" priority="3"> 124 < olac-language>152 <language> 125 153 <xsl:attribute name="olac-language"> 126 <xsl:value-of select="@olac:code"/> 127 </xsl:attribute> 128 </olac-language> 129 </xsl:template> 130 131 132 <xsl:template match="dc:publisher"> 133 <olac-publisher> 134 <xsl:value-of select="."/> 135 </olac-publisher> 136 </xsl:template> 137 138 <xsl:template match="dc:relation"> 139 <olac-relation> 140 <xsl:value-of select="."/> 141 </olac-relation> 142 </xsl:template> 143 144 145 <xsl:template match="dc:rights"> 146 <olac-rights> 147 <xsl:value-of select="."/> 148 </olac-rights> 149 </xsl:template> 150 151 152 <xsl:template match="//dc:subject[@xsi:type='olac:linguistic-field']" priority="3"> 153 <olac-subject> 154 <xsl:value-of select="@*:code"/> 155 </xsl:attribute> 156 </language> 157 </xsl:template> 158 159 <xsl:template match="dc:subject[@xsi:type='olac:language']" priority="3"> 160 <subject> 161 <xsl:attribute name="olac-language"> 162 <xsl:value-of select="@*:code"/> 163 </xsl:attribute> 164 </subject> 165 </xsl:template> 166 167 <xsl:template match="//dc:subject[@xsi:type='olac:linguistic-field']" priority="3"> 168 <subject> 154 169 <xsl:attribute name="olac-linguistic-field"> 155 <xsl:value-of select="@ olac:code"/>156 </xsl:attribute> 157 </ olac-subject>170 <xsl:value-of select="@*:code"/> 171 </xsl:attribute> 172 </subject> 158 173 </xsl:template> 159 174 160 175 <xsl:template match="//dc:subject[@xsi:type='olac:discourse-type']" priority="3"> 161 < olac-subject>176 <subject> 162 177 <xsl:attribute name="olac-discourse-type"> 163 <xsl:value-of select="@ olac:code"/>164 </xsl:attribute> 165 </ olac-subject>178 <xsl:value-of select="@*:code"/> 179 </xsl:attribute> 180 </subject> 166 181 </xsl:template> 167 182 168 183 169 184 <xsl:template match="//dc:subject" priority="1"> 170 < olac-subject>185 <subject> 171 186 <xsl:apply-templates select="./@xml:lang"/> 172 187 <xsl:value-of select="."/> 173 </ olac-subject>188 </subject> 174 189 </xsl:template> 175 190 … … 186 201 <type> 187 202 <xsl:attribute name="olac-discourse-type"> 188 <xsl:value-of select="@ olac:code"/>203 <xsl:value-of select="@*:code"/> 189 204 </xsl:attribute> 190 205 </type> … … 195 210 <type> 196 211 <xsl:attribute name="olac-linguistic-type"> 197 <xsl:value-of select="@ olac:code"/>212 <xsl:value-of select="@*:code"/> 198 213 </xsl:attribute> 199 214 </type> … … 212 227 </xsl:attribute> 213 228 </xsl:template> 229 230 231 <!-- general DC template --> 232 <xsl:template match="dc:*"> 233 <xsl:variable name="tagname"> 234 <xsl:value-of select="local-name()"/> 235 </xsl:variable> 236 <xsl:element name="{$tagname}"> 237 <xsl:value-of select="."/> 238 </xsl:element> 239 </xsl:template> 240 241 <!-- general DC terms template --> 242 <xsl:template match="dcterms:*"> 243 <xsl:variable name="tagname"> 244 <xsl:value-of select="local-name()"/> 245 </xsl:variable> 246 <xsl:element name="{$tagname}"> 247 <xsl:value-of select="."/> 248 </xsl:element> 249 </xsl:template> 250 214 251 215 252
Note: See TracChangeset
for help on using the changeset viewer.