Documentation for now based on Docbook XML/XSLT using xsltproc + Norman
[idzebra-moved-to-github.git] / recctrl / xslt.c
index bdea2e7..5a9867c 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: xslt.c,v 1.23 2006-05-24 08:23:01 marc Exp $
+/* $Id: xslt.c,v 1.25 2006-05-24 18:31:33 adam Exp $
    Copyright (C) 1995-2005
    Index Data ApS
 
@@ -275,15 +275,15 @@ static struct filter_xslt_schema *lookup_schema(struct filter_xslt_info *tinfo,
     {
         /* 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;
     }
 
@@ -692,7 +692,9 @@ static int filter_retrieve (void *clientData, struct recRetrieveCtrl *p)
     {
        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;
@@ -705,7 +707,9 @@ static int filter_retrieve (void *clientData, struct recRetrieveCtrl *p)
     {
        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;