Re: [xslt] python saveResultToFile



On Sun, Mar 31, 2002 at 06:24:30AM -0500, Sam Brauer wrote:
> out = cStringIO.StringIO()
> style.saveResultToFile(out, result)

  This won't work because there is no FILE * in out, the output actually
goes to stdout when doing this.

> I also tried saving to a "normal" file (out = open("foo", "w")), and the 
> same thing happens.  In other words, saveResultToFile() doesn't raise an 
> exception, but the file is empty.

  Now that's strange, looking quickly at the generated stubs it looks
fine:

     libxslt_xsltSaveResultToFile()...

     FILE * file;
     file = (FILE *) PyFile_Get(pyobj_file);
     ....

     c_retval = xsltSaveResultToFile(file, result, style);
     ....

  This ought to work, really.

> Am I doing something wrong, or is this a bug?

  Hum, in the first case, well I don;t have yet support for the case
where the native Python object is not FILE * based. In the second case
it sounds like a bug, but I'm surprized.

> By the way, I'm using Python 2.1.2, libxml2-2.4.19 and libxslt 1.0.15.

  Okay, there shouldn't be any problem there.

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]