+ for (ptr = ptr->children; ptr; ptr = ptr->next)
+ {
+ if (ptr->type != XML_ELEMENT_NODE)
+ continue;
+ if (!strcmp((const char *) ptr->name, "setVariable"))
+ {
+ std::string name;
+ std::string value;
+ struct _xmlAttr *attr;
+ for (attr = ptr->properties; attr; attr = attr->next)
+ if (!strcmp((const char *) attr->name, "name"))
+ name = mp::xml::get_text(attr->children);
+ else if (!strcmp((const char *) attr->name, "value"))
+ value = mp::xml::get_text(attr->children);
+ else
+ throw mp::filter::FilterException(
+ "Bad attribute " + std::string((const char *)
+ attr->name));
+ if (name.length() > 0)
+ zorba_variables[name] = value;
+ }
+ else if (!strcmp((const char *) ptr->name, "filename"))
+ {
+ std::string value;
+ struct _xmlAttr *attr;
+ for (attr = ptr->properties; attr; attr = attr->next)
+ if (!strcmp((const char *) attr->name, "value"))
+ value = mp::xml::get_text(attr->children);
+ else
+ throw mp::filter::FilterException(
+ "Bad attribute " + std::string((const char *)
+ attr->name));
+ zorba_filename = value;
+ }
+ else if (!strcmp((const char *) ptr->name, "script"))
+ {
+ std::string value;
+ struct _xmlAttr *attr;
+ for (attr = ptr->properties; attr; attr = attr->next)
+ if (!strcmp((const char *) attr->name, "value"))
+ value = mp::xml::get_text(attr->children);
+ else
+ throw mp::filter::FilterException(
+ "Bad attribute " + std::string((const char *)
+ attr->name));
+ zorba_script = value;
+ }
+ else if (!strcmp((const char *) ptr->name, "record"))
+ {
+ std::string value;
+ struct _xmlAttr *attr;
+ for (attr = ptr->properties; attr; attr = attr->next)
+ if (!strcmp((const char *) attr->name, "value"))
+ value = mp::xml::get_text(attr->children);
+ else
+ throw mp::filter::FilterException(
+ "Bad attribute " + std::string((const char *)
+ attr->name));
+ zorba_record_variable = value;
+ }
+ else
+ {
+ throw mp::filter::FilterException("Bad element "
+ + std::string((const char *)
+ ptr->name));
+ }
+ }
+ if (zorba_script.length() == 0)
+ throw mp::filter::FilterException("Missing element script");
+ if (zorba_record_variable.length() == 0)
+ throw mp::filter::FilterException("Missing element record");
+ if (zorba_filename.length() == 0)
+ throw mp::filter::FilterException("Missing element filename");