786 std::string explain_xslt_fname;
787 std::string record_xslt_fname;
793 for (ptr = ptr->children; ptr; ptr = ptr->next)
795 if (ptr->type != XML_ELEMENT_NODE)
797 else if (!strcmp((
const char *) ptr->name,
"torus"))
799 const struct _xmlAttr *attr;
800 for (attr = ptr->properties; attr; attr = attr->next)
802 if (!strcmp((
const char *) attr->name,
"url"))
804 else if (!strcmp((
const char *) attr->name,
"content_url"))
806 else if (!strcmp((
const char *) attr->name,
"auth_url"))
808 else if (!strcmp((
const char *) attr->name,
"allow_ip"))
810 else if (!strcmp((
const char *) attr->name,
"realm"))
812 else if (!strcmp((
const char *) attr->name,
"auth_hostname"))
814 else if (!strcmp((
const char *) attr->name,
"xsldir"))
815 xsldir = mp::xml::get_text(attr->children);
816 else if (!strcmp((
const char *) attr->name,
"element_transform"))
818 else if (!strcmp((
const char *) attr->name,
"element_raw"))
820 else if (!strcmp((
const char *) attr->name,
"element_marcxml"))
822 else if (!strcmp((
const char *) attr->name,
"element_passthru"))
824 else if (!strcmp((
const char *) attr->name,
"proxy"))
825 proxy = mp::xml::get_text(attr->children);
826 else if (!strcmp((
const char *) attr->name,
"explain_xsl"))
827 explain_xslt_fname = mp::xml::get_text(attr->children);
828 else if (!strcmp((
const char *) attr->name,
"record_xsl"))
829 record_xslt_fname = mp::xml::get_text(attr->children);
831 throw mp::filter::FilterException(
832 "Bad attribute " + std::string((
const char *)
841 else if (!strcmp((
const char *) ptr->name,
"cclmap"))
843 const char *addinfo = 0;
844 ccl_xml_config(
bibset, ptr, &addinfo);
846 else if (!strcmp((
const char *) ptr->name,
"fieldmap"))
848 const struct _xmlAttr *attr;
849 std::string ccl_field;
850 std::string cql_field;
851 for (attr = ptr->properties; attr; attr = attr->next)
853 if (!strcmp((
const char *) attr->name,
"ccl"))
854 ccl_field = mp::xml::get_text(attr->children);
855 else if (!strcmp((
const char *) attr->name,
"cql"))
856 cql_field = mp::xml::get_text(attr->children);
858 throw mp::filter::FilterException(
859 "Bad attribute " + std::string((
const char *)
862 if (cql_field.length())
865 else if (!strcmp((
const char *) ptr->name,
"contentProxy"))
867 const struct _xmlAttr *attr;
868 for (attr = ptr->properties; attr; attr = attr->next)
870 if (!strcmp((
const char *) attr->name,
"server"))
873 "contentProxy's server attribute is deprecated");
875 "Specify config_file instead. For example:");
877 " content_file=\"/etc/cf-proxy/cproxy.cfg\"");
880 else if (!strcmp((
const char *) attr->name,
"tmp_file"))
882 else if (!strcmp((
const char *) attr->name,
"config_file"))
885 throw mp::filter::FilterException(
886 "Bad attribute " + std::string((
const char *)
890 else if (!strcmp((
const char *) ptr->name,
"log"))
892 const struct _xmlAttr *attr;
893 for (attr = ptr->properties; attr; attr = attr->next)
895 if (!strcmp((
const char *) attr->name,
"apdu"))
896 apdu_log = mp::xml::get_bool(attr->children,
false);
898 throw mp::filter::FilterException(
899 "Bad attribute " + std::string((
const char *)
903 else if (!strcmp((
const char *) ptr->name,
"zoom"))
905 const struct _xmlAttr *attr;
906 for (attr = ptr->properties; attr; attr = attr->next)
908 if (!strcmp((
const char *) attr->name,
"timeout"))
910 else if (!strcmp((
const char *) attr->name,
"proxy_timeout"))
913 throw mp::filter::FilterException(
914 "Bad attribute " + std::string((
const char *)
920 throw mp::filter::FilterException
922 + std::string((
const char *) ptr->name)
923 +
" in zoom filter");
927 if (explain_xslt_fname.length())
929 const char *path = 0;
937 char *cp = yaz_filepath_resolve(explain_xslt_fname.c_str(),
941 throw mp::filter::FilterException
942 (
"Cannot read XSLT " + explain_xslt_fname);
945 xmlDoc *xsp_doc = xmlParseFile(cp);
948 throw mp::filter::FilterException
949 (
"Cannot parse XSLT " + explain_xslt_fname);
956 throw mp::filter::FilterException
957 (
"Cannot parse XSLT " + explain_xslt_fname);
962 if (record_xslt_fname.length())
964 const char *path = 0;
972 char *cp = yaz_filepath_resolve(record_xslt_fname.c_str(),
976 throw mp::filter::FilterException
977 (
"Cannot read XSLT " + record_xslt_fname);
980 xmlDoc *xsp_doc = xmlParseFile(cp);
983 throw mp::filter::FilterException
984 (
"Cannot parse XSLT " + record_xslt_fname);
991 throw mp::filter::FilterException
992 (
"Cannot parse XSLT " + record_xslt_fname);