File:  [LON-CAPA] / nsdl / lib / stylesheets / loncapa_to_lomnsdl.xsl
Revision 1.1: download - view: text, annotated - select for diffs
Sun Jul 14 07:51:43 2002 UTC (22 years, 3 months ago) by harris41
Branches: MAIN
CVS tags: HEAD
stylesheet for converting loncapa "qualified" xml to IEEE LOM (where
the dtd approximates what LTSC will hopefully someday release)

    1: <?xml version="1.0"?> 
    2: <xsl:stylesheet
    3:   xmlns:loncapa="http://nsdl.lon-capa.org/loncapa/elements/1.1/"
    4:   xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
    5:   xmlns:external="http://nsdl.lon-capa.org/namespace/ExternalFunction/"
    6: >
    7: <xsl:template match="/">
    8: <!-- These values are stored in memory (converter_INFO) -->
    9: <xsl:apply-templates select="/*/loncapa:language"/>
   10: <xsl:apply-templates select="/*/loncapa:author"/>
   11: <xsl:apply-templates select="/*/loncapa:lastrevisiondate"/>
   12: <xsl:apply-templates select="/*/loncapa:metauri"/>
   13: <xsl:apply-templates select="/*/loncapa:copyright"/>
   14: <xsl:apply-templates select="/*/loncapa:owner"/>
   15: <lom:lom xmlns:lom="http://nsdl.lon-capa.org/lom/elements/6.4/">
   16: <xsl:text>
   17: </xsl:text>
   18: <General>
   19:  <Identifier>
   20:   <Catalog>LON</Catalog>
   21:          <xsl:choose>
   22:            <xsl:when
   23:                  test=
   24:          "function-available('external:converter_INFO_to_lomnsdl_GeneralIdentifierEntry')"
   25:              >
   26:      <xsl:value-of select="external:converter_INFO_to_lomnsdl_GeneralIdentifierEntry(.)"/>
   27:            </xsl:when>
   28:            <xsl:otherwise>
   29: Function external:converter_INFO_to_lomnsdl_GeneralIdentifierEntry() is not
   30: available!
   31:            </xsl:otherwise>
   32:          </xsl:choose>
   33:  </Identifier>
   34:  <xsl:apply-templates select="/*/loncapa:title"/>
   35:          <xsl:choose>
   36:            <xsl:when
   37:                  test=
   38:          "function-available('external:converter_INFO_to_lomnsdl_GeneralLanguage')"
   39:              >
   40:      <xsl:value-of select="external:converter_INFO_to_lomnsdl_GeneralLanguage(.)"/>
   41:            </xsl:when>
   42:            <xsl:otherwise>
   43:     Function external:converter_INFO_to_lomnsdl_GeneralLanguage() is not available!
   44:            </xsl:otherwise>
   45:          </xsl:choose>
   46:  <xsl:apply-templates select="/*/loncapa:abstract"/>
   47:  <xsl:apply-templates select="/*/loncapa:keywords"/>
   48:  <xsl:apply-templates select="/*/loncapa:structure"/>
   49:  <xsl:apply-templates select="/*/loncapa:aggregation"/>
   50: </General>
   51: 
   52: <LifeCycle>
   53:  <xsl:apply-templates select="/*/loncapa:version"/>
   54:  <Contribute>
   55:  <Role>author</Role>
   56:  <Entity>
   57:          <xsl:choose>
   58:            <xsl:when
   59:                  test=
   60:       "function-available('external:converter_INFO_to_lomnsdl_LifeCycleContributeEntity')"
   61:              >
   62:      <xsl:value-of select="external:converter_INFO_to_lomnsdl_LifeCycleContributeEntity(.)"/>
   63:            </xsl:when>
   64:            <xsl:otherwise>
   65:     Function external:converter_INFO_to_lomnsdl_LifeCycleContributeEntity() is not available!
   66:            </xsl:otherwise>
   67:          </xsl:choose>
   68:  </Entity>
   69:  <Date>
   70:          <xsl:choose>
   71:            <xsl:when
   72:                  test=
   73:          "function-available('external:converter_INFO_to_lomnsdl_LifeCycleContributeDate')"
   74:              >
   75:      <xsl:value-of select="external:converter_INFO_to_lomnsdl_LifeCycleContributeDate(.)"/>
   76:            </xsl:when>
   77:            <xsl:otherwise>
   78:     Function external:converter_INFO_to_lomnsdl_LifeCycleContributeDate() is not available!
   79:            </xsl:otherwise>
   80:          </xsl:choose>
   81:  </Date>
   82:  </Contribute>
   83: </LifeCycle>
   84: 
   85: <MetaMetadata>
   86:          <xsl:choose>
   87:            <xsl:when
   88:                  test=
   89:         "function-available('external:converter_INFO_to_lomnsdl_MetaMetadata')"
   90:              >
   91:     <xsl:value-of select="external:converter_INFO_to_lomnsdl_MetaMetadata(.)"/>
   92:            </xsl:when>
   93:            <xsl:otherwise>
   94:    Function external:converter_INFO_to_lomnsdl_MetaMetadata() is not available!
   95:            </xsl:otherwise>
   96:          </xsl:choose>
   97: </MetaMetadata>
   98: 
   99: <Technical>
  100:  <xsl:apply-templates select="/*/loncapa:mime"/>
  101:  <xsl:apply-templates select="/*/loncapa:bytesize"/>
  102:  <Location>
  103:          <xsl:choose>
  104:            <xsl:when
  105:                  test=
  106:    "function-available('external:converter_INFO_to_lomnsdl_TechnicalLocation')"
  107:              >
  108:              <xsl:value-of 
  109:              select="external:converter_INFO_to_lomnsdl_TechnicalLocation(.)"/>
  110:            </xsl:when>
  111:            <xsl:otherwise>
  112:    Function external:converter_INFO_to_lomnsdl_TechnicalLocation() is not
  113: available!
  114:            </xsl:otherwise>
  115:          </xsl:choose>
  116:  </Location>
  117:  <Requirement>
  118:          <xsl:choose>
  119:            <xsl:when
  120:                  test=
  121: "function-available('external:converter_INFO_to_lomnsdl_TechnicalRequirement')"
  122:              >
  123:              <xsl:value-of 
  124:           select="external:converter_INFO_to_lomnsdl_TechnicalRequirement(.)"/>
  125:            </xsl:when>
  126:            <xsl:otherwise>
  127:    Function external:converter_INFO_to_lomnsdl_TechnicalRequirement() is not
  128: available!
  129:            </xsl:otherwise>
  130:          </xsl:choose>
  131:  </Requirement>
  132: </Technical>
  133: 
  134: <Educational>
  135:  <xsl:apply-templates select="/*/loncapa:notes"/>
  136:  <Language>
  137:          <xsl:choose>
  138:            <xsl:when
  139:                  test=
  140: "function-available('external:converter_INFO_to_lomnsdl_EducationalLanguage')"
  141:              >
  142:              <xsl:value-of 
  143:           select="external:converter_INFO_to_lomnsdl_EducationalLanguage(.)"/>
  144:            </xsl:when>
  145:            <xsl:otherwise>
  146:    Function external:converter_INFO_to_lomnsdl_EducationalLanguage() is not
  147: available!
  148:            </xsl:otherwise>
  149:          </xsl:choose>
  150:  </Language>
  151: </Educational>
  152: 
  153: <Rights>
  154:  <CopyrightandOtherRestrictions>yes</CopyrightandOtherRestrictions>
  155:  <Description>
  156:          <xsl:choose>
  157:            <xsl:when
  158:                  test=
  159: "function-available('external:converter_INFO_to_lomnsdl_RightsDescription')"
  160:              >
  161:              <xsl:value-of 
  162:           select="external:converter_INFO_to_lomnsdl_RightsDescription(.)"/>
  163:            </xsl:when>
  164:            <xsl:otherwise>
  165:          Function external:converter_INFO_to_lomnsdl_RightsDescription() is not
  166: available!
  167:            </xsl:otherwise>
  168:          </xsl:choose>
  169:  </Description>
  170: </Rights>
  171: <xsl:text>
  172: </xsl:text>
  173: 
  174: </lom:lom>
  175: </xsl:template>
  176: <xsl:template match="loncapa:title">
  177: <Title>
  178:          <xsl:choose>
  179:            <xsl:when
  180:                  test=
  181:          "function-available('external:loncapa_title_to_lomnsdl_GeneralTitle')"
  182:              >
  183:      <xsl:value-of select="external:loncapa_title_to_lomnsdl_GeneralTitle(.)"/>
  184:            </xsl:when>
  185:            <xsl:otherwise>
  186:     Function external:loncapa_title_to_lomnsdl_GeneralTitle() is not available!
  187:            </xsl:otherwise>
  188:          </xsl:choose>
  189: </Title>
  190: <xsl:text>
  191: </xsl:text>
  192: </xsl:template>
  193: <xsl:template match="loncapa:abstract">
  194: <Description>
  195:          <xsl:choose>
  196:            <xsl:when
  197:                  test=
  198: "function-available('external:loncapa_abstract_to_lomnsdl_GeneralDescription')"
  199:              >
  200:      <xsl:value-of select=
  201:                  "external:loncapa_abstract_to_lomnsdl_GeneralDescription(.)"/>
  202:            </xsl:when>
  203:            <xsl:otherwise>
  204:     Function external:loncapa_abstract_to_lomnsdl_GeneralDescription() is not
  205: available!
  206:            </xsl:otherwise>
  207:          </xsl:choose>
  208: </Description>
  209: <xsl:text>
  210: </xsl:text>
  211: </xsl:template>
  212: <xsl:template match="loncapa:keywords">
  213: <Keyword>
  214:          <xsl:choose>
  215:            <xsl:when
  216:                  test=
  217: "function-available('external:loncapa_keywords_to_lomnsdl_GeneralKeyword')"
  218:              >
  219:      <xsl:value-of select=
  220:                  "external:loncapa_keywords_to_lomnsdl_GeneralKeyword(.)"/>
  221:            </xsl:when>
  222:            <xsl:otherwise>
  223:     Function external:loncapa_keywords_to_lomnsdl_GeneralKeyword() is not
  224: available!
  225:            </xsl:otherwise>
  226:          </xsl:choose>
  227: </Keyword>
  228: <xsl:text>
  229: </xsl:text>
  230: </xsl:template>
  231: <xsl:template match="loncapa:structure">
  232: <Structure>
  233:          <xsl:choose>
  234:            <xsl:when
  235:                  test=
  236: "function-available('external:loncapa_structure_to_lomnsdl_GeneralStructure')"
  237:              >
  238:      <xsl:value-of select=
  239:                   "external:loncapa_structure_to_lomnsdl_GeneralStructure(.)"/>
  240:            </xsl:when>
  241:            <xsl:otherwise>
  242:     Function external:loncapa_structure_to_lomnsdl_GeneralStructure() is not
  243: available!
  244:            </xsl:otherwise>
  245:          </xsl:choose>
  246: </Structure>
  247: <xsl:text>
  248: </xsl:text>
  249: </xsl:template>
  250: <xsl:template match="loncapa:aggregation">
  251: <AggregationLevel>
  252:          <xsl:choose>
  253:            <xsl:when
  254:                  test=
  255: "function-available('external:loncapa_aggregation_to_lomnsdl_GeneralAggregationLevel')"
  256:              >
  257:      <xsl:value-of select=
  258:          "external:loncapa_aggregation_to_lomnsdl_GeneralAggregationLevel(.)"/>
  259:            </xsl:when>
  260:            <xsl:otherwise>
  261: Function external:loncapa_aggregation_to_lomnsdl_GeneralAggregationLevel() is
  262: not available!
  263:            </xsl:otherwise>
  264:          </xsl:choose>
  265: </AggregationLevel>
  266: <xsl:text>
  267: </xsl:text>
  268: </xsl:template>
  269: <xsl:template match="loncapa:version">
  270: <Version>
  271:          <xsl:choose>
  272:            <xsl:when
  273:                  test=
  274: "function-available('external:loncapa_version_to_lomnsdl_LifeCycleVersion')"
  275:              >
  276:      <xsl:value-of select=
  277:          "external:loncapa_version_to_lomnsdl_LifeCycleVersion(.)"/>
  278:            </xsl:when>
  279:            <xsl:otherwise>
  280: Function external:loncapa_version_to_lomnsdl_LifeCycleVersion() is
  281: not available!
  282:            </xsl:otherwise>
  283:          </xsl:choose>
  284: </Version>
  285: <xsl:text>
  286: </xsl:text>
  287: </xsl:template>
  288: <xsl:template match="loncapa:mime">
  289: <Format>
  290:          <xsl:choose>
  291:            <xsl:when
  292:                  test=
  293: "function-available('external:loncapa_mime_to_lomnsdl_TechnicalFormat')"
  294:              >
  295:      <xsl:value-of select=
  296:          "external:loncapa_mime_to_lomnsdl_TechnicalFormat(.)"/>
  297:            </xsl:when>
  298:            <xsl:otherwise>
  299: Function external:loncapa_mime_to_lomnsdl_TechnicalFormat() is not available!
  300:            </xsl:otherwise>
  301:          </xsl:choose>
  302: </Format>
  303: <xsl:text>
  304: </xsl:text>
  305: </xsl:template>
  306: <xsl:template match="loncapa:bytesize">
  307: <Size>
  308:          <xsl:choose>
  309:            <xsl:when
  310:                  test=
  311: "function-available('external:loncapa_bytesize_to_lomnsdl_TechnicalSize')"
  312:              >
  313:      <xsl:value-of select=
  314:          "external:loncapa_bytesize_to_lomnsdl_TechnicalSize(.)"/>
  315:            </xsl:when>
  316:            <xsl:otherwise>
  317: Function external:loncapa_bytesize_to_lomnsdl_TechnicalSize() is
  318: not available!
  319:            </xsl:otherwise>
  320:          </xsl:choose>
  321: </Size>
  322: <xsl:text>
  323: </xsl:text>
  324: </xsl:template>
  325: <xsl:template match="loncapa:notes">
  326: <Description>
  327:          <xsl:choose>
  328:            <xsl:when
  329:                  test=
  330: "function-available('external:loncapa_notes_to_lomnsdl_EducationalDescription')"
  331:              >
  332:      <xsl:value-of select=
  333:          "external:loncapa_notes_to_lomnsdl_EducationalDescription(.)"/>
  334:            </xsl:when>
  335:            <xsl:otherwise>
  336: Function external:loncapa_notes_to_lomnsdl_EducationalDescription() is
  337: not available!
  338:            </xsl:otherwise>
  339:          </xsl:choose>
  340: </Description>
  341: <xsl:text>
  342: </xsl:text>
  343: </xsl:template>
  344: <xsl:template match="loncapa:language">
  345:          <xsl:choose>
  346:            <xsl:when
  347:                  test=
  348:           "function-available('external:loncapa_language_to_converter_INFO')"
  349:              >
  350:              <xsl:value-of select=
  351:                            "external:loncapa_language_to_converter_INFO(.)"/>
  352:            </xsl:when>
  353:            <xsl:otherwise>
  354:      Function external:loncapa_language_to_converter_INFO() is not available!
  355:            </xsl:otherwise>
  356:          </xsl:choose>
  357: </xsl:template>
  358: <xsl:template match="loncapa:author">
  359:          <xsl:choose>
  360:            <xsl:when
  361:                  test=
  362:          "function-available('external:loncapa_author_to_converter_INFO')"
  363:              >
  364:              <xsl:value-of
  365:                     select="external:loncapa_author_to_converter_INFO(.)"/>
  366:            </xsl:when>
  367:            <xsl:otherwise>
  368:          Function external:loncapa_author_to_converter_INFO() is not available!
  369:            </xsl:otherwise>
  370:          </xsl:choose>
  371: </xsl:template>
  372: <xsl:template match="loncapa:lastrevisiondate">
  373:          <xsl:choose>
  374:            <xsl:when
  375:                  test=
  376:     "function-available('external:loncapa_lastrevisiondate_to_converter_INFO')"
  377:              >
  378:              <xsl:value-of
  379:               select="external:loncapa_lastrevisiondate_to_converter_INFO(.)"/>
  380:            </xsl:when>
  381:            <xsl:otherwise>
  382:           Function external:loncapa_lastrevisiondate_to_converter_INFO() is not
  383: available!
  384:            </xsl:otherwise>
  385:          </xsl:choose>
  386: </xsl:template>
  387: <xsl:template match="loncapa:metauri">
  388:          <xsl:choose>
  389:            <xsl:when
  390:                  test=
  391:     "function-available('external:loncapa_metauri_to_converter_INFO')"
  392:              >
  393:              <xsl:value-of
  394:               select="external:loncapa_metauri_to_converter_INFO(.)"/>
  395:            </xsl:when>
  396:            <xsl:otherwise>
  397:           Function external:loncapa_metauri_to_converter_INFO() is not
  398: available!
  399:            </xsl:otherwise>
  400:          </xsl:choose>
  401: </xsl:template>
  402: <xsl:template match="loncapa:copyright">
  403:          <xsl:choose>
  404:            <xsl:when
  405:                  test=
  406:     "function-available('external:loncapa_copyright_to_converter_INFO')"
  407:              >
  408:              <xsl:value-of
  409:               select="external:loncapa_copyright_to_converter_INFO(.)"/>
  410:            </xsl:when>
  411:            <xsl:otherwise>
  412:           Function external:loncapa_copyright_to_converter_INFO() is not
  413: available!
  414:            </xsl:otherwise>
  415:          </xsl:choose>
  416: </xsl:template>
  417: <xsl:template match="loncapa:owner">
  418:          <xsl:choose>
  419:            <xsl:when
  420:                  test=
  421:     "function-available('external:loncapa_owner_to_converter_INFO')"
  422:              >
  423:              <xsl:value-of
  424:               select="external:loncapa_owner_to_converter_INFO(.)"/>
  425:            </xsl:when>
  426:            <xsl:otherwise>
  427:           Function external:loncapa_owner_to_converter_INFO() is not
  428: available!
  429:            </xsl:otherwise>
  430:          </xsl:choose>
  431: </xsl:template>
  432: </xsl:stylesheet>

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