File:  [LON-CAPA] / nsdl / lib / stylesheets / lomnsdl_to_loncapa.xsl
Revision 1.1: download - view: text, annotated - select for diffs
Sun Jul 14 07:50:44 2002 UTC (22 years, 3 months ago) by harris41
Branches: MAIN
CVS tags: HEAD
stylesheet for converting IEEE LOM to loncapa "qualified" metadata;
IEEE LOM dtd was difficult to resolve; trying to use something similar
to what the LTSC group is going after

<?xml version="1.0"?> 
<xsl:stylesheet
  xmlns:lom="http://nsdl.lon-capa.org/lom/elements/6.4/"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  xmlns:external="http://nsdl.lon-capa.org/namespace/ExternalFunction/"
>
<xsl:template match="/">
<loncapa:loncapa
 xmlns:loncapa="http://nsdl.lon-capa.org/loncapa/elements/1.1/">
<xsl:text>
</xsl:text>
<xsl:apply-templates select="/*/lom:General/lom:Identifier"/>
<xsl:apply-templates select="/*/lom:General/lom:Title"/>
<xsl:apply-templates select="/*/lom:General/lom:Language"/>
<xsl:apply-templates select="/*/lom:General/lom:Description"/>
<xsl:apply-templates select="/*/lom:General/lom:Keyword"/>
<xsl:apply-templates select="/*/lom:LifeCycle/lom:Contribute"/>
<xsl:apply-templates select="/*/lom:Technical/lom:Format"/>
<xsl:apply-templates select="/*/lom:Technical/lom:Size"/>
<xsl:apply-templates select="/*/lom:Educational/lom:Description"/>
<xsl:apply-templates select="/*/lom:Rights/lom:CopyrightandOtherRestrictions"/>
<xsl:apply-templates select="/*/lom:Rights/lom:Description"/>
</loncapa:loncapa>
</xsl:template>
<xsl:template match="lom:General/lom:Identifier">
<uri>http://nsdl.lon-capa.org/gateres/<xsl:value-of select="lom:Catalog"/>/<xsl:value-of select="lom:Entry"/>
</uri>
<xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="lom:General/lom:Title">
<title>
         <xsl:choose>
           <xsl:when 
    test="function-available('external:lomnsdl_GeneralTitle_to_loncapa_title')"
             >
             <xsl:value-of select=
                          "external:lomnsdl_GeneralTitle_to_loncapa_title(.)"/>
           </xsl:when>
           <xsl:otherwise>
    Function external:lomnsdl_GeneralTitle_to_loncapa_title() is not available!
           </xsl:otherwise>
         </xsl:choose>
</title>
<xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="lom:General/lom:Language">
<language>
         <xsl:choose>
           <xsl:when
                 test=
   "function-available('external:lomnsdl_GeneralLanguage_to_loncapa_language')"
             >
             <xsl:value-of select=
                    "external:lomnsdl_GeneralLanguage_to_loncapa_language(.)"/>
           </xsl:when>
           <xsl:otherwise>
Function external:lomnsdl_GeneralLanguage_to_loncapa_language() is not
available!
           </xsl:otherwise>
         </xsl:choose>
</language>
<xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="lom:General/lom:Keyword">
<keywords>
         <xsl:choose>
           <xsl:when
                 test=
    "function-available('external:lomnsdl_GeneralKeyword_to_loncapa_keywords')"
             >
             <xsl:value-of select=
                     "external:lomnsdl_GeneralKeyword_to_loncapa_keywords(.)"/>
           </xsl:when>
           <xsl:otherwise>
Function external:lomnsdl_GeneralKeyword_to_loncapa_keywords() is not
available!
           </xsl:otherwise>
         </xsl:choose>
</keywords>
<xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="lom:LifeCycle/lom:Contribute">
         <xsl:choose>
           <xsl:when
               test="function-available('external:lomnsdl_LifeCycleContribute_prepare_converter_INFO')"
             >
             <xsl:value-of select=
        "external:lomnsdl_LifeCycleContribute_prepare_converter_INFO(.)"/>
           </xsl:when>
           <xsl:otherwise>
Function external:lomnsdl_LifeCycleContribute_prepare_converter_INFO()
is not available!
           </xsl:otherwise>
         </xsl:choose>
<xsl:apply-templates select="/*/lom:LifeCycle/lom:Contribute/lom:Role"/>
<xsl:apply-templates select="/*/lom:LifeCycle/lom:Contribute/lom:Entity"/>
<xsl:apply-templates select="/*/lom:LifeCycle/lom:Contribute/lom:Date"/>
         <xsl:choose>
           <xsl:when
               test="function-available('external:converter_INFO_to_loncapa_lastrevisiondate')"
             >
             <xsl:value-of select=
        "external:converter_INFO_to_loncapa_lastrevisiondate(.)"/>
           </xsl:when>
           <xsl:otherwise>
Function external:converter_INFO_to_loncapa_lastrevisiondate()
is not available!
           </xsl:otherwise>
         </xsl:choose>
         <xsl:choose>
           <xsl:when
               test="function-available('external:converter_INFO_to_loncapa_creationdate')"
             >
             <xsl:value-of select=
        "external:converter_INFO_to_loncapa_creationdate(.)"/>
           </xsl:when>
           <xsl:otherwise>
Function external:converter_INFO_to_loncapa_creationdate()
is not available!
           </xsl:otherwise>
         </xsl:choose>
         <xsl:choose>
           <xsl:when
               test="function-available('external:converter_INFO_to_loncapa_author')"
             >
             <xsl:value-of select=
        "external:converter_INFO_to_loncapa_author(.)"/>
           </xsl:when>
           <xsl:otherwise>
Function external:converter_INFO_to_loncapa_author()
is not available!
           </xsl:otherwise>
         </xsl:choose>
         <xsl:choose>
           <xsl:when
               test="function-available('external:converter_INFO_to_loncapa_owner')"
             >
             <xsl:value-of select=
        "external:converter_INFO_to_loncapa_owner(.)"/>
           </xsl:when>
           <xsl:otherwise>
Function external:converter_INFO_to_loncapa_owner()
is not available!
           </xsl:otherwise>
         </xsl:choose>
</xsl:template>
<xsl:template match="lom:LifeCycle/lom:Contribute/lom:Role">
         <xsl:choose>
           <xsl:when
               test="function-available('external:lomnsdl_LifeCycleContributeRole_to_converter_INFO')"
             >
             <xsl:value-of select=
              "external:lomnsdl_LifeCycleContributeRole_to_converter_INFO(.)"/>
           </xsl:when>
           <xsl:otherwise>
Function external:lomnsdl_LifeCycleContributeRole_to_converter_INFO() is not
available!
           </xsl:otherwise>
         </xsl:choose>
</xsl:template>
<xsl:template match="lom:LifeCycle/lom:Contribute/lom:Entry">
         <xsl:choose>
           <xsl:when
               test="function-available('external:lomnsdl_LifeCycleContributeEntry_to_converter_INFO')"
             >
             <xsl:value-of select=
             "external:lomnsdl_LifeCycleContributeEntry_to_converter_INFO(.)"/>
           </xsl:when>
           <xsl:otherwise>
Function external:lomnsdl_LifeCycleContributeEntry_to_converter_INFO() is not
available!
           </xsl:otherwise>
         </xsl:choose>
</xsl:template>
<xsl:template match="lom:LifeCycle/lom:Contribute/lom:Date">
         <xsl:choose>
           <xsl:when
               test="function-available('external:lomnsdl_LifeCycleContributeDate_to_converter_INFO')"
             >
             <xsl:value-of select=
              "external:lomnsdl_LifeCycleContributeDate_to_converter_INFO(.)"/>
           </xsl:when>
           <xsl:otherwise>
Function external:lomnsdl_LifeCycleContributeDate_to_converter_INFO() is not
available!
           </xsl:otherwise>
         </xsl:choose>
</xsl:template>
<xsl:template match="lom:Technical/lom:Format">
<mime>
         <xsl:choose>
           <xsl:when
  test="function-available('external:lomnsdl_TechnicalFormat_to_loncapa_mime')"
             >
             <xsl:value-of select=
                        "external:lomnsdl_TechnicalFormat_to_loncapa_mime(.)"/>
           </xsl:when>
           <xsl:otherwise>
  Function external:lomnsdl_TechnicalFormat_to_loncapa_mime() is not available!
           </xsl:otherwise>
         </xsl:choose>
</mime>
<xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="lom:Technical/lom:Size">
<bytesize>
         <xsl:choose>
           <xsl:when
test="function-available('external:lomnsdl_TechnicalSize_to_loncapa_bytesize')"
             >
             <xsl:value-of select=
                  "external:lomnsdl_TechnicalSize_to_loncapa_bytesize(.)"/>
           </xsl:when>
           <xsl:otherwise>
Function external:lomnsdl_TechnicalSize_to_loncapa_bytesize() is not available!
           </xsl:otherwise>
         </xsl:choose>
</bytesize>
<xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="lom:Educational/lom:Description">
<notes>
         <xsl:choose>
           <xsl:when
  test="function-available('external:lomnsdl_EducationalDescription_to_loncapa_notes')"
             >
             <xsl:value-of select=
                        "external:lomnsdl_EducationalDescription_to_loncapa_notes(.)"/>
           </xsl:when>
           <xsl:otherwise>
Function external:lomnsdl_EducationalDescription_to_loncapa_notes() is not
available!
           </xsl:otherwise>
         </xsl:choose>
</notes>
<xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="lom:Rights">
         <xsl:choose>
           <xsl:when
               test="function-available('external:lomnsdl_Rights_prepare_converter_INFO')"
             >
             <xsl:value-of select=
        "external:lomnsdl_Rights_prepare_converter_INFO(.)"/>
           </xsl:when>
           <xsl:otherwise>
    Function external:lomnsdl_Rights_prepare_converter_INFO() is not available!
           </xsl:otherwise>
         </xsl:choose>
<xsl:apply-templates select="/*/lom:Rights/lom:CopyrightandOtherRestrictions"/>
<xsl:apply-templates select="/*/lom:Rights/lom:Description"/>
         <xsl:choose>
           <xsl:when
               test=
           "function-available('external:converter_INFO_to_loncapa_copyright')"
             >
             <xsl:value-of select=
        "external:converter_INFO_to_loncapa_copyright(.)"/>
           </xsl:when>
           <xsl:otherwise>
Function external:converter_INFO_to_loncapa_copyright() is not available!
           </xsl:otherwise>
         </xsl:choose>
</xsl:template>
<xsl:template match="lom:Rights/lom:CopyrightandOtherRestrictions">
         <xsl:choose>
           <xsl:when
            test="function-available('external:lomnsdl_RightsCopyrightandOtherRestrictions_to_converter_INFO')"
             >
             <xsl:value-of select=
  "external:lomnsdl_RightsCopyrightandOtherRestrictions_to_converter_INFO(.)"/>
           </xsl:when>
           <xsl:otherwise>
Function
external:lomnsdl_RightsCopyrightandOtherRestrictions_to_converter_INFO()
is not available!
           </xsl:otherwise>
         </xsl:choose>
</xsl:template>
<xsl:template match="lom:Rights/lom:Description">
         <xsl:choose>
           <xsl:when
            test="function-available('external:lomnsdl_RightsDescription_to_converter_INFO')"
             >
             <xsl:value-of select=
  "external:lomnsdl_RightsDescription_to_converter_INFO(.)"/>
           </xsl:when>
           <xsl:otherwise>
Function external:lomnsdl_RightsDescription_to_converter_INFO() is not
available!
           </xsl:otherwise>
         </xsl:choose>
</xsl:template>
</xsl:stylesheet>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>