use XML::Xalan; my $tr = new XML::Xalan::Transformer; my $LONCAPA_metadata=(< Felicia Berryman, MSU HHMI First Year Online Biology default 1011110523 biomolecules,practice seniso 1011110523 html bio\@msu, bio\@msu (Michigan State University), bio\@msu (Michigan State University), bio\@msu (Michigan State University) Bio Information, Large Biomolecules - Intro, Large Biomolecules - Review Test title END # ---------------------------------------------------- The 16 major nsdl fields # Audience # Publisher # Contributor # Relation # Coverage # Resource Identifier # Creator # Resource Type # Date # Rights # Description # Source # Format # Subject & Keywords # Language # Title # --------------- also need educational recommended fields # (there are also other identified cross-walk strategies for 8 other metadata # standards) #http://metamanagement.comm.nsdlib.org/overview.html#NSDL #http://www.dlib.vt.edu/projects/OAi/marcxml/marcxml.html #http://www.openarchives.org/OAI/openarchivesprotocol.html # "> my $NSDL_metadata1=(< The Cornell Law Quarterly 1915-1916 http://heinonline.org/HeinOnline/show.pl? handle=hein.journals/clqv1%26id=1%26size=4 Available by Subscription. See http://www.wshein.com END open(OUT,'>tmpdc.xml'); print(OUT < Grassmann's space analysis Hyde, E. W. (Edward Wyllys) LCSH:Ausdehnungslehre; LCCN QA205.H99 J. Wiley & Sons Created: 1906; Available: 1991 text http://resolver.library.cornell.edu/math/1796949 eng Public Domain END open(OUT,'>tmploncapa.xml'); print(OUT < $LONCAPA_metadata END close(OUT); # probably also want to protect dc name-space open(OUT,'>tmpl2n.xsl'); print(OUT < <xsl:value-of select="title"/> <!-- NEED TO IMPLEMENT --> <!-- converted from LON-CAPA language tag to Dublin Core language tag --> <!-- NEED TO IMPLEMENT --> <!-- converted from LON-CAPA seconds since 1/1/1970 to standard calendar values --> Created: ; Last revised: <!-- NEED TO IMPLEMENT --> <!-- allow some sort of mapping to Library of Congress or Dewey Decimal standard subject mapping --> <!-- NEED TO IMPLEMENT --> unknown mapping <!-- NEED TO IMPLEMENT --> unknown mapping (coauthors?) <!-- NEED TO IMPLEMENT --> unknown mapping... prerequisite/postrequisite info could go here <!-- NEED TO IMPLEMENT --> unknown mapping <!-- NEED TO IMPLEMENT --> the gateway url <!-- NEED TO IMPLEMENT --> <!-- probably mapping from LON-CAPA mime typing --> n/a <!-- NEED TO IMPLEMENT --> <!-- probably mapping from LON-CAPA copyright --> n/a # Source <!-- NEED TO IMPLEMENT --> software and hardware needed <!-- NEED TO IMPLEMENT --> need to break things into formal "classification" tag to insert keywords END close(OUT); # probably also want to protect dc name-space open(OUT,'>tmpn2l.xsl'); print(OUT < <xsl:value-of select="."/> END close(OUT); # ---------------------------------- LON-CAPA to NSDL (Dublic Core PLUS format) my $compiled = $tr->compile_stylesheet_file("tmpl2n.xsl"); my $parsed = $tr->parse_file("tmploncapa.xml"); my $dest_file="l2n.xml"; $tr->transform_to_file($parsed, $compiled, $dest_file) or die $tr->errstr; # ---------------------------------- NSDL (Dublic Core PLUS format) to LON-CAPA my $compiled = $tr->compile_stylesheet_file("tmpn2l.xsl"); my $parsed = $tr->parse_file("tmpdc.xml"); my $dest_file="n2l.xml"; $tr->transform_to_file($parsed, $compiled, $dest_file) or die $tr->errstr; # ---------------------------------- test my $compiled = $tr->compile_stylesheet_file("test1.xsl"); my $parsed = $tr->parse_file("test1.xml"); my $dest_file="test1out.xml"; $tr->transform_to_file($parsed, $compiled, $dest_file) or die $tr->errstr;