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