<cclmap_ti>1=title s=pw t=l,r</cclmap_ti>
<sru>get</sru>
<transform>dc.xsl</transform>
+ <literalTransform><?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ This stylesheet expects oai/dc records
+-->
+<xsl:stylesheet
+ version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:dcterms="http://purl.org/dc/terms/">
+
+ <xsl:output indent="yes"
+ method="xml"
+ version="1.0"
+ encoding="UTF-8"/>
+
+ <xsl:param name="medium" />
+
+ <xsl:template match="/*">
+ <pz:record>
+
+ <pz:metadata type="id">
+ <xsl:value-of select="dc:identifier"/>
+ </pz:metadata>
+
+ <xsl:for-each select="dc:title">
+ <pz:metadata type="title">
+ <xsl:value-of select="."/>
+ </pz:metadata>
+ </xsl:for-each>
+
+ <xsl:for-each select="dc:date">
+ <pz:metadata type="date">
+ <xsl:value-of select="."/>
+ </pz:metadata>
+ </xsl:for-each>
+
+ <xsl:for-each select="dc:subject">
+ <pz:metadata type="subject">
+ <xsl:value-of select="."/>
+ </pz:metadata>
+ </xsl:for-each>
+
+ <xsl:for-each select="dc:creator">
+ <pz:metadata type="author">
+ <xsl:value-of select="."/>
+ </pz:metadata>
+ </xsl:for-each>
+
+ <xsl:for-each select="dc:description">
+ <pz:metadata type="description">
+ <xsl:value-of select="."/>
+ </pz:metadata>
+ </xsl:for-each>
+
+ <xsl:for-each select="dc:identifier">
+ <pz:metadata type="electronic-url">
+ <xsl:value-of select="."/>
+ </pz:metadata>
+ </xsl:for-each>
+
+ <xsl:for-each select="dc:type">
+ <pz:metadata type="medium">
+ <xsl:value-of select="."/>
+ </pz:metadata>
+ </xsl:for-each>
+
+ <xsl:for-each select="dcterms:bibliographicCitation">
+ <pz:metadata type="citation">
+ <xsl:value-of select="."/>
+ </pz:metadata>
+ </xsl:for-each>
+
+ <pz:metadata type="medium">
+ <xsl:value-of select="$medium" />
+ </pz:metadata>
+
+ </pz:record>
+ </xsl:template>
+
+ <xsl:template match="text()"/>
+
+</xsl:stylesheet></literalTransform>
<zurl>dfr.jstor.org/sru</zurl>
</record>
std::string element_set;
std::string record_encoding;
std::string transform_xsl_fname;
+ std::string transform_xsl_content;
std::string urlRecipe;
std::string contentConnector;
bool use_turbomarc;
s->transform_xsl_fname = mp::xml::get_text(ptr);
}
else if (!strcmp((const char *) ptr->name,
+ "literalTransform"))
+ {
+ s->transform_xsl_content = mp::xml::get_text(ptr);
+ }
+ else if (!strcmp((const char *) ptr->name,
"urlRecipe"))
{
s->urlRecipe = mp::xml::get_text(ptr);
}
xsltStylesheetPtr xsp = 0;
- if (sptr->transform_xsl_fname.length())
+ if (sptr->transform_xsl_content.length())
+ {
+ xmlDoc *xsp_doc = xmlParseMemory(sptr->transform_xsl_content.c_str(),
+ sptr->transform_xsl_content.length());
+ if (!xsp_doc)
+ {
+ *error = YAZ_BIB1_TEMPORARY_SYSTEM_ERROR;
+ *addinfo = (char *) odr_malloc(odr, 40);
+ sprintf(*addinfo, "xmlParseMemory failed");
+ BackendPtr b;
+ return b;
+ }
+ xsp = xsltParseStylesheetDoc(xsp_doc);
+ if (!xsp)
+ {
+ *error = YAZ_BIB1_DATABASE_DOES_NOT_EXIST;
+ *addinfo = odr_strdup(odr, "xsltParseStylesheetDoc failed");
+ BackendPtr b;
+ xmlFreeDoc(xsp_doc);
+ return b;
+ }
+ }
+ else if (sptr->transform_xsl_fname.length())
{
const char *path = 0;
element mp:requestSyntax { xsd:string }?,
element mp:sru { xsd:string }?,
element mp:transform { xsd:string }?,
+ element mp:literalTransform { xsd:string }?,
element mp:urlRecipe { xsd:string }?,
element mp:zurl { xsd:string },
element mp:cfAuth { xsd:string }?,