Re: [xslt] python saveResultToFile
- From: Daniel Veillard <veillard redhat com>
- To: xslt gnome org
- Subject: Re: [xslt] python saveResultToFile
- Date: Sun, 31 Mar 2002 12:08:05 -0500
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
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 Veillard | Red Hat Network https://rhn.redhat.com/
email@example.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
] [Thread Prev