Eric Ferrante | 6 Jan 2006 10:25
Picon
Favicon

install error

Hello,

I try to install lxml-0.8, but I get errors with the gcc 4.0. I know the problems with gcc 4.0 and I have installed de patches for Pyrex. But I get still 6 errors.

My system is the last version of fedora.

Could someone help me. I'am so desapointed because these patches seem all right for everybody except me.

Thank you (and sorry for Frenglish).

Eric Ferrante
--
Untitled Document

Eric Ferrante | (33) 05 61 50 49 28
Chargé de développement des nouvelles technologies éducatives
Service de la Formation Continue | Université de Toulouse-Le Mirail

_______________________________________________
lxml-dev mailing list
lxml-dev <at> codespeak.net
http://codespeak.net/mailman/listinfo/lxml-dev
Stefan Behnel | 6 Jan 2006 12:21
Picon

Re: install error


Eric Ferrante wrote:
> I try to install lxml-0.8, but I get errors with the gcc 4.0. I know the
> problems with gcc 4.0 and I have installed de patches for Pyrex. But I
> get still 6 errors.
> 
> My system is the last version of fedora.

That is a known bug in Pyrex. The patches have been available for months, but
have not yet found their way into all distributions.

Please use the SVN version of lxml, it now contains the generated C-file. You
therefore no longer have to use Pyrex.

Stefan
Olivier Grisel | 6 Jan 2006 14:01

Re: install error

Stefan Behnel a écrit :
> Eric Ferrante wrote:
>> I try to install lxml-0.8, but I get errors with the gcc 4.0. I know the
>> problems with gcc 4.0 and I have installed de patches for Pyrex. But I
>> get still 6 errors.
>>
>> My system is the last version of fedora.
> 
> That is a known bug in Pyrex. The patches have been available for months, but
> have not yet found their way into all distributions.
> 
> Please use the SVN version of lxml, it now contains the generated C-file. You
> therefore no longer have to use Pyrex.

Or you can try with this prepatched version of Pyrex that works for me:

http://svn.nuxeo.org/trac/pub/browser/vendor/Pyrex/tags/0.9.3-gcc4-patched/

--

-- 
Olivier
Eric Ferrante | 7 Jan 2006 12:51
Picon
Favicon

Re: lxml-dev Digest, Vol 16, Issue 2

Selon lxml-dev-request <at> codespeak.net:

> Send lxml-dev mailing list submissions to
> 	lxml-dev <at> codespeak.net
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://codespeak.net/mailman/listinfo/lxml-dev
> or, via email, send a message with subject or body 'help' to
> 	lxml-dev-request <at> codespeak.net
>
> You can reach the person managing the list at
> 	lxml-dev-owner <at> codespeak.net
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of lxml-dev digest..."
>
>
> Today's Topics:
>
>    1. Re: install error (Stefan Behnel)
>    2. Re: install error (Olivier Grisel)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 06 Jan 2006 12:21:58 +0100
> From: Stefan Behnel <behnel_ml <at> gkec.informatik.tu-darmstadt.de>
> Subject: Re: [lxml-dev] install error
> To: Eric Ferrante <ferrante <at> univ-tlse2.fr>
> Cc: lxml-dev <at> codespeak.net
> Message-ID: <43BE52D6.50404 <at> gkec.informatik.tu-darmstadt.de>
> Content-Type: text/plain; charset=ISO-8859-1
>
>
> Eric Ferrante wrote:
> > I try to install lxml-0.8, but I get errors with the gcc 4.0. I know the
> > problems with gcc 4.0 and I have installed de patches for Pyrex. But I
> > get still 6 errors.
> >
> > My system is the last version of fedora.
>
> That is a known bug in Pyrex. The patches have been available for months, but
> have not yet found their way into all distributions.
>
> Please use the SVN version of lxml, it now contains the generated C-file. You
> therefore no longer have to use Pyrex.
>
> Stefan
>
>
> ------------------------------
>
> Message: 2
> Date: Fri, 06 Jan 2006 14:01:55 +0100
> From: Olivier Grisel <ogrisel <at> nuxeo.com>
> Subject: [lxml-dev] Re: install error
> To: lxml-dev <at> codespeak.net
> Message-ID: <dplpo1$5ds$1 <at> sea.gmane.org>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Stefan Behnel a écrit :
> > Eric Ferrante wrote:
> >> I try to install lxml-0.8, but I get errors with the gcc 4.0. I know the
> >> problems with gcc 4.0 and I have installed de patches for Pyrex. But I
> >> get still 6 errors.
> >>
> >> My system is the last version of fedora.
> >
> > That is a known bug in Pyrex. The patches have been available for months,
> but
> > have not yet found their way into all distributions.
> >
> > Please use the SVN version of lxml, it now contains the generated C-file.
> You
> > therefore no longer have to use Pyrex.
>
> Or you can try with this prepatched version of Pyrex that works for me:
>
> http://svn.nuxeo.org/trac/pub/browser/vendor/Pyrex/tags/0.9.3-gcc4-patched/
>
> --
> Olivier
>
>
>
> ------------------------------
>
> _______________________________________________
> lxml-dev mailing list
> lxml-dev <at> codespeak.net
> http://codespeak.net/mailman/listinfo/lxml-dev
>
>
> End of lxml-dev Digest, Vol 16, Issue 2
> ***************************************
>

Thank you. I've tried the first solution, and it seems to be good. I'll be sure
when I'll be able to run the product whitch needs lxml. Soon.

Thank you one more.

Bye. Eric Ferrante

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
Stefan Behnel | 10 Jan 2006 16:13
Picon

XPathModel

Hi!

I had mentioned something about my XPath model a while ago and there was some
interest. I now uploaded the project that I wrote it for to Berlios, so the
module is now available here:

http://svn.berlios.de/wsvn/slow/trunk/src/slow/model/xpathmodel.py?op=file&rev=0&sc=0

It (obviously) uses the namespace extension mechanism that I wrote for lxml.
The implementation is basically a metaclass that allows you to write XPath
expressions into the body of a Python class and then transforms them at class
creation time into getter and setter methods or properties (if possible). It's
pretty sophisticated: it supports XPath variables as method arguments, filters
for simple XPath result conversion and on-the-fly construction of XML
elements. It's even more home grown by need, so it may be a bit difficult to
understand at first sight.

The package of that module contains a number of other modules that use the
XPathModel class to implement various kinds of data class APIs, they may be a
good starting point.

Hope you like it,
Stefan
Stefan Behnel | 19 Jan 2006 16:33
Picon

libxml2 2.6.23 and lxml I/O support

Hi!

Version 2.6.23 of libxml2 is out since the early this month and it contains a
number of patches, including Geert's long awaited SaveToBuffer patch. So,
maybe we should reconsider the I/O patches for lxml?

Geert, anything new from the front? Ready to get your stuff accepted?
What/where is your current patch?

Stefan
Stefan Behnel | 20 Jan 2006 14:05
Picon

Re: Namespace API for extension functions (was: Doctest for Namespace class)

Responding to myself to continue this discussion from last year...

Stefan Behnel wrote:
> Martijn Faassen wrote:
>> Yes, I'd like to keep support for XPath as per spec. We could consider
>> an alternative API that supports this pattern too, though, as long as
>> it's clear that this is not (exactly) XPath. Perhaps we can introduce a
>> little helper function called 'clarke()' or something, that transforms
>> clark notation into an xpath expression + namespace dictionary.
>>
>> I don't really like globally defined prefixes, but when namespace
>> classes are used it isn't that bad. I guess functions would be in their
>> own namespace typically, so it might be we want to define a special
>> namespace class just for this purpose?
> 
> Or a subclass of XPath, like ClarkXPath, that accepts Clark's notation. A
> helper function would then do the trick internally.

I think that's a good solution. If people want to use Clark's notation in
XPath expressions, they can use a subclass of the XPath class. This also
reduces the performance penalty of having to parse the XPath expression for
namespaces: it's only done at XPath object creation time.

> What you're proposing would be something like 'FunctionNamespace'. Nothing
> wrong with that. Actually, it's even (more or less) handled that way
> internally. Don't know if it's worth a separate API, though. Also, note that
> sometimes functions do not have a separate namespace, look at XSLT, for example.

I started writing a module function called 'ExtensionNamespace' that can be
used for extensions. It has a prefix associated with it, so that you can do
what I proposed before:

.>>> ns = ExtensionNamespace('myns')
.>>> ns.prefix = 'f'
.>>> ns['func'] = my_function
.>>> element.xpath('f:func(//honk)')

or call an XSLT that uses this function like in

...
<xsl:value-of select="f:func(.)"/>
...

It becomes somewhat problematic, however, when different namespaces become
associated with the same prefix, like this:

.>>> ns1 = ExtensionNamespace('myns1')
.>>> ns1.prefix = 'f'
.>>> ns2 = ExtensionNamespace('myns2')
.>>> ns2.prefix = 'f'

I don't like putting this in the hands of the user. We could use a dictionary
internally, but that would still be a global one, so if some module happens to
register a prefix that is already used by a different module - bad luck. And I
guess this is much more likely to happen with prefixes than with namespaces.

So, I don't know. Maybe the best solution is still to simply register all
namespace functions internally on each XPath/XSLT evaluation. It is rather
unlikely that use cases will deploy more than, say, 20 extension functions and
those could be registered pretty quickly, without a big performance hit.

Another point of discussion: Should the current support for extension
functions be dropped? This would obviously break current code, but it would
make both the internal implementation and the API cleaner by removing the
'extensions' argument from the respective method calls and by removing the
need for merging dictionaries of functions. I'm especially looking at lxml
V1.0, which should have a clean and stable API.

Any comments?

Stefan
Martijn Faassen | 20 Jan 2006 19:00
Favicon

Re: libxml2 2.6.23 and lxml I/O support

Hey,

Stefan Behnel wrote:
> Version 2.6.23 of libxml2 is out since the early this month and it contains a
> number of patches, including Geert's long awaited SaveToBuffer patch. So,
> maybe we should reconsider the I/O patches for lxml?

I noticed that too.

> Geert, anything new from the front? Ready to get your stuff accepted?
> What/where is your current patch?

I'm curious too! :)

We need to think carefully about which versions of libxml2 we want to 
support with lxml, as it's rather nice to be able to work with what's in 
a linux distribution out of the box.

Regards,

Martijn
Geert Jansen | 20 Jan 2006 21:11
Picon

Re: libxml2 2.6.23 and lxml I/O support

Stefan Behnel wrote:
> Hi!
>
> Version 2.6.23 of libxml2 is out since the early this month and it contains a
> number of patches, including Geert's long awaited SaveToBuffer patch. So,
> maybe we should reconsider the I/O patches for lxml?
>
> Geert, anything new from the front? Ready to get your stuff accepted?
> What/where is your current patch?
>   

Hi Stefan,

not much news: I haven't been able to work on lxml recently because
various other commitments. Over the next few weeks though I should have
more time available and my intention is to post a new version of the
patch relative to the current lxml and with all feedback included.

Regards,
Geert

_______________________________________________
lxml-dev mailing list
lxml-dev <at> codespeak.net
http://codespeak.net/mailman/listinfo/lxml-dev
Patrick Wagstrom | 21 Jan 2006 00:56
Favicon

creating an interface for processing instructions

Hi folks,

I'm developing a web app that can rely on the browser to automatically
transform XML documents using XSLT.  Typically, this is done by
inserting an XML processing instruction into the document.  However,
this introduces a slight wrinkle in the structure of lxml (and
elementTree too).

Basically, if I understand the code correctly, the ElementTree class has
a root node that can be accessed through the getRoot method.  However,
once I have this node, there is no way to go the next sibling node, at
least not that I can see.  Normally, this is fine as typical XML
documents only have a single root.  However, when you include PIs, they
actually end up having multiple roots.

For example, this is a valid XML document

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="/resources/xslt/blog.xsl"?>
<doc>
  <foo>fadsfad</foo>
</doc>

Normally, with libxml2 you create a document, add in the node that
represents "doc", then add in the PI using addPrevSibling or something
like that.  When reading in the document, you'll need need to use the
next() function get over the PI.

However, it doesn't appear there is a way to do this in lxml or in
elementTree right now.  I've managed to get the PI factory working, I
just can't create multi-rooted documents without a whole lot of mangling
that would break 100% elementTree compatibility -- because as near as I
can tell, elementTree in python subversion can't do this either (or I
haven't figured out how to).  It can create PIs, but not put them right
at the beginning of the document before the root not.

Any help on this one?

--Patrick

Gmane