+
+ char fullpath[1024];
+ char *cp = yaz_filepath_resolve(fname.c_str(), path, 0, fullpath);
+ if (!cp)
+ {
+ throw mp::filter::FilterException("Cannot read XSLT " + fname);
+ }
+
+ m_stylesheet = xsltParseStylesheetFile(BAD_CAST cp);
+ if (!m_stylesheet)
+ {
+ throw mp::filter::FilterException
+ ("Failed to read XSLT stylesheet '"
+ + fname
+ + "' in query_rewrite filter");
+ }
+ }
+ else if (mp::xml::is_element_mp(ptr, "charset"))
+ {
+ for (struct _xmlAttr *attr = ptr->properties;
+ attr; attr = attr->next)
+ {
+ if (!strcmp((const char *) attr->name, "from"))
+ {
+ charset_from = mp::xml::get_text(attr);
+ }
+ else if (!strcmp((const char *) attr->name, "to"))
+ {
+ charset_to = mp::xml::get_text(attr);
+ }
+ else
+ throw mp::filter::FilterException
+ ("Invalid attribute inside charset inside "
+ "query_rewrite filter");