Changeset 1165


Ignore:
Timestamp:
03/14/11 11:00:37 (13 years ago)
Author:
patdui
Message:
  • updated imdi2clarin and olac2imdi xsl's to create xml with default 'cmd' namespace
Location:
metadata/trunk/toolkit/xslt
Files:
3 edited

Legend:

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

    r999 r1165  
    11<?xml version="1.0" encoding="UTF-8"?>
    2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
     2<xsl:stylesheet xmlns="http://www.clarin.eu/cmd/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
    33    xpath-default-namespace="http://www.mpi.nl/IMDI/Schema/IMDI">
    44    <!-- 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:
    55        java -jar saxon8.jar -it main batch-imdi2clarin.xsl
    66        the last template in this file has to be modified to reflect the actual directory name
    7 -->
     7    -->
    88    <xsl:output method="xml" indent="yes"/>
    9 
     9   
    1010    <xsl:template name="metatranscriptDelegate">
     11        <xsl:param name="profile"></xsl:param>
    1112        <Header>
    1213            <MdSelfLink>test-<xsl:value-of select="@ArchiveHandle"/></MdSelfLink>
     14            <MdCreator>imdi2clarin.xsl</MdCreator>
     15            <MdProfile><xsl:value-of select="$profile"/></MdProfile>
     16            <MdCreationDate><xsl:value-of select="format-date(current-date(), '[Y]-[M]-[D]')"/></MdCreationDate>
    1317        </Header>
    1418        <Resources>
     
    2529        </Components>
    2630    </xsl:template>
    27 
     31   
    2832    <xsl:template match="METATRANSCRIPT">
    2933        <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            <xsl:when test=".[@Type='SESSION'] or .[@Type='SESSION.Profile']">
     35                <CMD CMDVersion="1.1"
     36                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     37                    xsi:schemaLocation="http://www.clarin.eu/cmd/ http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/profiles/clarin.eu:cr1:p_1271859438204/xsd">
     38                    <xsl:call-template name="metatranscriptDelegate">
     39                        <xsl:with-param name="profile">clarin.eu:cr1:p_1271859438204</xsl:with-param>
     40                    </xsl:call-template>
    3441                </CMD>
    3542            </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"/>
     43            <xsl:when test=".[@Type='CORPUS'] or .[@Type='CORPUS.Profile']">
     44                <CMD CMDVersion="1.1"
     45                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     46                    xsi:schemaLocation="http://www.clarin.eu/cmd/ http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/profiles/clarin.eu:cr1:p_1274880881885/xsd">
     47                    <xsl:call-template name="metatranscriptDelegate">
     48                        <xsl:with-param name="profile">clarin.eu:cr1:p_1274880881885</xsl:with-param>
     49                    </xsl:call-template>
    4050                </CMD>
    4151            </xsl:when>
    4252            <xsl:otherwise>
    43                 <!--                Currently we are only processing 'SESSION' and 'CORPUS' types.-->
     53                <!--                Currently we are only processing 'SESSION' and 'CORPUS' types. The error displayed can be used to filter out erroneous files after processing-->
     54                ERROR: Invalid METATRANSCRIPT Type!
    4455            </xsl:otherwise>
    4556        </xsl:choose>
    4657    </xsl:template>
    47 
     58   
    4859
    4960    <xsl:template match="Corpus">
  • metadata/trunk/toolkit/xslt/imdi2clarin.xsl

    r1041 r1165  
    11<?xml version="1.0" encoding="UTF-8"?>
    2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
     2<xsl:stylesheet xmlns="http://www.clarin.eu/cmd/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
    33    xpath-default-namespace="http://www.mpi.nl/IMDI/Schema/IMDI">
    44    <!-- 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:
     
    99
    1010    <xsl:template name="metatranscriptDelegate">
     11        <xsl:param name="profile"></xsl:param>
    1112        <Header>
    1213            <MdSelfLink>test-<xsl:value-of select="@ArchiveHandle"/></MdSelfLink>
     14            <MdCreator>imdi2clarin.xsl</MdCreator>
     15            <MdProfile><xsl:value-of select="$profile"/></MdProfile>
     16            <MdCreationDate><xsl:value-of select="format-date(current-date(), '[Y]-[M]-[D]')"/></MdCreationDate>
    1317        </Header>
    1418        <Resources>
     
    2933        <xsl:choose>
    3034            <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"/>
     35                <CMD CMDVersion="1.1"
     36                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     37                    xsi:schemaLocation="http://www.clarin.eu/cmd/ http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/profiles/clarin.eu:cr1:p_1271859438204/xsd">
     38                    <xsl:call-template name="metatranscriptDelegate">
     39                        <xsl:with-param name="profile">clarin.eu:cr1:p_1271859438204</xsl:with-param>
     40                    </xsl:call-template>
    3441                </CMD>
    3542            </xsl:when>
    3643            <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"/>
     44                <CMD CMDVersion="1.1"
     45                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     46                    xsi:schemaLocation="http://www.clarin.eu/cmd/ http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/profiles/clarin.eu:cr1:p_1274880881885/xsd">
     47                    <xsl:call-template name="metatranscriptDelegate">
     48                        <xsl:with-param name="profile">clarin.eu:cr1:p_1274880881885</xsl:with-param>
     49                    </xsl:call-template>
    4050                </CMD>
    4151            </xsl:when>
  • metadata/trunk/toolkit/xslt/olac2cmdi.xsl

    r1067 r1165  
    11<?xml version="1.0" encoding="UTF-8"?>
    2 <xsl:stylesheet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     2<xsl:stylesheet xmlns="http://www.clarin.eu/cmd/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    33    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
    44    xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/"
     
    1818
    1919    <xsl:template match="/">
    20         <CMD
    21             xsi:schemaLocation="http://www.clarin.eu/cmd http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/profiles/clarin.eu:cr1:p_1288172614026/xsd">
     20        <CMD CMDVersion="1.1"
     21            xsi:schemaLocation="http://www.clarin.eu/cmd/ http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/profiles/clarin.eu:cr1:p_1288172614026/xsd">
    2222            <Header>
    2323                <MdCreator>olac2cmdi.xsl</MdCreator>
Note: See TracChangeset for help on using the changeset viewer.