[xiph-cvs] cvs commit: icecast/src xslt.c xslt.h

Michael Smith msmith at xiph.org
Fri Aug 9 01:16:52 PDT 2002



msmith      02/08/09 04:16:51

  Added:       src      xslt.c xslt.h
  Log:
  Add new xslt files, which I forgot earlier

Revision  Changes    Path
1.1                  icecast/src/xslt.c

Index: xslt.c
===================================================================
#include <string.h>
#include <libxml/xmlmemory.h>
#include <libxml/debugXML.h>
#include <libxml/HTMLtree.h>
#include <libxml/xmlIO.h>
#include <libxml/DOCBparser.h>
#include <libxml/xinclude.h>
#include <libxml/catalog.h>
#include <libxslt/xslt.h>
#include <libxslt/xsltInternals.h>
#include <libxslt/transform.h>
#include <libxslt/xsltutils.h>

<p>#include <thread/thread.h>
#include <avl/avl.h>
#include <httpp/httpp.h>
#include <net/sock.h>

<p>#include "connection.h"

#include "global.h"
#include "refbuf.h"
#include "client.h"
#include "stats.h"

<p>void transformXSLT(xmlDocPtr doc, char *xslfilename, client_t *client)
{
    xmlOutputBufferPtr outputBuffer;
        xmlDocPtr	res;
        xsltStylesheetPtr cur;
        const char *params[16 + 1];
    size_t count,nBytes;

        params[0] = NULL;

        xmlSubstituteEntitiesDefault(1);
        xmlLoadExtDtdDefaultValue = 1;

        cur = xsltParseStylesheetFile(xslfilename);
        if (cur == NULL) {
                sock_write_string(client->con->sock, (char *)"Could not parse XSLT file");
        return;
        }

    res = xsltApplyStylesheet(cur, doc, params);

    outputBuffer = xmlAllocOutputBuffer(NULL);

    count = xsltSaveResultTo(outputBuffer, res, cur);

    /*  Add null byte to end. */
    nBytes = xmlOutputBufferWrite(outputBuffer, 1, "");

        sock_write_string(client->con->sock, (char *)outputBuffer->buffer->content);

    xmlFree(outputBuffer);
    xsltFreeStylesheet(cur);
    xmlFreeDoc(res);

    xsltCleanupGlobals(); /* Neccesary? */
}

<p><p><p>1.1                  icecast/src/xslt.h

Index: xslt.h
===================================================================
#include <libxml/xmlmemory.h>
#include <libxml/debugXML.h>
#include <libxml/HTMLtree.h>
#include <libxml/xmlIO.h>
#include <libxslt/xslt.h>
#include <libxslt/xsltInternals.h>
#include <libxslt/transform.h>
#include <libxslt/xsltutils.h>

<p>#include <thread/thread.h>
#include <avl/avl.h>
#include <httpp/httpp.h>
#include <net/sock.h>

<p>#include "connection.h"

#include "global.h"
#include "refbuf.h"
#include "client.h"
#include "stats.h"

<p>void transformXSLT(xmlDocPtr doc, char *xslfilename, client_t *client);

<p><p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list