-/* $Id: xslt.c,v 1.23 2006-05-24 08:23:01 marc Exp $
+/* $Id: xslt.c,v 1.27 2006-05-31 16:11:58 marc Exp $
Copyright (C) 1995-2005
Index Data ApS
#include <libxml/xmlIO.h>
#include <libxml/xmlreader.h>
#include <libxslt/transform.h>
+/* #include <libxslt/xsltutils.h> */
#include <idzebra/util.h>
#include <idzebra/recctrl.h>
attr_content(attr, "default", &schema->default_schema);
attr_content(attr, "snippet", &schema->include_snippet);
}
+
if (schema->stylesheet){
yaz_filepath_resolve(schema->stylesheet, tinfo->profile_path,
NULL, tmp_xslt_full_name);
{
/* find requested schema */
if (est)
- {
+ {
if (schema->identifier && !strcmp(schema->identifier, est))
- return schema;
+ return schema;
+
if (schema->name && !strcmp(schema->name, est))
return schema;
- }
-
+ }
/* or return default schema if defined */
- if (schema->default_schema)
+ else if (schema->default_schema)
return schema;
}
{
xmlChar *buf_out;
int len_out;
- xmlDocDumpMemory(resDoc, &buf_out, &len_out);
+
+ xsltSaveResultToString(&buf_out, &len_out, resDoc,
+ schema->stylesheet_xsp);
p->output_format = VAL_TEXT_XML;
p->rec_len = len_out;
{
xmlChar *buf_out;
int len_out;
- xmlDocDumpMemory(resDoc, &buf_out, &len_out);
+
+ xsltSaveResultToString(&buf_out, &len_out, resDoc,
+ schema->stylesheet_xsp);
p->output_format = VAL_SUTRS;
p->rec_len = len_out;