[xslt] Win32 Crash when reading/writing transformed XML

Sorry, I am a novice.

I am struggling with a strange behaviour.

I downloaded:
- libxml2-2.6.2.tar.gz
- libxslt-1.1.0.tar.gz

Compiled the 2 libraries with Microsoft C++ as said in the Readme.txt of the
(I did not included "iconv" support)

The libxml library seems to work well... I can parse an xml file and list
all xml tags.

The problem arise when I want to make some xslt transforms.

I created a blank console app with MSVC++ 6.0 and pasted the code from the
tutorial by John Fleck.
Everything compile well, the binaries are created successfully.
When I run it with an xslt file and an xml file (which are correct, because
I tried them also in the Microsoft XSTL Parser), I get a memory exception in
the function:

xsltSaveResultToFile(FILE *file, xmlDocPtr result, xsltStylesheetPtr style)

The args are right, no one is NULL.
The output stream is stdout, but it crashes also with an opened file.

I tried to compile the xsltproc software as a stand alone win32 console app
and I have the same behaviour.

Instead if I start "xsltproc.exe" compiled by the makefile it runs well and
creates correct output!

I didn't change any line of the tutorial. Just cutted & pasted in a blank
project, configured the libs,includes directories, copied the correct dll in
the binary path and run.

The error is here:

FILE: [xmlIO.c] of libxml
static int
xmlFileWrite (void * context, const char * buffer, int len) {
    int items;

    items = fwrite(&buffer[0], len, 1, (FILE *) context);
    if ((items == 0) && (ferror((FILE *) context))) {
        xmlIOErr(0, "fwrite()");
    return(items * len);

In buffer I have the correct html rendered file.
len is 1776.
context is not null.

Please help me!

If you want more details please ask!

Thank you.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]