From dad313c700b9ff9b4728d1b8ef4a0ab5bedf86b1 Mon Sep 17 00:00:00 2001 From: Marc Cromme Date: Wed, 4 Oct 2006 11:21:47 +0000 Subject: [PATCH] added xml ressources - most notably the LOC marc21-toXYZ stylesheets added correct reading of filter_record_transform XML config files still need to program record conversion in filter_record_transform --- etc/config-record-transform.xml | 59 + src/filter_record_transform.cpp | 125 +- src/gduutil.cpp | 11 +- src/test_filter_record_transform.cpp | 98 +- xml/schema/MARC21slim.xsd | 137 ++ xml/xslt/MARC21slim2DC.xsl | 198 +++ xml/xslt/MARC21slim2MADS.xsl | 1048 ++++++++++++++ xml/xslt/MARC21slim2MODS.xsl | 1873 +++++++++++++++++++++++++ xml/xslt/MARC21slim2MODS3-1.xsl | 2514 ++++++++++++++++++++++++++++++++++ xml/xslt/MARC21slim2RDFDC.xsl | 197 +++ xml/xslt/MARC21slim2SRWDC.xsl | 261 ++++ xml/xslt/MARC21slimUtils.xsl | 65 + 12 files changed, 6477 insertions(+), 109 deletions(-) create mode 100644 etc/config-record-transform.xml create mode 100644 xml/schema/MARC21slim.xsd create mode 100644 xml/xslt/MARC21slim2DC.xsl create mode 100644 xml/xslt/MARC21slim2MADS.xsl create mode 100644 xml/xslt/MARC21slim2MODS.xsl create mode 100644 xml/xslt/MARC21slim2MODS3-1.xsl create mode 100644 xml/xslt/MARC21slim2RDFDC.xsl create mode 100644 xml/xslt/MARC21slim2SRWDC.xsl create mode 100644 xml/xslt/MARC21slimUtils.xsl diff --git a/etc/config-record-transform.xml b/etc/config-record-transform.xml new file mode 100644 index 0000000..b3e775d --- /dev/null +++ b/etc/config-record-transform.xml @@ -0,0 +1,59 @@ + + + + + + + 10 + @:9000 + + + 30 + + + + + + + Front + + + + + + + + + + + + + + + + + + + + + + + + + + Back + + + + + + + diff --git a/src/filter_record_transform.cpp b/src/filter_record_transform.cpp index 0fe086d..6201697 100644 --- a/src/filter_record_transform.cpp +++ b/src/filter_record_transform.cpp @@ -1,4 +1,4 @@ -/* $Id: filter_record_transform.cpp,v 1.1 2006-10-03 14:04:22 marc Exp $ +/* $Id: filter_record_transform.cpp,v 1.2 2006-10-04 11:21:47 marc Exp $ Copyright (c) 2005-2006, Index Data. See the LICENSE file for details @@ -10,8 +10,10 @@ #include "package.hpp" #include "util.hpp" #include "gduutil.hpp" +#include "xmlutil.hpp" #include +#include //#include @@ -29,7 +31,7 @@ namespace metaproxy_1 { void process(metaproxy_1::Package & package) const; void configure(const xmlNode * xml_node); private: - + yaz_retrieval_t m_retrieval; }; } } @@ -59,110 +61,109 @@ void yf::RecordTransform::process(mp::Package &package) const -yf::RecordTransform::Impl::Impl() +yf::RecordTransform::Impl::Impl() { + m_retrieval = yaz_retrieval_create(); + assert(m_retrieval); } yf::RecordTransform::Impl::~Impl() { + if (m_retrieval) + yaz_retrieval_destroy(m_retrieval); } void yf::RecordTransform::Impl::configure(const xmlNode *xml_node) { -// for (xml_node = xml_node->children; xml_node; xml_node = xml_node->next) -// { -// if (xml_node->type != XML_ELEMENT_NODE) -// continue; -// if (!strcmp((const char *) xml_node->name, "target")) -// { -// std::string route = mp::xml::get_route(xml_node); -// std::string target = mp::xml::get_text(xml_node); -// std::cout << "route=" << route << " target=" << target << "\n"; -// m_p->m_target_route[target] = route; -// } -// else if (!strcmp((const char *) xml_node->name, "hideunavailable")) -// { -// m_p->m_hide_unavailable = true; -// } -// else -// { -// throw mp::filter::FilterException -// ("Bad element " -// + std::string((const char *) xml_node->name) -// + " in virt_db filter"); -// } -// } + //const char *srcdir = getenv("srcdir"); + //if (srcdir) + // yaz_retrieval_set_path(m_retrieval, srcdir); + + if (!xml_node) + throw mp::XMLError("RecordTransform filter config: empty XML DOM"); + + // parsing down to retrieval node, which can be any of the children nodes + xmlNode *retrieval_node; + for (retrieval_node = xml_node->children; + retrieval_node; + retrieval_node = retrieval_node->next) + { + if (retrieval_node->type != XML_ELEMENT_NODE) + continue; + if (0 == strcmp((const char *) retrieval_node->name, "retrievalinfo")) + break; + } + + // read configuration + if ( 0 != yaz_retrieval_configure(m_retrieval, retrieval_node)){ + std::string msg("RecordTransform filter config: "); + msg += yaz_retrieval_get_error(m_retrieval); + throw mp::XMLError(msg); + } } void yf::RecordTransform::Impl::process(mp::Package &package) const { - Z_GDU *gdu = package.request().get(); + Z_GDU *gdu_req = package.request().get(); // only working on z3950 present packages - if (!gdu - || !(gdu->which == Z_GDU_Z3950) - || !(gdu->u.z3950->which == Z_APDU_presentRequest)) + if (!gdu_req + || !(gdu_req->which == Z_GDU_Z3950) + || !(gdu_req->u.z3950->which == Z_APDU_presentRequest)) { package.move(); return; } // getting original present request - Z_PresentRequest *front_pr = gdu->u.z3950->u.presentRequest; + Z_PresentRequest *pr = gdu_req->u.z3950->u.presentRequest; // setting up ODR's for memory during encoding/decoding - mp::odr odr_de(ODR_DECODE); + //mp::odr odr_de(ODR_DECODE); mp::odr odr_en(ODR_ENCODE); - // now packaging the z3950 backend present request - Package back_package(package.session(), package.origin()); - back_package.copy_filter(package); - - Z_APDU *apdu = zget_APDU(odr_en, Z_APDU_presentRequest); - - assert(apdu->u.presentRequest); - - // z3950'fy start record position - //if () - // *(apdu->u.presentRequest->resultSetStartPoint) - // = - - // z3950'fy number of records requested - //if () - // *(apdu->u.presentRequest->numberOfRecordsRequested) + // now re-insructing the z3950 backend present request // z3950'fy record syntax - //if() - //(apdu->u.presentRequest->preferredRecordSyntax) - // = yaz_oidval_to_z3950oid (odr_en, CLASS_RECSYN, VAL_TEXT_XML); + //Odr_oid odr_oid; + if(pr->preferredRecordSyntax){ + (pr->preferredRecordSyntax) + = yaz_str_to_z3950oid(odr_en, CLASS_RECSYN, "xml"); + + // = yaz_oidval_to_z3950oid (odr_en, CLASS_RECSYN, VAL_TEXT_XML); + } + // Odr_oid *yaz_str_to_z3950oid (ODR o, int oid_class, + // const char *str); + // const char *yaz_z3950oid_to_str (Odr_oid *oid, int *oid_class); + // z3950'fy record schema //if () // { - // apdu->u.presentRequest->recordComposition + // pr->recordComposition // = (Z_RecordComposition *) // odr_malloc(odr_en, sizeof(Z_RecordComposition)); - // apdu->u.presentRequest->recordComposition->which + // pr->recordComposition->which // = Z_RecordComp_simple; - // apdu->u.presentRequest->recordComposition->u.simple + // pr->recordComposition->u.simple // = build_esn_from_schema(odr_en, // (const char *) sr_req->recordSchema); // } // attaching Z3950 package to filter chain - back_package.request() = apdu; + package.request() = gdu_req; // std::cout << "z3950_present_request " << *apdu << "\n"; - // sending backend package - back_package.move(); + // sending package + package.move(); //check successful Z3950 present response - Z_GDU *back_gdu = back_package.response().get(); - if (!back_gdu || back_gdu->which != Z_GDU_Z3950 - || back_gdu->u.z3950->which != Z_APDU_presentResponse - || !back_gdu->u.z3950->u.presentResponse) + Z_GDU *gdu_res = package.response().get(); + if (!gdu_res || gdu_res->which != Z_GDU_Z3950 + || gdu_res->u.z3950->which != Z_APDU_presentResponse + || !gdu_res->u.z3950->u.presentResponse) { std::cout << "record-transform: error back present\n"; @@ -173,7 +174,7 @@ void yf::RecordTransform::Impl::process(mp::Package &package) const // everything fine, continuing // std::cout << "z3950_present_request OK\n"; - // std::cout << "back z3950 " << *back_gdu << "\n"; + // std::cout << "back z3950 " << *gdu_res << "\n"; return; diff --git a/src/gduutil.cpp b/src/gduutil.cpp index 373918f..c154b67 100644 --- a/src/gduutil.cpp +++ b/src/gduutil.cpp @@ -1,4 +1,4 @@ -/* $Id: gduutil.cpp,v 1.13 2006-09-26 13:15:33 marc Exp $ +/* $Id: gduutil.cpp,v 1.14 2006-10-04 11:21:47 marc Exp $ Copyright (c) 2005-2006, Index Data. See the LICENSE file for details @@ -229,10 +229,11 @@ std::ostream& std::operator<<(std::ostream& os, Z_APDU& zapdu) os << " " << *(pr->numberOfRecordsRequested); else os << " -"; - //if (pr->preferredRecordSyntax) - // os << " " << *(pr->preferredRecordSyntax); - //else - // os << " -"; + if (pr->preferredRecordSyntax) + //os << " " << pr->preferredRecordSyntax; + os << " " <<(oid_getentbyoid(pr->preferredRecordSyntax))->desc; + else + os << " -"; //elements //if (pr->) // os << " " << *(pr->); diff --git a/src/test_filter_record_transform.cpp b/src/test_filter_record_transform.cpp index cf54ff4..8ca06f7 100644 --- a/src/test_filter_record_transform.cpp +++ b/src/test_filter_record_transform.cpp @@ -1,4 +1,4 @@ -/* $Id: test_filter_record_transform.cpp,v 1.1 2006-10-03 14:04:22 marc Exp $ +/* $Id: test_filter_record_transform.cpp,v 1.2 2006-10-04 11:21:47 marc Exp $ Copyright (c) 2005-2006, Index Data. See the LICENSE file for details @@ -18,6 +18,9 @@ #define BOOST_AUTO_TEST_MAIN #include +#include + + using namespace boost::unit_test; namespace mp = metaproxy_1; @@ -58,56 +61,67 @@ BOOST_AUTO_UNIT_TEST( test_filter_record_transform_2 ) } -// BOOST_AUTO_UNIT_TEST( test_filter_record_transform_3 ) -// { +BOOST_AUTO_UNIT_TEST( test_filter_record_transform_3 ) +{ -// try -// { -// mp::RouterChain router; + try + { + mp::RouterChain router; -// std::string xmlconf = -// "\n" -// "\n" -// "\n" -// ; + std::string xmlconf = + "\n" + "\n" + "" + "" + "" + "" + "" + "\n" + ; -// //std::cout << xmlconf << std::endl; + //std::cout << xmlconf << std::endl; -// // reading and parsing XML conf -// xmlDocPtr doc = xmlParseMemory(xmlconf.c_str(), xmlconf.size()); -// BOOST_CHECK(doc); -// xmlNode *root_element = xmlDocGetRootElement(doc); + // reading and parsing XML conf + xmlDocPtr doc = xmlParseMemory(xmlconf.c_str(), xmlconf.size()); + BOOST_CHECK(doc); + xmlNode *root_element = xmlDocGetRootElement(doc); -// // creating and configuring filter -// mp::filter::RecordTransform f_rec_trans; -// f_rec_trans.configure(root_element); + // creating and configuring filter + mp::filter::RecordTransform f_rec_trans; + f_rec_trans.configure(root_element); -// // remeber to free XML DOM -// xmlFreeDoc(doc); + // remeber to free XML DOM + xmlFreeDoc(doc); -// // add only filter to router -// router.append(f_rec_trans); - -// // start testing -// check_sru_to_z3950_init(router); -// check_sru_to_z3950_search(router, -// "@attrset Bib-1 @attr 1=4 the", -// "@attrset Bib-1 @attr 1=4 the"); - -// } - -// catch (std::exception &e) { -// std::cout << e.what() << "\n"; -// BOOST_CHECK (false); -// } - -// catch ( ... ) { -// BOOST_CHECK (false); -// } -// } + // add only filter to router + router.append(f_rec_trans); + + // start testing + //check_sru_to_z3950_init(router); + //check_sru_to_z3950_search(router, + // "@attrset Bib-1 @attr 1=4 the", + // "@attrset Bib-1 @attr 1=4 the"); + + } + + catch (std::exception &e) { + std::cout << e.what() << "\n"; + BOOST_CHECK (false); + } + + catch ( ... ) { + BOOST_CHECK (false); + } +} /* * Local variables: diff --git a/xml/schema/MARC21slim.xsd b/xml/schema/MARC21slim.xsd new file mode 100644 index 0000000..06b4551 --- /dev/null +++ b/xml/schema/MARC21slim.xsd @@ -0,0 +1,137 @@ + + + + + MARCXML: The MARC 21 XML Schema + Prepared by Corey Keith + + August 4, 2003 - Version 1.1 - Removed import of xml namespace and the use of xml:space="preserve" attributes on the leader and controlfields. + Whitespace preservation in these subfields is accomplished by the use of xsd:whiteSpace value="preserve" + + May 21, 2002 - Version 1.0 - Initial Release + + This schema supports XML markup of MARC21 records as specified in the MARC documentation (see www.loc.gov). It allows tags with + alphabetics and subfield codes that are symbols, neither of which are as yet used in the MARC 21 communications formats, but are + allowed by MARC 21 for local data. The schema accommodates all types of MARC 21 records: bibliographic, holdings, bibliographic + with embedded holdings, authority, classification, and community information. + + + + + record is a top level container element for all of the field elements which compose the record + + + + + collection is a top level container element for 0 or many records + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MARC21 Leader, 24 bytes + + + + + + + + + + + + + + + + MARC21 Fields 001-009 + + + + + + + + + + + + + + + + + + + + + + MARC21 Variable Data Fields 010-999 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xml/xslt/MARC21slim2DC.xsl b/xml/xslt/MARC21slim2DC.xsl new file mode 100644 index 0000000..8c9572d --- /dev/null +++ b/xml/xslt/MARC21slim2DC.xsl @@ -0,0 +1,198 @@ + + + + + + + + + + + + + + + + + + + + + abfghk + + + + + + + + + + + + + + yes + + + + yes + + + + text + cartographic + notated music + sound recording + still image + moving image + three dimensional object + software, multimedia + mixed material + + + + + + + + + + + + + ab + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + abcdq + + + + + + + + abcdq + + + + + + + + abcdq + + + + + + + + abcdq + + + + + + + + abcdq + + + + + + + + abcdq + + + + + + + + abcd + + + + + + + + abcdu + + + + + + + + ot + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xml/xslt/MARC21slim2MADS.xsl b/xml/xslt/MARC21slim2MADS.xsl new file mode 100644 index 0000000..e89f586 --- /dev/null +++ b/xml/xslt/MARC21slim2MADS.xsl @@ -0,0 +1,1048 @@ + + + + + + + + + + + + + + + + naf + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + n + n + fghkdlmor + + + + + p + p + fghkdlmor + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + cdn + + + + + + + + + + + aq + + + + + + + + + + + + acdenq + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bc + + + + + + + + + + + + + + + + + + + + + + + yes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <xsl:variable name="str"> + <xsl:for-each select="marc:subfield"> + <xsl:if test="(contains('tfghklmors',@code) )"> + <xsl:value-of select="text()"/> + <xsl:text> </xsl:text> + </xsl:if> + </xsl:for-each> + </xsl:variable> + + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:value-of select="substring($str,1,string-length($str)-1)"/> + </xsl:with-param> + </xsl:call-template> + + + + + + + + + + + <xsl:variable name="str"> + <xsl:for-each select="marc:subfield"> + <xsl:if test="(contains('adfghklmors',@code) )"> + <xsl:value-of select="text()"/> + <xsl:text> </xsl:text> + </xsl:if> + </xsl:for-each> + </xsl:variable> + + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:value-of select="substring($str,1,string-length($str)-1)"/> + </xsl:with-param> + </xsl:call-template> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ab + + + + + + + + + + + + ab + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + nonpublic + + + source + + + notFound + + + history + + + subject example + + + deleted heading information + + + application history + + + + + + + + + + + ab + + + + + ai + + + + + + + + + + + + + + z3 + + + + + + + + + + + + earlier + + + later + + + parentOrg + + + broader + + + narrower + + + other + + + + other + + + + equivalent + + + + + + + + + + acronym + + + other + + + + + other + + + + + + + + + naf + + + lcsh + + + lacnaf + + + lcsh + + + cash + + + naf + + + lcsh + + + lacnaf + + + cash + + + lcshcl + + + nlmnaf + + + nalnaf + + + aat + + + sears + + + rvm + + + + + + naf + + + lcsh + + + lacnaf + + + lcsh + + + lcsh + + + mesh + + + nal + + + cash + + + naf + + + lcsh + + + lacnaf + + + cash + + + + lcsh + + + + naf + + + lacnaf + + + lcsh + + + cash + + + lcshcl + + + nlmnaf + + + nalnaf + + + rvm + + + + + + + + lacnaf + + + naf + + + lcsh + + + mesh + + + nal + + + cash + + + + + + + + + + \ No newline at end of file diff --git a/xml/xslt/MARC21slim2MODS.xsl b/xml/xslt/MARC21slim2MODS.xsl new file mode 100644 index 0000000..ff35524 --- /dev/null +++ b/xml/xslt/MARC21slim2MODS.xsl @@ -0,0 +1,1873 @@ + + + + + + + + + + + + + + + + + + + + + + + BK + SE + + + BK + MM + CF + MP + VM + MU + + + + + + + + + + abfghk + + + + + + + + + + + <xsl:value-of select="substring($title,@ind2+1)"/> + + + + + <xsl:value-of select="$title"/> + + + + + + + + + + + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">ab</xsl:with-param> + </xsl:call-template> + + + + + + + + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">abh</xsl:with-param> + </xsl:call-template> + + + + + + + + + + + + + + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">abfh</xsl:with-param> + </xsl:call-template> + + + + + + + + + <xsl:variable name="str"> + <xsl:for-each select="marc:subfield"> + <xsl:if test="(contains('adfhklmor',@code) and (not(../marc:subfield[@code='n' or @code='p']) or (following-sibling::marc:subfield[@code='n' or @code='p'])))"> + <xsl:value-of select="text()"/><xsl:text> </xsl:text> + </xsl:if> + </xsl:for-each> + </xsl:variable> + <xsl:value-of select="substring($str,1,string-length($str)-1)"/> + + + + + + + + + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">ah</xsl:with-param> + </xsl:call-template> + + + + + + + + + + creator + + + + + + + + + creator + + + + + + + + creator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + personal + + + + + + + + + + + yes + + + yes + + + + text + cartographic + notated music + sound recording + still image + moving image + three dimensional object + software, multimedia + mixed material + + + + + globe + + + + remote sensing image + + + + + + + map + + + atlas + + + + + + + + + database + + + loose-leaf + + + series + + + newspaper + + + periodical + + + web site + + + + + + + + + abstract or summary + + + bibliography + + + catalog + + + dictionary + + + encyclopedia + + + handbook + + + legal article + + + index + + + discography + + + legislation + + + theses + + + survey of literature + + + review + + + programmed text + + + filmography + + + directory + + + statistics + + + technical report + + + legal case and case notes + + + law report or digest + + + treaty + + + + + + conference publication + + + + + + + + + numeric data + + + database + + + font + + + game + + + + + + + patent + + + festschrift + + + + + biography + + + + + + essay + + + drama + + + comic strip + + + fiction + + + humor, satire + + + letter + + + novel + + + short story + + + speech + + + + + + + + biography + + + conference publication + + + drama + + + essay + + + fiction + + + folktale + + + history + + + humor, satire + + + memoir + + + poetry + + + rehersal + + + reporting + + + sound + + + speech + + + + + + + + art original + + + kit + + + art reproduction + + + diorama + + + filmstrip + + + legal article + + + picture + + + graphic + + + technical drawing + + + motion picture + + + chart + + + flash card + + + microscope slide + + + model + + + realia + + + slide + + + transparency + + + videorecording + + + toy + + + + + + + + + + + abvxyz + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + monographic + continuing + + + + + + + + ab + + + + + + + + + + + + rfc3066 + + + iso639-2b + + + + + + + + + + + + + + + + + reformatted digital + + + + + + + + + + + + + + + + + + + +
braille
+
+ +
electronic
+
+ +
microfiche
+
+ +
microfilm
+
+
+ + + + + + + + +
+ + + +
+
+ + + + + abce + + + +
+ + + + + + + + + + + + ab + + + + + + + + + agrt + + + + + + + + ab + + + + + + + + + adolescent + + + adult + + + general + + + juvenile + + + preschool + + + specialized + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + defg + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ab + + + + + + + + abx + + + + + + + + ab + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ab + + + + + + + + + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">av</xsl:with-param> + </xsl:call-template> + <xsl:call-template name="part"/> + + + + + + + + + + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">av</xsl:with-param> + </xsl:call-template> + <xsl:call-template name="part"/> + + + + + + + + + + + + + + + + + + + + + + + + + <xsl:call-template name="specialSubfieldSelect"> + <xsl:with-param name="anyCodes">tfklmorsv</xsl:with-param> + <xsl:with-param name="axis">t</xsl:with-param> + <xsl:with-param name="afterCodes">g</xsl:with-param> + </xsl:call-template> + + + + + + + abcq + t + g + + + + + + + + + + + + + + + + + + + + <xsl:call-template name="specialSubfieldSelect"> + <xsl:with-param name="anyCodes">tfklmorsv</xsl:with-param> + <xsl:with-param name="axis">t</xsl:with-param> + <xsl:with-param name="afterCodes">dg</xsl:with-param> + </xsl:call-template> + + + + + + + + + + + + + + + + + c + t + dgn + + + + + + + + + + + + + + + + + + + + + + + + <xsl:call-template name="specialSubfieldSelect"> + <xsl:with-param name="anyCodes">tfklsv</xsl:with-param> + <xsl:with-param name="axis">t</xsl:with-param> + <xsl:with-param name="afterCodes">g</xsl:with-param> + </xsl:call-template> + + + + + + + aqdc + t + gn + + + + + + + + + + + + + + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">adfgklmorsv</xsl:with-param> + </xsl:call-template> + + + + + + + + + + + + + + <xsl:value-of select="marc:subfield[@code='a']"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <xsl:call-template name="specialSubfieldSelect"> + <xsl:with-param name="anyCodes">tfklmorsv</xsl:with-param> + <xsl:with-param name="axis">t</xsl:with-param> + <xsl:with-param name="afterCodes">g</xsl:with-param> + </xsl:call-template> + + + + + + + + + abcq + t + g + + + + + + + + + + + + + + + + + + + + <xsl:call-template name="specialSubfieldSelect"> + <xsl:with-param name="anyCodes">tfklmorsv</xsl:with-param> + <xsl:with-param name="axis">t</xsl:with-param> + <xsl:with-param name="afterCodes">dg</xsl:with-param> + </xsl:call-template> + + + + + + + + + + + + + + + + + c + t + dgn + + + + + + + + + + + + + + + + + <xsl:call-template name="specialSubfieldSelect"> + <xsl:with-param name="anyCodes">tfklsv</xsl:with-param> + <xsl:with-param name="axis">t</xsl:with-param> + <xsl:with-param name="afterCodes">g</xsl:with-param> + </xsl:call-template> + + + + + + + aqdc + t + gn + + + + + + + + + + + + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">adfgklmorsv</xsl:with-param> + </xsl:call-template> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + issue number + matrix number + music plate + music publisher + videorecording identifier + + + + ab + + + + + + + + ab + + + + + + + + + doi + uri + + + + + + + + + + + + + + + + abj + + + + + + + + abcd35 + + + + + + + + abcde35 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + n + n + fghkdlmor + + + + + p + p + fghkdlmor + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + cdn + + + + + + + + + + + abcq + + + + + + + + + + + acdeq + + + + + + + + constituent + related + + + + + + + + + <xsl:value-of select="."/> + + + + + + + + + + <xsl:value-of select="."/> + + + + + + + + + + + + + + + + + + + + + + + + lcsh + lcshac + mesh + csh + nal + rvm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + abcq + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + cdnp + + + + + + + + + + + + + + + + abcdeqnp + + + + + + + + + + + + + + + + + + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">adfhklor</xsl:with-param> + </xsl:call-template> + <xsl:call-template name="part"/> + + + + + + + + + + + + + + abcd + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/xml/xslt/MARC21slim2MODS3-1.xsl b/xml/xslt/MARC21slim2MODS3-1.xsl new file mode 100644 index 0000000..225a5a0 --- /dev/null +++ b/xml/xslt/MARC21slim2MODS3-1.xsl @@ -0,0 +1,2514 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BK + SE + + + BK + MM + CF + MP + VM + MU + + + + + + + + + b + afgk + + + + + abfgk + + + + + + + + + + + + + + + + + + <xsl:value-of select="substring($titleChop,@ind2+1)"/> + + + + + <xsl:value-of select="$titleChop"/> + + + + + + + + + b + b + afgk + + + + + + + + + + + + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">a</xsl:with-param> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> + + + + + + + + + + + + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:call-template name="subfieldSelect"> + <!-- 1/04 removed $h, b --> + <xsl:with-param name="codes">a</xsl:with-param> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> + + + + + + + + + + + + + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:call-template name="subfieldSelect"> + <!-- 1/04 removed $h, $b --> + <xsl:with-param name="codes">af</xsl:with-param> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> + + + + + + + + + <xsl:variable name="str"> + <xsl:for-each select="marc:subfield"> + <xsl:if test="(contains('adfklmor',@code) and (not(../marc:subfield[@code='n' or @code='p']) or (following-sibling::marc:subfield[@code='n' or @code='p'])))"> + <xsl:value-of select="text()"/> + <xsl:text> </xsl:text> + </xsl:if> + </xsl:for-each> + </xsl:variable> + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:value-of select="substring($str,1,string-length($str)-1)"/> + </xsl:with-param> + </xsl:call-template> + + + + + + + + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">ah</xsl:with-param> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> + + + + + + + + + + creator + + + + + + + + + creator + + + + + + + + + creator + + + + + + + + + + + + + + + + + + + + + + + + + + + personal + + + + + + + + + + yes + + + yes + + + text + cartographic + notated music + sound recording-nonmusical + sound recording-musical + still image + moving image + three dimensional object + software, multimedia + mixed material + + + + globe + + + remote sensing image + + + + + + map + + + atlas + + + + + + + + database + + + loose-leaf + + + series + + + newspaper + + + periodical + + + web site + + + + + + + + abstract or summary + + + bibliography + + + catalog + + + dictionary + + + encyclopedia + + + handbook + + + legal article + + + index + + + discography + + + legislation + + + theses + + + survey of literature + + + review + + + programmed text + + + filmography + + + directory + + + statistics + + + technical report + + + legal case and case notes + + + law report or digest + + + treaty + + + + + + conference publication + + + + + + + + numeric data + + + database + + + font + + + game + + + + + + patent + + + festschrift + + + + biography + + + + + essay + + + drama + + + comic strip + + + fiction + + + humor, satire + + + letter + + + novel + + + short story + + + speech + + + + + + + biography + + + conference publication + + + drama + + + essay + + + fiction + + + folktale + + + history + + + humor, satire + + + memoir + + + poetry + + + rehearsal + + + reporting + + + sound + + + speech + + + + + + + art original + + + kit + + + art reproduction + + + diorama + + + filmstrip + + + legal article + + + picture + + + graphic + + + technical drawing + + + motion picture + + + chart + + + flash card + + + microscope slide + + + model + + + realia + + + slide + + + transparency + + + videorecording + + + toy + + + + + + + + abvxyz + - + + + + + + + + + code + marccountry + + + + + + + + code + iso3166 + + + + + + + + text + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + :,;/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + monographic + continuing + + + + + + + ab + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + reformatted digital + + + + + + + + + + + + + + + +
braille
+
+ +
print
+
+ +
electronic
+
+ +
microfiche
+
+ +
microfilm
+
+
+ + +
+ + + + + +
+
+ +
+ + + + + +
+
+ +
+ + + + + +
+
+ +
+ + + + + +
+
+ +
+ + + + + +
+
+ +
+ + + + + +
+
+ +
+ + +
+ + + + access + + + preservation + + + replacement + + + + + + + + + + + + abce + + + +
+ + + + + + + + + + ab + + + + + + + + agrt + + + + + + + ab + + + + + + + + + adolescent + + + adult + + + general + + + juvenile + + + preschool + + + specialized + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + defg + + + + + + + + + + marcgaciso3166 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ab + + + + + + + abx + + + + + + + ab + + + + + + + + + + + + + + + + + + + + + + + + ab + + + + + + + + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">av</xsl:with-param> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> + + + + + + + + + + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">av</xsl:with-param> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> + + + + + + + + + + abcx3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:call-template name="specialSubfieldSelect"> + <xsl:with-param name="anyCodes">tfklmorsv</xsl:with-param> + <xsl:with-param name="axis">t</xsl:with-param> + <xsl:with-param name="afterCodes">g</xsl:with-param> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> + + + + + + + aq + t + g + + + + + + + + + + + + + + + + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:call-template name="specialSubfieldSelect"> + <xsl:with-param name="anyCodes">tfklmorsv</xsl:with-param> + <xsl:with-param name="axis">t</xsl:with-param> + <xsl:with-param name="afterCodes">dg</xsl:with-param> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> + + + + + + + + + + + + + + + + + c + t + dgn + + + + + + + + + + + + + + + + + + + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:call-template name="specialSubfieldSelect"> + <xsl:with-param name="anyCodes">tfklsv</xsl:with-param> + <xsl:with-param name="axis">t</xsl:with-param> + <xsl:with-param name="afterCodes">g</xsl:with-param> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> + + + + + + + aqdc + t + gn + + + + + + + + + + + + + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">adfgklmorsv</xsl:with-param> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> + + + + + + + + + + + + + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:value-of select="marc:subfield[@code='a']"/> + </xsl:with-param> + </xsl:call-template> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:call-template name="specialSubfieldSelect"> + <xsl:with-param name="anyCodes">tfklmorsv</xsl:with-param> + <xsl:with-param name="axis">t</xsl:with-param> + <xsl:with-param name="afterCodes">g</xsl:with-param> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> + + + + + + + + + aq + t + g + + + + + + + + + + + + + + + + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:call-template name="specialSubfieldSelect"> + <xsl:with-param name="anyCodes">tfklmorsv</xsl:with-param> + <xsl:with-param name="axis">t</xsl:with-param> + <xsl:with-param name="afterCodes">dg</xsl:with-param> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> + + + + + + + + + + + + + + + + + c + t + dgn + + + + + + + + + + + + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:call-template name="specialSubfieldSelect"> + <xsl:with-param name="anyCodes">tfklsv</xsl:with-param> + <xsl:with-param name="axis">t</xsl:with-param> + <xsl:with-param name="afterCodes">g</xsl:with-param> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> + + + + + + + aqdc + t + gn + + + + + + + + + + + + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">adfgklmorsv</xsl:with-param> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + issue numbermatrix numbermusic platemusic publishervideorecording identifier + + + + ba + ab + + + + + + + + + + ab + + + + + + + + ab + + + + + + doihdluri + + + + + + + + + + + + + y3z + + + + + + + + + + + + + + + + + y3 + + + + + + + + + + + abje + + + + + + + + abcd35 + + + + + + + abcde35 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + n + n + fgkdlmor + + + + + p + p + fgkdlmor + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + g + g + pst + + + + + p + p + fgkdlmor + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + cdn + + + + + + + + + + aq + + + + :,;/ + + + + + + + + + + acdeq + + + + + + constituent + + + + + + + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:value-of select="."/> + </xsl:with-param> + </xsl:call-template> + + + + + + + + + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:value-of select="."/> + </xsl:with-param> + </xsl:call-template> + + + + + + + + + + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:value-of select="."/> + </xsl:with-param> + </xsl:call-template> + + + + + + + + + + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:value-of select="."/> + </xsl:with-param> + </xsl:call-template> + + + + + + + + + + + + + + + code + marcgac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + lcshlcshacmeshnalcshrvm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + aq + + + + + + + + + + + + + + + + + + + + + + + + + + + + + cdnp + + + + + + + + + + + + + + + abcdeqnp + + + + + + + + + + + + + + + + + + + <xsl:call-template name="chopPunctuation"> + <xsl:with-param name="chopString"> + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">adfhklor</xsl:with-param> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> + <xsl:call-template name="part"/> + + + + + + + + + + + + + abcd + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bc + + + + + + + + + + + + + + + + + yes + + + + + + + + + + + + + + + + + ArabicLatinChinese, Japanese, KoreanCyrillicHebrewGreek + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + summary or subtitlesung or spoken textlibrettotable of contentsaccompanying materialtranslation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + summary or subtitlesung or spoken textlibrettotable of contentsaccompanying materialtranslation + + + + + + + + + + + +
+ + \ No newline at end of file diff --git a/xml/xslt/MARC21slim2RDFDC.xsl b/xml/xslt/MARC21slim2RDFDC.xsl new file mode 100644 index 0000000..2e81677 --- /dev/null +++ b/xml/xslt/MARC21slim2RDFDC.xsl @@ -0,0 +1,197 @@ + + + + + + + + + + + + + + + + + + + + abfghk + + + + + + + + + + + + + + yes + + + + yes + + + + text + cartographic + notated music + sound recording + still image + moving image + three dimensional object + software, multimedia + mixed material + + + + + + + + + + + + + ab + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + abcdq + + + + + + + + abcdq + + + + + + + + abcdq + + + + + + + + abcdq + + + + + + + + abcdq + + + + + + + + abcdq + + + + + + + + abcd + + + + + + + + abcdu + + + + + + + + ot + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/xml/xslt/MARC21slim2SRWDC.xsl b/xml/xslt/MARC21slim2SRWDC.xsl new file mode 100644 index 0000000..5ae8ec6 --- /dev/null +++ b/xml/xslt/MARC21slim2SRWDC.xsl @@ -0,0 +1,261 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <xsl:call-template name="subfieldSelect"> + <xsl:with-param name="codes">abfghk</xsl:with-param> + </xsl:call-template> + + + + + + + + + + + + collection + + + + + manuscript + + + text + cartographic + notated music + sound recording + still image + moving image + three dimensional object + software, multimedia + mixed material + + + + + + + + + + + ab + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + abcdefghjklmnopqrstu4 + + + -- + + vxyz + -- + + + + + + + + abcdefghklmnoprstu4 + + + -- + + vxyz + -- + + + + + + + + acdefghklnpqstu4 + + + -- + + vxyz + -- + + + + + + + + adfghklmnoprst + + + -- + + vxyz + -- + + + + + + + + ae + + -- + + vxyz + -- + + + + + + + + a + + + + + + + a + + + -- + + vxyz + -- + + + + + + + + abcd + + + + + + + + + abcdu + + + + + + + ot + + + + + + + + + + + URN:ISBN: + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/xml/xslt/MARC21slimUtils.xsl b/xml/xslt/MARC21slimUtils.xsl new file mode 100644 index 0000000..acfe598 --- /dev/null +++ b/xml/xslt/MARC21slimUtils.xsl @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- 1.7.10.4