Changeset 1035


Ignore:
Timestamp:
01/04/11 13:26:56 (13 years ago)
Author:
paucas
Message:

cleaning and renaming

File:
1 edited

Legend:

Unmodified
Added
Removed
  • metadata/trunk/toolkit/xslt/imdi2clarin.xsl

    r180 r1035  
    11<?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
    628    <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
    3789    <xsl:template match="Resources" mode="linking">
    3890        <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>
    42101            </ResourceProxy>
    43102        </xsl:for-each>
    44103        <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>
    48114            </ResourceProxy>
    49115        </xsl:for-each>
    50116    </xsl:template>
    51    
     117
    52118    <xsl:template match="Session">
    53119        <Session>
     
    63129                        </Description>
    64130                    </xsl:for-each>
    65                 </descriptions>               
    66             </xsl:if>           
     131                </descriptions>
     132            </xsl:if>
    67133            <xsl:apply-templates select="child::MDGroup"/>
    68134            <xsl:apply-templates select="child::Resources" mode="regular"/>
     
    70136        </Session>
    71137    </xsl:template>
    72    
     138
    73139    <xsl:template match="child::Name">
    74140        <Name>
     
    76142        </Name>
    77143    </xsl:template>
    78    
     144
    79145    <xsl:template match="child::Title">
    80146        <Title>
     
    82148        </Title>
    83149    </xsl:template>
    84    
     150
    85151    <xsl:template match="child::Date">
    86152        <Date>
     
    88154        </Date>
    89155    </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
    101157    <xsl:template match="child::MDGroup">
    102158        <MDGroup>
     
    105161            <xsl:apply-templates select="child::Keys"/>
    106162            <xsl:apply-templates select="child::Content"/>
    107             <xsl:apply-templates select="child::Actors"/>           
     163            <xsl:apply-templates select="child::Actors"/>
    108164        </MDGroup>
    109165    </xsl:template>
    110    
     166
    111167    <xsl:template match="Location">
    112168        <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>
    115175            <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>
    117179            </xsl:if>
    118180            <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
    124188    <xsl:template match="Project">
    125189        <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>
    129199            <xsl:apply-templates select="Contact"/>
    130200            <xsl:if test="exists(child::Description)">
     
    136206                        </Description>
    137207                    </xsl:for-each>
    138                 </descriptions>               
     208                </descriptions>
    139209            </xsl:if>
    140210        </Project>
    141211    </xsl:template>
    142    
     212
    143213    <xsl:template match="Contact">
    144214        <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
    152230    <xsl:template match="Keys">
    153231        <Keys>
    154232            <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>
    156239            </xsl:for-each>
    157240        </Keys>
    158241    </xsl:template>
    159    
     242
    160243    <xsl:template match="Content">
    161244        <Content>
    162             <Genre><xsl:value-of select="child::Genre"/></Genre>
     245            <Genre>
     246                <xsl:value-of select="child::Genre"/>
     247            </Genre>
    163248            <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>
    165252            </xsl:if>
    166253            <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>
    168257            </xsl:if>
    169258            <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>
    171262            </xsl:if>
    172263            <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>
    174267            </xsl:if>
    175268            <xsl:apply-templates select="child::CommunicationContext"/>
     
    184277                        </Description>
    185278                    </xsl:for-each>
    186                 </descriptions>               
     279                </descriptions>
    187280            </xsl:if>
    188281        </Content>
    189        
    190     </xsl:template>
    191    
     282
     283    </xsl:template>
     284
    192285    <xsl:template match="CommunicationContext">
    193286        <CommunicationContext>
    194287            <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>
    196291            </xsl:if>
    197292            <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>
    199296            </xsl:if>
    200297            <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>
    202301            </xsl:if>
    203302            <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>
    205306            </xsl:if>
    206307            <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>
    208311            </xsl:if>
    209312            <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>
    211316            </xsl:if>
    212317        </CommunicationContext>
    213318    </xsl:template>
    214    
     319
    215320    <xsl:template match="Languages" mode="content">
    216321        <Content_Languages>
     
    223328                        </Description>
    224329                    </xsl:for-each>
    225                 </descriptions>               
     330                </descriptions>
    226331            </xsl:if>
    227332            <xsl:for-each select="Language">
    228333                <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>
    231340                    <xsl:if test="exists(child::Dominant)">
    232                         <Dominant><xsl:value-of select=" ./Dominant"/></Dominant>
     341                        <Dominant>
     342                            <xsl:value-of select=" ./Dominant"/>
     343                        </Dominant>
    233344                    </xsl:if>
    234345                    <xsl:if test="exists(child::SourceLanguage)">
    235                         <SourceLanguage><xsl:value-of select=" ./SourceLanguage"/></SourceLanguage>
     346                        <SourceLanguage>
     347                            <xsl:value-of select=" ./SourceLanguage"/>
     348                        </SourceLanguage>
    236349                    </xsl:if>
    237350                    <xsl:if test="exists(child::TargetLanguage)">
    238                         <TargetLanguage><xsl:value-of select=" ./TargetLanguage"/></TargetLanguage>
     351                        <TargetLanguage>
     352                            <xsl:value-of select=" ./TargetLanguage"/>
     353                        </TargetLanguage>
    239354                    </xsl:if>
    240355                    <xsl:if test="exists(child::Description)">
     
    246361                                </Description>
    247362                            </xsl:for-each>
    248                         </descriptions>               
     363                        </descriptions>
    249364                    </xsl:if>
    250365                </Content_Language>
     
    263378                        </Description>
    264379                    </xsl:for-each>
    265                 </descriptions>               
     380                </descriptions>
    266381            </xsl:if>
    267382            <xsl:for-each select="Actor">
    268383                <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"/>
    281418                    <xsl:apply-templates select="child::Keys"/>
    282419                    <xsl:if test="exists(child::Description)">
     
    288425                                </Description>
    289426                            </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"/>
    293430                </Actor>
    294431            </xsl:for-each>
     
    306443                        </Description>
    307444                    </xsl:for-each>
    308                 </descriptions>               
     445                </descriptions>
    309446            </xsl:if>
    310447            <xsl:for-each select="Language">
    311448                <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>
    314455                    <xsl:if test="exists(child::MotherTongue)">
    315                         <MotherTongue><xsl:value-of select=" ./MotherTongue"/></MotherTongue>
     456                        <MotherTongue>
     457                            <xsl:value-of select=" ./MotherTongue"/>
     458                        </MotherTongue>
    316459                    </xsl:if>
    317460                    <xsl:if test="exists(child::PrimaryLanguage)">
    318                         <PrimaryLanguage><xsl:value-of select=" ./PrimaryLanguage"/></PrimaryLanguage>
     461                        <PrimaryLanguage>
     462                            <xsl:value-of select=" ./PrimaryLanguage"/>
     463                        </PrimaryLanguage>
    319464                    </xsl:if>
    320465                    <xsl:if test="exists(child::Description)">
     
    326471                                </Description>
    327472                            </xsl:for-each>
    328                         </descriptions>               
     473                        </descriptions>
    329474                    </xsl:if>
    330475                </Actor_Language>
    331             </xsl:for-each>           
     476            </xsl:for-each>
    332477        </Actor_Languages>
    333478    </xsl:template>
    334    
     479
    335480
    336481    <xsl:template match="child::Resources" mode="regular">
     
    339484            <xsl:apply-templates select="WrittenResource"/>
    340485            <xsl:apply-templates select="Source"/>
    341             <xsl:apply-templates select="Anonyms"/>           
     486            <xsl:apply-templates select="Anonyms"/>
    342487        </Resources>
    343488    </xsl:template>
    344    
     489
    345490    <xsl:template match="MediaFile">
    346491        <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>
    353510            <TimePosition>
    354                 <Start><xsl:apply-templates select="TimePosition/Start"/></Start>
     511                <Start>
     512                    <xsl:apply-templates select="TimePosition/Start"/>
     513                </Start>
    355514                <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>
    357518                </xsl:if>
    358519            </TimePosition>
     
    366527                        </Description>
    367528                    </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
    374535    <xsl:template match="Access">
    375536        <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>
    390559            </xsl:if>
    391560        </Access>
    392561    </xsl:template>
    393    
     562
    394563    <xsl:template match="WrittenResource">
    395564        <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"/>
    409602            <xsl:apply-templates select="Access"/>
    410603            <xsl:if test="exists(child::Description)">
     
    416609                        </Description>
    417610                    </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"/>
    421614        </WrittenResource>
    422615    </xsl:template>
    423    
     616
    424617    <xsl:template match="Validation">
    425618        <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>
    438637            </xsl:if>
    439638        </Validation>
    440639    </xsl:template>
    441    
     640
    442641    <xsl:template match="Source">
    443642        <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>
    447652            <xsl:if test="exists(child::CounterPosition)">
    448653                <CounterPosition>
    449                     <Start><xsl:apply-templates select="CounterPosition/Start"/></Start>
     654                    <Start>
     655                        <xsl:apply-templates select="CounterPosition/Start"/>
     656                    </Start>
    450657                    <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>
    452661                    </xsl:if>
    453662                </CounterPosition>
     
    455664            <xsl:if test="exists(child::TimePosition)">
    456665                <TimePosition>
    457                     <Start><xsl:apply-templates select="TimePosition/Start"/></Start>
     666                    <Start>
     667                        <xsl:apply-templates select="TimePosition/Start"/>
     668                    </Start>
    458669                    <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>
    460673                    </xsl:if>
    461674                </TimePosition>
     
    470683                        </Description>
    471684                    </xsl:for-each>
    472                 </descriptions>               
     685                </descriptions>
    473686            </xsl:if>
    474687            <xsl:apply-templates select="child::Keys"/>
    475688        </Source>
    476689    </xsl:template>
    477    
     690
    478691    <xsl:template match="Anonyms">
    479692        <Anonyms>
    480             <ResourceLink><xsl:value-of select=" ./ResourceLink"/></ResourceLink>
     693            <ResourceLink>
     694                <xsl:value-of select=" ./ResourceLink"/>
     695            </ResourceLink>
    481696            <xsl:apply-templates select="Access"/>
    482697        </Anonyms>
    483698    </xsl:template>
    484    
     699
    485700    <xsl:template match="child::References">
    486701        <References>
     
    493708                        </Description>
    494709                    </xsl:for-each>
    495                 </descriptions>               
     710                </descriptions>
    496711            </xsl:if>
    497712        </References>
    498713    </xsl:template>
    499    
    500    
    501    
    502714</xsl:stylesheet>
Note: See TracChangeset for help on using the changeset viewer.