Changeset 1035
- Timestamp:
- 01/04/11 13:26:56 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
metadata/trunk/toolkit/xslt/imdi2clarin.xsl
r180 r1035 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xpath-default-namespace="http://www.mpi.nl/IMDI/Schema/IMDI"> 3 4 <xsl:output method="xml" indent="yes" /> 5 2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" 3 xpath-default-namespace="http://www.mpi.nl/IMDI/Schema/IMDI"> 4 <!-- this is a version of imdi2clarin.xsl that batch processes a whole directory structure of imdi files, call it from the command line like this: 5 java -jar saxon8.jar -it main batch-imdi2clarin.xsl 6 the last template in this file has to be modified to reflect the actual directory name 7 --> 8 <xsl:output method="xml" indent="yes"/> 9 10 <xsl:template name="metatranscriptDelegate"> 11 <Header> 12 <MdSelfLink>test-<xsl:value-of select="@ArchiveHandle"/></MdSelfLink> 13 </Header> 14 <Resources> 15 <ResourceProxyList> 16 <xsl:apply-templates select="//Resources" mode="linking"/> 17 <xsl:apply-templates select="//Corpus" mode="linking"/> 18 </ResourceProxyList> 19 <JournalFileProxyList> </JournalFileProxyList> 20 <ResourceRelationList> </ResourceRelationList> 21 </Resources> 22 <Components> 23 <xsl:apply-templates select="Session"/> 24 <xsl:apply-templates select="Corpus"/> 25 </Components> 26 </xsl:template> 27 6 28 <xsl:template match="METATRANSCRIPT"> 7 <CMD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 8 xsi:noNamespaceSchemaLocation="http://www.clarin.eu/cmd/components/imdi/imdi_md_schema.xsd"> 9 <Header> 10 <Description> 11 </Description> 12 <Creator> 13 </Creator> 14 <CreationDate> 15 </CreationDate> 16 <SelfLink> 17 </SelfLink> 18 <Profile> 19 </Profile> 20 </Header> 21 <Resources> 22 <ResourceProxyList> 23 <xsl:apply-templates select="//Resources" mode="linking"/> 24 </ResourceProxyList> 25 <JournalFileProxyList> 26 </JournalFileProxyList> 27 <ResourceRelationList> 28 </ResourceRelationList> 29 </Resources> 30 <Components> 31 <xsl:apply-templates select="Session" /> 32 </Components> 33 </CMD> 34 35 </xsl:template> 36 29 <xsl:choose> 30 <xsl:when test=".[@Type='SESSION'] or .[@Type='SESSION.Profile']"> 31 <CMD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 32 xsi:schemaLocation="http://www.clarin.eu/cmd http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/profiles/clarin.eu:cr1:p_1271859438204/xsd"> 33 <xsl:call-template name="metatranscriptDelegate"/> 34 </CMD> 35 </xsl:when> 36 <xsl:when test=".[@Type='CORPUS'] or .[@Type='CORPUS.Profile']"> 37 <CMD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 38 xsi:schemaLocation="http://www.clarin.eu/cmd http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/profiles/clarin.eu:cr1:p_1274880881885/xsd"> 39 <xsl:call-template name="metatranscriptDelegate"/> 40 </CMD> 41 </xsl:when> 42 <xsl:otherwise> 43 <!-- Currently we are only processing 'SESSION' and 'CORPUS' types. The error displayed can be used to filter out erroneous files after processing--> 44 ERROR: Invalid METATRANSCRIPT Type! 45 </xsl:otherwise> 46 </xsl:choose> 47 </xsl:template> 48 49 50 <xsl:template match="Corpus"> 51 <imdi-corpus> 52 <Corpus> 53 <xsl:apply-templates select="child::Name"/> 54 <xsl:apply-templates select="child::Title"/> 55 <xsl:if test="exists(child::Description)"> 56 <descriptions> 57 <xsl:for-each select="Description"> 58 <Description> 59 <xsl:attribute name="LanguageId" select="@LanguageId"/> 60 <xsl:value-of select="."/> 61 </Description> 62 </xsl:for-each> 63 </descriptions> 64 </xsl:if> 65 <xsl:if test="exists(child::CorpusLink)"> 66 <xsl:for-each select="CorpusLink"> 67 <CorpusLink> 68 <CorpusLinkContent> 69 <!--<xsl:attribute name="ArchiveHandle" select="@ArchiveHandle"/>--> 70 <xsl:attribute name="Name" select="@Name"/> 71 <xsl:value-of select="."/> 72 </CorpusLinkContent> 73 </CorpusLink> 74 </xsl:for-each> 75 </xsl:if> 76 </Corpus> 77 </imdi-corpus> 78 </xsl:template> 79 80 <xsl:template match="Corpus" mode="linking"> 81 <xsl:for-each select="CorpusLink"> 82 <ResourceProxy id="{generate-id()}"> 83 <ResourceType>Metadata</ResourceType> 84 <ResourceRef><xsl:value-of select="."/>.cmdi</ResourceRef> 85 </ResourceProxy> 86 </xsl:for-each> 87 </xsl:template> 88 37 89 <xsl:template match="Resources" mode="linking"> 38 90 <xsl:for-each select="MediaFile"> 39 <ResourceProxy id="{generate-id()}"> 40 <ResourceType>Resource</ResourceType> 41 <ResourceRef><xsl:value-of select="replace(ResourceLink,'file:/data/corpora','http://corpus1.mpi.nl')"/></ResourceRef> 91 <ResourceProxy id="{generate-id()}"> 92 <ResourceType> 93 <xsl:if test="exists(Format) and not(empty(Format))"> 94 <xsl:attribute name="mimetype"> 95 <xsl:value-of select="./Format"/> 96 </xsl:attribute> 97 </xsl:if>Resource</ResourceType> 98 <ResourceRef> 99 <xsl:value-of select="ResourceLink/@ArchiveHandle"/> 100 </ResourceRef> 42 101 </ResourceProxy> 43 102 </xsl:for-each> 44 103 <xsl:for-each select="WrittenResource"> 45 <ResourceProxy id="{generate-id()}"> 46 <ResourceType>Resource</ResourceType> 47 <ResourceRef><xsl:value-of select="replace(ResourceLink,'file:/data/corpora','http://corpus1.mpi.nl')"/></ResourceRef> 104 <ResourceProxy id="{generate-id()}"> 105 <ResourceType> 106 <xsl:if test="exists(Format) and not(empty(Format))"> 107 <xsl:attribute name="mimetype"> 108 <xsl:value-of select="./Format"/> 109 </xsl:attribute> 110 </xsl:if>Resource</ResourceType> 111 <ResourceRef> 112 <xsl:value-of select="ResourceLink/@ArchiveHandle"/> 113 </ResourceRef> 48 114 </ResourceProxy> 49 115 </xsl:for-each> 50 116 </xsl:template> 51 117 52 118 <xsl:template match="Session"> 53 119 <Session> … … 63 129 </Description> 64 130 </xsl:for-each> 65 </descriptions> 66 </xsl:if> 131 </descriptions> 132 </xsl:if> 67 133 <xsl:apply-templates select="child::MDGroup"/> 68 134 <xsl:apply-templates select="child::Resources" mode="regular"/> … … 70 136 </Session> 71 137 </xsl:template> 72 138 73 139 <xsl:template match="child::Name"> 74 140 <Name> … … 76 142 </Name> 77 143 </xsl:template> 78 144 79 145 <xsl:template match="child::Title"> 80 146 <Title> … … 82 148 </Title> 83 149 </xsl:template> 84 150 85 151 <xsl:template match="child::Date"> 86 152 <Date> … … 88 154 </Date> 89 155 </xsl:template> 90 91 <!-- <xsl:template match="//Description"> 92 <descriptions> 93 <Description> 94 <xsl:attribute name="LanguageId" select="@LanguageId"/> 95 <xsl:value-of select="."/> 96 </Description> 97 </descriptions> 98 </xsl:template> 99 --> 100 156 101 157 <xsl:template match="child::MDGroup"> 102 158 <MDGroup> … … 105 161 <xsl:apply-templates select="child::Keys"/> 106 162 <xsl:apply-templates select="child::Content"/> 107 <xsl:apply-templates select="child::Actors"/> 163 <xsl:apply-templates select="child::Actors"/> 108 164 </MDGroup> 109 165 </xsl:template> 110 166 111 167 <xsl:template match="Location"> 112 168 <Location> 113 <Continent><xsl:value-of select="child::Continent"/></Continent> 114 <Country><xsl:value-of select="child::Country"/></Country> 169 <Continent> 170 <xsl:value-of select="child::Continent"/> 171 </Continent> 172 <Country> 173 <xsl:value-of select="child::Country"/> 174 </Country> 115 175 <xsl:if test="exists(child::Region)"> 116 <Region><xsl:value-of select="child::Region"/></Region> 176 <Region> 177 <xsl:value-of select="child::Region"/> 178 </Region> 117 179 </xsl:if> 118 180 <xsl:if test="exists(child::Address)"> 119 <Address><xsl:value-of select="child::Address"/></Address> 120 </xsl:if> 121 </Location> 122 </xsl:template> 123 181 <Address> 182 <xsl:value-of select="child::Address"/> 183 </Address> 184 </xsl:if> 185 </Location> 186 </xsl:template> 187 124 188 <xsl:template match="Project"> 125 189 <Project> 126 <Name><xsl:value-of select="child::Name"/></Name> 127 <Title><xsl:value-of select="child::Title"/></Title> 128 <Id><xsl:value-of select="child::Id"/></Id> 190 <Name> 191 <xsl:value-of select="child::Name"/> 192 </Name> 193 <Title> 194 <xsl:value-of select="child::Title"/> 195 </Title> 196 <Id> 197 <xsl:value-of select="child::Id"/> 198 </Id> 129 199 <xsl:apply-templates select="Contact"/> 130 200 <xsl:if test="exists(child::Description)"> … … 136 206 </Description> 137 207 </xsl:for-each> 138 </descriptions> 208 </descriptions> 139 209 </xsl:if> 140 210 </Project> 141 211 </xsl:template> 142 212 143 213 <xsl:template match="Contact"> 144 214 <Contact> 145 <Name><xsl:value-of select="child::Name"/></Name> 146 <Address><xsl:value-of select="child::Address"/></Address> 147 <Email><xsl:value-of select="child::Email"/></Email> 148 <Organisation><xsl:value-of select="child::Organisation"/></Organisation> 149 </Contact> 150 </xsl:template> 151 215 <Name> 216 <xsl:value-of select="child::Name"/> 217 </Name> 218 <Address> 219 <xsl:value-of select="child::Address"/> 220 </Address> 221 <Email> 222 <xsl:value-of select="child::Email"/> 223 </Email> 224 <Organisation> 225 <xsl:value-of select="child::Organisation"/> 226 </Organisation> 227 </Contact> 228 </xsl:template> 229 152 230 <xsl:template match="Keys"> 153 231 <Keys> 154 232 <xsl:for-each select="Key"> 155 <Key><xsl:attribute name="Name"><xsl:value-of select="@Name"></xsl:value-of></xsl:attribute><xsl:value-of select="."></xsl:value-of></Key> 233 <Key> 234 <xsl:attribute name="Name"> 235 <xsl:value-of select="@Name"/> 236 </xsl:attribute> 237 <xsl:value-of select="."/> 238 </Key> 156 239 </xsl:for-each> 157 240 </Keys> 158 241 </xsl:template> 159 242 160 243 <xsl:template match="Content"> 161 244 <Content> 162 <Genre><xsl:value-of select="child::Genre"/></Genre> 245 <Genre> 246 <xsl:value-of select="child::Genre"/> 247 </Genre> 163 248 <xsl:if test="exists(child::SubGenre)"> 164 <SubGenre><xsl:value-of select="child::SubGenre"/></SubGenre> 249 <SubGenre> 250 <xsl:value-of select="child::SubGenre"/> 251 </SubGenre> 165 252 </xsl:if> 166 253 <xsl:if test="exists(child::Task)"> 167 <Task><xsl:value-of select="child::Task"/></Task> 254 <Task> 255 <xsl:value-of select="child::Task"/> 256 </Task> 168 257 </xsl:if> 169 258 <xsl:if test="exists(child::Modalities)"> 170 <Modalities><xsl:value-of select="child::Modalities"/></Modalities> 259 <Modalities> 260 <xsl:value-of select="child::Modalities"/> 261 </Modalities> 171 262 </xsl:if> 172 263 <xsl:if test="exists(child::Subject)"> 173 <Subject><xsl:value-of select="child::Subject"/></Subject> 264 <Subject> 265 <xsl:value-of select="child::Subject"/> 266 </Subject> 174 267 </xsl:if> 175 268 <xsl:apply-templates select="child::CommunicationContext"/> … … 184 277 </Description> 185 278 </xsl:for-each> 186 </descriptions> 279 </descriptions> 187 280 </xsl:if> 188 281 </Content> 189 190 </xsl:template> 191 282 283 </xsl:template> 284 192 285 <xsl:template match="CommunicationContext"> 193 286 <CommunicationContext> 194 287 <xsl:if test="exists(child::Interactivity)"> 195 <Interactivity><xsl:value-of select="child::Interactivity"/></Interactivity> 288 <Interactivity> 289 <xsl:value-of select="child::Interactivity"/> 290 </Interactivity> 196 291 </xsl:if> 197 292 <xsl:if test="exists(child::PlanningType)"> 198 <PlanningType><xsl:value-of select="child::PlanningType"/></PlanningType> 293 <PlanningType> 294 <xsl:value-of select="child::PlanningType"/> 295 </PlanningType> 199 296 </xsl:if> 200 297 <xsl:if test="exists(child::Involvement)"> 201 <Involvement><xsl:value-of select="child::Involvement"/></Involvement> 298 <Involvement> 299 <xsl:value-of select="child::Involvement"/> 300 </Involvement> 202 301 </xsl:if> 203 302 <xsl:if test="exists(child::SocialContext)"> 204 <SocialContext><xsl:value-of select="child::SocialContext"/></SocialContext> 303 <SocialContext> 304 <xsl:value-of select="child::SocialContext"/> 305 </SocialContext> 205 306 </xsl:if> 206 307 <xsl:if test="exists(child::EventStructure)"> 207 <EventStructure><xsl:value-of select="child::EventStructure"/></EventStructure> 308 <EventStructure> 309 <xsl:value-of select="child::EventStructure"/> 310 </EventStructure> 208 311 </xsl:if> 209 312 <xsl:if test="exists(child::Channel)"> 210 <Channel><xsl:value-of select="child::Channel"/></Channel> 313 <Channel> 314 <xsl:value-of select="child::Channel"/> 315 </Channel> 211 316 </xsl:if> 212 317 </CommunicationContext> 213 318 </xsl:template> 214 319 215 320 <xsl:template match="Languages" mode="content"> 216 321 <Content_Languages> … … 223 328 </Description> 224 329 </xsl:for-each> 225 </descriptions> 330 </descriptions> 226 331 </xsl:if> 227 332 <xsl:for-each select="Language"> 228 333 <Content_Language> 229 <Id><xsl:value-of select=" ./Id"/></Id> 230 <Name><xsl:value-of select=" ./Name"/></Name> 334 <Id> 335 <xsl:value-of select=" ./Id"/> 336 </Id> 337 <Name> 338 <xsl:value-of select=" ./Name"/> 339 </Name> 231 340 <xsl:if test="exists(child::Dominant)"> 232 <Dominant><xsl:value-of select=" ./Dominant"/></Dominant> 341 <Dominant> 342 <xsl:value-of select=" ./Dominant"/> 343 </Dominant> 233 344 </xsl:if> 234 345 <xsl:if test="exists(child::SourceLanguage)"> 235 <SourceLanguage><xsl:value-of select=" ./SourceLanguage"/></SourceLanguage> 346 <SourceLanguage> 347 <xsl:value-of select=" ./SourceLanguage"/> 348 </SourceLanguage> 236 349 </xsl:if> 237 350 <xsl:if test="exists(child::TargetLanguage)"> 238 <TargetLanguage><xsl:value-of select=" ./TargetLanguage"/></TargetLanguage> 351 <TargetLanguage> 352 <xsl:value-of select=" ./TargetLanguage"/> 353 </TargetLanguage> 239 354 </xsl:if> 240 355 <xsl:if test="exists(child::Description)"> … … 246 361 </Description> 247 362 </xsl:for-each> 248 </descriptions> 363 </descriptions> 249 364 </xsl:if> 250 365 </Content_Language> … … 263 378 </Description> 264 379 </xsl:for-each> 265 </descriptions> 380 </descriptions> 266 381 </xsl:if> 267 382 <xsl:for-each select="Actor"> 268 383 <Actor> 269 <Role><xsl:value-of select=" ./Role"/></Role> 270 <Name><xsl:value-of select=" ./Name"/></Name> 271 <FullName><xsl:value-of select=" ./FullName"/></FullName> 272 <Code><xsl:value-of select=" ./Code"/></Code> 273 <FamilySocialRole><xsl:value-of select=" ./FamilySocialRole"/></FamilySocialRole> 274 <EthnicGroup><xsl:value-of select=" ./EthnicGroup"/></EthnicGroup> 275 <Age><xsl:value-of select=" ./Age"/></Age> 276 <BirthDate><xsl:value-of select=" ./BirthDate"/></BirthDate> 277 <Sex><xsl:value-of select=" ./Sex"/></Sex> 278 <Education><xsl:value-of select=" ./Education"/></Education> 279 <Anonymized><xsl:value-of select=" ./Anonymized"/></Anonymized> 280 <xsl:apply-templates select="Contact" /> 384 <Role> 385 <xsl:value-of select=" ./Role"/> 386 </Role> 387 <Name> 388 <xsl:value-of select=" ./Name"/> 389 </Name> 390 <FullName> 391 <xsl:value-of select=" ./FullName"/> 392 </FullName> 393 <Code> 394 <xsl:value-of select=" ./Code"/> 395 </Code> 396 <FamilySocialRole> 397 <xsl:value-of select=" ./FamilySocialRole"/> 398 </FamilySocialRole> 399 <EthnicGroup> 400 <xsl:value-of select=" ./EthnicGroup"/> 401 </EthnicGroup> 402 <Age> 403 <xsl:value-of select=" ./Age"/> 404 </Age> 405 <BirthDate> 406 <xsl:value-of select=" ./BirthDate"/> 407 </BirthDate> 408 <Sex> 409 <xsl:value-of select=" ./Sex"/> 410 </Sex> 411 <Education> 412 <xsl:value-of select=" ./Education"/> 413 </Education> 414 <Anonymized> 415 <xsl:value-of select=" ./Anonymized"/> 416 </Anonymized> 417 <xsl:apply-templates select="Contact"/> 281 418 <xsl:apply-templates select="child::Keys"/> 282 419 <xsl:if test="exists(child::Description)"> … … 288 425 </Description> 289 426 </xsl:for-each> 290 </descriptions> 291 </xsl:if> 292 <xsl:apply-templates select="child::Languages" mode="actor" 427 </descriptions> 428 </xsl:if> 429 <xsl:apply-templates select="child::Languages" mode="actor"/> 293 430 </Actor> 294 431 </xsl:for-each> … … 306 443 </Description> 307 444 </xsl:for-each> 308 </descriptions> 445 </descriptions> 309 446 </xsl:if> 310 447 <xsl:for-each select="Language"> 311 448 <Actor_Language> 312 <Id><xsl:value-of select=" ./Id"/></Id> 313 <Name><xsl:value-of select=" ./Name"/></Name> 449 <Id> 450 <xsl:value-of select=" ./Id"/> 451 </Id> 452 <Name> 453 <xsl:value-of select=" ./Name"/> 454 </Name> 314 455 <xsl:if test="exists(child::MotherTongue)"> 315 <MotherTongue><xsl:value-of select=" ./MotherTongue"/></MotherTongue> 456 <MotherTongue> 457 <xsl:value-of select=" ./MotherTongue"/> 458 </MotherTongue> 316 459 </xsl:if> 317 460 <xsl:if test="exists(child::PrimaryLanguage)"> 318 <PrimaryLanguage><xsl:value-of select=" ./PrimaryLanguage"/></PrimaryLanguage> 461 <PrimaryLanguage> 462 <xsl:value-of select=" ./PrimaryLanguage"/> 463 </PrimaryLanguage> 319 464 </xsl:if> 320 465 <xsl:if test="exists(child::Description)"> … … 326 471 </Description> 327 472 </xsl:for-each> 328 </descriptions> 473 </descriptions> 329 474 </xsl:if> 330 475 </Actor_Language> 331 </xsl:for-each> 476 </xsl:for-each> 332 477 </Actor_Languages> 333 478 </xsl:template> 334 479 335 480 336 481 <xsl:template match="child::Resources" mode="regular"> … … 339 484 <xsl:apply-templates select="WrittenResource"/> 340 485 <xsl:apply-templates select="Source"/> 341 <xsl:apply-templates select="Anonyms"/> 486 <xsl:apply-templates select="Anonyms"/> 342 487 </Resources> 343 488 </xsl:template> 344 489 345 490 <xsl:template match="MediaFile"> 346 491 <MediaFile ref="{generate-id()}"> 347 <ResourceLink><xsl:value-of select=" ./ResourceLink"/></ResourceLink> 348 <Type><xsl:value-of select=" ./Type"/></Type> 349 <Format><xsl:value-of select=" ./Format"/></Format> 350 <Size><xsl:value-of select=" ./Size"/></Size> 351 <Quality><xsl:value-of select=" ./Quality"/></Quality> 352 <RecordingConditions><xsl:value-of select=" ./RecordingConditions"/></RecordingConditions> 492 <ResourceLink> 493 <xsl:value-of select=" ./ResourceLink"/> 494 </ResourceLink> 495 <Type> 496 <xsl:value-of select=" ./Type"/> 497 </Type> 498 <Format> 499 <xsl:value-of select=" ./Format"/> 500 </Format> 501 <Size> 502 <xsl:value-of select=" ./Size"/> 503 </Size> 504 <Quality> 505 <xsl:value-of select=" ./Quality"/> 506 </Quality> 507 <RecordingConditions> 508 <xsl:value-of select=" ./RecordingConditions"/> 509 </RecordingConditions> 353 510 <TimePosition> 354 <Start><xsl:apply-templates select="TimePosition/Start"/></Start> 511 <Start> 512 <xsl:apply-templates select="TimePosition/Start"/> 513 </Start> 355 514 <xsl:if test="exists(descendant::End)"> 356 <End><xsl:apply-templates select="TimePosition/End"/></End> 515 <End> 516 <xsl:apply-templates select="TimePosition/End"/> 517 </End> 357 518 </xsl:if> 358 519 </TimePosition> … … 366 527 </Description> 367 528 </xsl:for-each> 368 </descriptions> 369 </xsl:if> 370 <xsl:apply-templates select="child::Keys"/> 371 </MediaFile> 372 </xsl:template> 373 529 </descriptions> 530 </xsl:if> 531 <xsl:apply-templates select="child::Keys"/> 532 </MediaFile> 533 </xsl:template> 534 374 535 <xsl:template match="Access"> 375 536 <Access> 376 <Availability><xsl:value-of select=" ./Availability"/></Availability> 377 <Date><xsl:value-of select=" ./Date"/></Date> 378 <Owner><xsl:value-of select=" ./Owner"/></Owner> 379 <Publisher><xsl:value-of select=" ./Publisher"/></Publisher> 380 <xsl:apply-templates select="Contact" /> 381 <xsl:if test="exists(child::Description)"> 382 <descriptions> 383 <xsl:for-each select="Description"> 384 <Description> 385 <xsl:attribute name="LanguageId" select="@LanguageId"/> 386 <xsl:value-of select="."/> 387 </Description> 388 </xsl:for-each> 389 </descriptions> 537 <Availability> 538 <xsl:value-of select=" ./Availability"/> 539 </Availability> 540 <Date> 541 <xsl:value-of select=" ./Date"/> 542 </Date> 543 <Owner> 544 <xsl:value-of select=" ./Owner"/> 545 </Owner> 546 <Publisher> 547 <xsl:value-of select=" ./Publisher"/> 548 </Publisher> 549 <xsl:apply-templates select="Contact"/> 550 <xsl:if test="exists(child::Description)"> 551 <descriptions> 552 <xsl:for-each select="Description"> 553 <Description> 554 <xsl:attribute name="LanguageId" select="@LanguageId"/> 555 <xsl:value-of select="."/> 556 </Description> 557 </xsl:for-each> 558 </descriptions> 390 559 </xsl:if> 391 560 </Access> 392 561 </xsl:template> 393 562 394 563 <xsl:template match="WrittenResource"> 395 564 <WrittenResource ref="{generate-id()}"> 396 <ResourceLink><xsl:value-of select=" ./ResourceLink"/></ResourceLink> 397 <MediaResourceLink><xsl:value-of select=" ./MediaResourceLink"/></MediaResourceLink> 398 <Date><xsl:value-of select=" ./Date"/></Date> 399 <Type><xsl:value-of select=" ./Type"/></Type> 400 <SubType><xsl:value-of select=" ./SubType"/></SubType> 401 <Format><xsl:value-of select=" ./Format"/></Format> 402 <Size><xsl:value-of select=" ./Size"/></Size> 403 <Derivation><xsl:value-of select=" ./Derivation"/></Derivation> 404 <CharacterEncoding><xsl:value-of select=" ./CharacterEncoding"/></CharacterEncoding> 405 <ContentEncoding><xsl:value-of select=" ./ContentEncoding"/></ContentEncoding> 406 <LanguageId><xsl:value-of select=" ./LanguageId"/></LanguageId> 407 <Anonymized><xsl:value-of select=" ./Anonymized"/></Anonymized> 408 <xsl:apply-templates select="Validation"/> 565 <ResourceLink> 566 <xsl:value-of select=" ./ResourceLink"/> 567 </ResourceLink> 568 <MediaResourceLink> 569 <xsl:value-of select=" ./MediaResourceLink"/> 570 </MediaResourceLink> 571 <Date> 572 <xsl:value-of select=" ./Date"/> 573 </Date> 574 <Type> 575 <xsl:value-of select=" ./Type"/> 576 </Type> 577 <SubType> 578 <xsl:value-of select=" ./SubType"/> 579 </SubType> 580 <Format> 581 <xsl:value-of select=" ./Format"/> 582 </Format> 583 <Size> 584 <xsl:value-of select=" ./Size"/> 585 </Size> 586 <Derivation> 587 <xsl:value-of select=" ./Derivation"/> 588 </Derivation> 589 <CharacterEncoding> 590 <xsl:value-of select=" ./CharacterEncoding"/> 591 </CharacterEncoding> 592 <ContentEncoding> 593 <xsl:value-of select=" ./ContentEncoding"/> 594 </ContentEncoding> 595 <LanguageId> 596 <xsl:value-of select=" ./LanguageId"/> 597 </LanguageId> 598 <Anonymized> 599 <xsl:value-of select=" ./Anonymized"/> 600 </Anonymized> 601 <xsl:apply-templates select="Validation"/> 409 602 <xsl:apply-templates select="Access"/> 410 603 <xsl:if test="exists(child::Description)"> … … 416 609 </Description> 417 610 </xsl:for-each> 418 </descriptions> 419 </xsl:if> 420 <xsl:apply-templates select="Keys"/> 611 </descriptions> 612 </xsl:if> 613 <xsl:apply-templates select="Keys"/> 421 614 </WrittenResource> 422 615 </xsl:template> 423 616 424 617 <xsl:template match="Validation"> 425 618 <Validation> 426 <Type><xsl:value-of select=" ./Type"/></Type> 427 <Methodology><xsl:value-of select=" ./Methodology"/></Methodology> 428 <Level><xsl:value-of select=" ./Level"/></Level> 429 <xsl:if test="exists(child::Description)"> 430 <descriptions> 431 <xsl:for-each select="Description"> 432 <Description> 433 <xsl:attribute name="LanguageId" select="@LanguageId"/> 434 <xsl:value-of select="."/> 435 </Description> 436 </xsl:for-each> 437 </descriptions> 619 <Type> 620 <xsl:value-of select=" ./Type"/> 621 </Type> 622 <Methodology> 623 <xsl:value-of select=" ./Methodology"/> 624 </Methodology> 625 <Level> 626 <xsl:value-of select=" ./Level"/> 627 </Level> 628 <xsl:if test="exists(child::Description)"> 629 <descriptions> 630 <xsl:for-each select="Description"> 631 <Description> 632 <xsl:attribute name="LanguageId" select="@LanguageId"/> 633 <xsl:value-of select="."/> 634 </Description> 635 </xsl:for-each> 636 </descriptions> 438 637 </xsl:if> 439 638 </Validation> 440 639 </xsl:template> 441 640 442 641 <xsl:template match="Source"> 443 642 <Source> 444 <Id><xsl:value-of select=" ./Id"/></Id> 445 <Format><xsl:value-of select=" ./Format"/></Format> 446 <Quality><xsl:value-of select=" ./Quality"/></Quality> 643 <Id> 644 <xsl:value-of select=" ./Id"/> 645 </Id> 646 <Format> 647 <xsl:value-of select=" ./Format"/> 648 </Format> 649 <Quality> 650 <xsl:value-of select=" ./Quality"/> 651 </Quality> 447 652 <xsl:if test="exists(child::CounterPosition)"> 448 653 <CounterPosition> 449 <Start><xsl:apply-templates select="CounterPosition/Start"/></Start> 654 <Start> 655 <xsl:apply-templates select="CounterPosition/Start"/> 656 </Start> 450 657 <xsl:if test="exists(descendant::End)"> 451 <End><xsl:apply-templates select="CounterPosition/End"/></End> 658 <End> 659 <xsl:apply-templates select="CounterPosition/End"/> 660 </End> 452 661 </xsl:if> 453 662 </CounterPosition> … … 455 664 <xsl:if test="exists(child::TimePosition)"> 456 665 <TimePosition> 457 <Start><xsl:apply-templates select="TimePosition/Start"/></Start> 666 <Start> 667 <xsl:apply-templates select="TimePosition/Start"/> 668 </Start> 458 669 <xsl:if test="exists(descendant::End)"> 459 <End><xsl:apply-templates select="TimePosition/End"/></End> 670 <End> 671 <xsl:apply-templates select="TimePosition/End"/> 672 </End> 460 673 </xsl:if> 461 674 </TimePosition> … … 470 683 </Description> 471 684 </xsl:for-each> 472 </descriptions> 685 </descriptions> 473 686 </xsl:if> 474 687 <xsl:apply-templates select="child::Keys"/> 475 688 </Source> 476 689 </xsl:template> 477 690 478 691 <xsl:template match="Anonyms"> 479 692 <Anonyms> 480 <ResourceLink><xsl:value-of select=" ./ResourceLink"/></ResourceLink> 693 <ResourceLink> 694 <xsl:value-of select=" ./ResourceLink"/> 695 </ResourceLink> 481 696 <xsl:apply-templates select="Access"/> 482 697 </Anonyms> 483 698 </xsl:template> 484 699 485 700 <xsl:template match="child::References"> 486 701 <References> … … 493 708 </Description> 494 709 </xsl:for-each> 495 </descriptions> 710 </descriptions> 496 711 </xsl:if> 497 712 </References> 498 713 </xsl:template> 499 500 501 502 714 </xsl:stylesheet>
Note: See TracChangeset
for help on using the changeset viewer.