Return to dcnsdl_to_loncapa.xsl CVS log | Up to [LON-CAPA] / nsdl / lib / stylesheets |
stylesheet for converting dcnsdl to loncapa "qualified" xml
1: <?xml version="1.0"?> 2: <xsl:stylesheet 3: xmlns:dc="http://purl.org/dc/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: <loncapa:loncapa 9: xmlns:loncapa="http://nsdl.lon-capa.org/loncapa/elements/1.1/"> 10: <xsl:text> 11: </xsl:text> 12: <xsl:apply-templates select="/*/dc:identifier"/> 13: <xsl:apply-templates select="/*/dc:title"/> 14: <xsl:apply-templates select="/*/dc:language"/> 15: <xsl:apply-templates select="/*/dc:description"/> 16: <xsl:apply-templates select="/*/dc:subject"/> 17: <!-- xsl:apply-templates select="/*/dc:coverage"/ --> 18: <xsl:apply-templates select="/*/dc:creator"/> 19: <xsl:apply-templates select="/*/dc:publisher"/> 20: <xsl:apply-templates select="/*/dc:date"/> 21: <xsl:apply-templates select="/*/dc:format"/> 22: <!-- xsl:apply-templates select="/*/dc:type"/ --> 23: <xsl:apply-templates select="/*/dc:rights"/> 24: <!-- xsl:apply-templates select="/*/dc:source"/ --> 25: <!-- xsl:apply-templates select="/*/dc:relation"/ --> 26: </loncapa:loncapa> 27: <xsl:text> 28: </xsl:text> 29: </xsl:template> 30: <xsl:template match="dc:identifier"> 31: <uri> 32: <xsl:choose> 33: <xsl:when 34: test="function-available('external:dcnsdl_identifier_to_loncapa_uri')" 35: > 36: <xsl:value-of select= 37: "external:dcnsdl_identifier_to_loncapa_uri(.)"/> 38: </xsl:when> 39: <xsl:otherwise> 40: Function external:dcnsdl_identifier_to_loncapa_uri() is not available! 41: </xsl:otherwise> 42: </xsl:choose> 43: </uri> 44: <xsl:text> 45: </xsl:text> 46: </xsl:template> 47: <xsl:template match="dc:title"> 48: <title> 49: <xsl:choose> 50: <xsl:when 51: test="function-available('external:dcnsdl_title_to_loncapa_title')" 52: > 53: <xsl:value-of select="external:dcnsdl_title_to_loncapa_title(.)"/> 54: </xsl:when> 55: <xsl:otherwise> 56: Function external:dcnsdl_title_to_loncapa_title() is not available! 57: </xsl:otherwise> 58: </xsl:choose> 59: </title> 60: <xsl:text> 61: </xsl:text> 62: </xsl:template> 63: <xsl:template match="dc:language"> 64: <language> 65: <xsl:choose> 66: <xsl:when 67: test="function-available('external:dcnsdl_language_to_loncapa_language')" 68: > 69: <xsl:value-of select= 70: "external:dcnsdl_language_to_loncapa_language(.)"/> 71: </xsl:when> 72: <xsl:otherwise> 73: Function external:dcnsdl_language_to_loncapa_language() is not available! 74: </xsl:otherwise> 75: </xsl:choose> 76: </language> 77: <xsl:text> 78: </xsl:text> 79: </xsl:template> 80: <xsl:template match="dc:description"> 81: <abstract> 82: <xsl:choose> 83: <xsl:when 84: test="function-available('external:dcnsdl_description_to_loncapa_abstract')" 85: > 86: <xsl:value-of select= 87: "external:dcnsdl_description_to_loncapa_abstract(.)"/> 88: </xsl:when> 89: <xsl:otherwise> 90: Function external:dcnsdl_description_to_loncapa_abstract() is not available! 91: </xsl:otherwise> 92: </xsl:choose> 93: </abstract> 94: <xsl:text> 95: </xsl:text> 96: </xsl:template> 97: <xsl:template match="dc:subject"> 98: <subject> 99: <xsl:choose> 100: <xsl:when 101: test="function-available('external:dcnsdl_subject_to_loncapa_subject')" 102: > 103: <xsl:value-of select= 104: "external:dcnsdl_subject_to_loncapa_subject(.)"/> 105: </xsl:when> 106: <xsl:otherwise> 107: Function external:dcnsdl_subject_to_loncapa_subject() is not available! 108: </xsl:otherwise> 109: </xsl:choose> 110: </subject> 111: <xsl:text> 112: </xsl:text> 113: </xsl:template> 114: <xsl:template match="dc:creator"> 115: <author> 116: <xsl:choose> 117: <xsl:when 118: test="function-available('external:dcnsdl_creator_to_loncapa_author')" 119: > 120: <xsl:value-of select= 121: "external:dcnsdl_creator_to_loncapa_author(.)"/> 122: </xsl:when> 123: <xsl:otherwise> 124: Function external:dcnsdl_creator_to_loncapa_author() is not available! 125: </xsl:otherwise> 126: </xsl:choose> 127: </author> 128: <xsl:text> 129: </xsl:text> 130: </xsl:template> 131: <xsl:template match="dc:publisher"> 132: <owner> 133: <xsl:choose> 134: <xsl:when 135: test="function-available('external:dcnsdl_publisher_to_loncapa_owner')" 136: > 137: <xsl:value-of select= 138: "external:dcnsdl_publisher_to_loncapa_owner(.)"/> 139: </xsl:when> 140: <xsl:otherwise> 141: Function external:dcnsdl_publisher_to_loncapa_owner() is not available! 142: </xsl:otherwise> 143: </xsl:choose> 144: </owner> 145: <xsl:text> 146: </xsl:text> 147: </xsl:template> 148: <xsl:template match="dc:date"> 149: <lastrevisiondate> 150: <xsl:choose> 151: <xsl:when 152: test="function-available('external:dcnsdl_date_to_loncapa_lastrevisiondate')" 153: > 154: <xsl:value-of select= 155: "external:dcnsdl_date_to_loncapa_lastrevisiondate(.)"/> 156: </xsl:when> 157: <xsl:otherwise> 158: Function external:dcnsdl_date_to_loncapa_lastrevisiondate() is not available! 159: </xsl:otherwise> 160: </xsl:choose> 161: </lastrevisiondate> 162: <xsl:text> 163: </xsl:text> 164: </xsl:template> 165: <xsl:template match="dc:format"> 166: <mime> 167: <xsl:choose> 168: <xsl:when 169: test="function-available('external:dcnsdl_format_to_loncapa_mime')" 170: > 171: <xsl:value-of select= 172: "external:dcnsdl_format_to_loncapa_mime(.)"/> 173: </xsl:when> 174: <xsl:otherwise> 175: Function external:dcnsdl_format_to_loncapa_mime() is not available! 176: </xsl:otherwise> 177: </xsl:choose> 178: </mime> 179: <xsl:text> 180: </xsl:text> 181: </xsl:template> 182: <xsl:template match="dc:rights"> 183: <copyright> 184: <xsl:choose> 185: <xsl:when 186: test="function-available('external:dcnsdl_rights_to_loncapa_copyright')" 187: > 188: <xsl:value-of select= 189: "external:dcnsdl_rights_to_loncapa_copyright(.)"/> 190: </xsl:when> 191: <xsl:otherwise> 192: Function external:dcnsdl_rights_to_loncapa_copyright() is not available! 193: </xsl:otherwise> 194: </xsl:choose> 195: </copyright> 196: <xsl:text> 197: </xsl:text> 198: </xsl:template> 199: </xsl:stylesheet>