RE: [xml] LIBXML2/LIBXSLT/XSLTPROC on VMS



The problem was with xmlFileWrite in xmlIO.c.

When it calls fwrite it sets p2 to 1 and p3 to len.  

On VMS fwrite p2 is size_of_item and p3 is number_of_items.  So it writes
number_of_items records of size_of_item bytes, which is 'len' records of 1
byte.  The problem I am getting.

Changing xmlFileWrite to call fwrite with p2 of len and p3 of 1 produces
just one record containing all the bytes in the buffer.  

The return value from fwrite is the number of items written (not bytes).
This is used by xmlShrinkBuffer in Tree.c, which causes duplication of data.
To correct this in xmlFileWrite I returned len instead of the response from
fwrite.

So in xmlFileWrite:
    return(fwrite(&buffer[0], 1, len, (FILE *) context));

Becomes:
int items;
    items = fwrite(&buffer[0], len, 1, (FILE *) context);
    return(len);



Regards

Nigel


-----Original Message-----
From: Daniel Veillard [mailto:veillard redhat com]
Sent: 13 December 2002 17:55
To: Nigel Hall
Cc: xml gnome org
Subject: Re: [xml] LIBXML2/LIBXSLT/XSLTPROC on VMS


On Fri, Dec 13, 2002 at 05:31:54PM -0000, Nigel Hall wrote:
y p e " c o n t e n t = " t e x t / h t m l ; c h a r s e t = I S O - 8 8
5
9 - 1 " > 

In an editor it is one character per line, like this:

<
H
[...]
Any ideas ?

 Not really if it was just with ISO-8859-1 I would have suspected the
UTF-8 to ISO-8859-1 conversion routine, but if all encoding exhibit
the same problem, I have no idea ... time to take a debugger and see
what's happening within the code.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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