Changeset 1165
- Timestamp:
- 03/14/11 11:00:37 (13 years ago)
- Location:
- metadata/trunk/toolkit/xslt
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
metadata/trunk/toolkit/xslt/batch-imdi2clarin.xsl
r999 r1165 1 1 <?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" 3 3 xpath-default-namespace="http://www.mpi.nl/IMDI/Schema/IMDI"> 4 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 5 java -jar saxon8.jar -it main batch-imdi2clarin.xsl 6 6 the last template in this file has to be modified to reflect the actual directory name 7 -->7 --> 8 8 <xsl:output method="xml" indent="yes"/> 9 9 10 10 <xsl:template name="metatranscriptDelegate"> 11 <xsl:param name="profile"></xsl:param> 11 12 <Header> 12 13 <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> 13 17 </Header> 14 18 <Resources> … … 25 29 </Components> 26 30 </xsl:template> 27 31 28 32 <xsl:template match="METATRANSCRIPT"> 29 33 <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> 34 41 </CMD> 35 42 </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> 40 50 </CMD> 41 51 </xsl:when> 42 52 <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! 44 55 </xsl:otherwise> 45 56 </xsl:choose> 46 57 </xsl:template> 47 58 48 59 49 60 <xsl:template match="Corpus"> -
metadata/trunk/toolkit/xslt/imdi2clarin.xsl
r1041 r1165 1 1 <?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" 3 3 xpath-default-namespace="http://www.mpi.nl/IMDI/Schema/IMDI"> 4 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: … … 9 9 10 10 <xsl:template name="metatranscriptDelegate"> 11 <xsl:param name="profile"></xsl:param> 11 12 <Header> 12 13 <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> 13 17 </Header> 14 18 <Resources> … … 29 33 <xsl:choose> 30 34 <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> 34 41 </CMD> 35 42 </xsl:when> 36 43 <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> 40 50 </CMD> 41 51 </xsl:when> -
metadata/trunk/toolkit/xslt/olac2cmdi.xsl
r1067 r1165 1 1 <?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" 3 3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" 4 4 xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" … … 18 18 19 19 <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"> 22 22 <Header> 23 23 <MdCreator>olac2cmdi.xsl</MdCreator>
Note: See TracChangeset
for help on using the changeset viewer.