Igor Zlatkovic | 24 Mar 23:56
Picon

New build process for Windows

Hello everyone,

the recent discussion about the command-line based build process for Windows
has been positive, if I am capable of any judgement. Thanks for the support.

I have commited the files required for this to both libxml and libxslt. The
files commited to libxml are:

  win32/configure.js      - Configuration script.
  win32/Makefile.msvc     - Makefile for MSVC/nmake.
  win32/libxml2.def.src   - Export definition source.

The files commited to libxslt are:

  win32/configure.js      - Configuration script.
  win32/Makefile.msvc     - Makefile for MSVC/nmake.
  win32/libxslt.def.src   - Export definition source (xslt).
  win32/libexslt.def.src  - Export definition source (exslt).

Of course, both have a readme file attached which explains the build
process.

Although libxslt and libexslt do not have conditional export table like
libxml, I have still supplied export definition sources, which are being
preprocessed to the actual export definition. This I have done for the need
of such conditional export table becoming necessary in the future.

Oh, and there is a present for Mark in there, the 'sodir' option to the
configure script :-).

(Continue reading)

Daniel Veillard | 25 Mar 20:41
Picon
Favicon
Gravatar

Release of libxslt-1.0.15

 Another release is available:
    ftp://xmlsoft.org/XSLT/
    http://xmlsoft.org/

This is a bugfix and performance improvement release:
  - fixes: XPath, python Makefile, recursive attribute sets, @foo[..] templates
  - Debug of memory allocation with valgind
  - serious profiling leading to significant improvement for DocBook processing
  - revamp of the Windows build

I would be interested in performance reports against MSXML4 if someone have
time to do some. Someone in the DocBook-Apps list explained that 1.0.10 
was 50% slower than MSXML for DocBook processing. I'm confident that the
improvement made since [*] should allow at least a tie, but well I can't
tell :-). Also since Igor now has direct CVS commit access Windows and
normal release should be more in sync in the future.

Daniel

[*] upgrade libxml2 too, a large chunk of the speedup comes from it.

--

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard <at> redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
Sam Brauer | 31 Mar 13:24
Favicon

python saveResultToFile

Hello!  
I'm able to use saveResultToFilename() just fine, but would like to be 
able to use saveResultToFile() so that I can save the result to a 
cStringIO (or plain old StringIO) object then get the value as a string to 
be further manipulated.
However, when I call saveResultToFile() no output seems to be written to 
the file object, and the method returns as if everything went ok.

The following is an example of what I'm trying to do:
-----------------------------------------------
import libxml2
import libxslt
import cStringIO

styledoc = libxml2.parseFile("test.xsl")
style = libxslt.parseStylesheetDoc(styledoc)
doc = libxml2.parseFile("test.xml")
result = style.applyStylesheet(doc, None)
out = cStringIO.StringIO()
style.saveResultToFile(out, result)
result.freeDoc()
style.freeStylesheet()
doc.freeDoc()
out.flush()
s = out.getvalue()
out.close()
print s  
-----------------------------------------------

I also tried saving to a "normal" file (out = open("foo", "w")), and the 
(Continue reading)

Daniel Veillard | 31 Mar 19:08
Picon
Favicon
Gravatar

Re: 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.
(Continue reading)

Daniel Veillard | 31 Mar 19:26
Picon
Favicon
Gravatar

Re: python saveResultToFile

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

  This gives the following at the wrapper level:

Breakpoint 3, libxslt_xsltSaveResultToFile (self=0x0, args=0x80e65b8)
    at libxslt-py.c:1257
warning: Source file is more recent than executable.

1257	    PyObject *pyobj_style;
(gdb) n
1259	    if (!PyArg_ParseTuple(args, (char *)"OOO:xsltSaveResultToFile", &pyobj_file,
&pyobj_result, &pyobj_style))
(gdb) 
1260	        return(NULL);
(gdb) 
1261	    file = (FILE *) PyFile_Get(pyobj_file);
(gdb) 
1263	    style = (xsltStylesheetPtr) Pystylesheet_Get(pyobj_style);
(gdb) 
1264	
(gdb) 
1265	    c_retval = xsltSaveResultToFile(file, result, style);
(gdb) p file
$1 = (FILE *) 0x0
(gdb) n 
1266	    py_retval = libxml_intWrap((int) c_retval);
(gdb) p c_retval
$2 = -1
(Continue reading)


Gmane