Hervé Cauwelier | 2 Sep 18:05
Picon
Favicon

copying an element will "reset" is nsmap

Hi, I have another unexpected behaviour.

I have a root element with many namespaces declared. When I introspect
the first child of the root, the nsmap is full. When I "deepcopy" it,
only the the namespace used in the tag name is kept. If the name is not
qualified, nsmap turns empty. (Sorry if I don't use the right XML semantic.)

I tried to reaffect nsmap but the attribute is read-only.

How could I preserve the nsmap attribute of unattached elements?

Regards,

Hervé

--

-- 
lxml.etree:        (2, 2, 2, 0)
libxml used:       (2, 7, 3)
libxml compiled:   (2, 7, 3)
libxslt used:      (1, 1, 24)
libxslt compiled:  (1, 1, 24)
_______________________________________________
lxml-dev mailing list
lxml-dev <at> codespeak.net
http://codespeak.net/mailman/listinfo/lxml-dev
Steve Howe | 2 Sep 21:19
Picon

Re: Python 3.1 binary on Windows?

Hello all,
> Hi,
>
> maybe it's just me being stupid for overlooking something, but are there
> Windows binaries built for Python 3.1 out there?
Shouldn't this message be on Python-specific list ? Or at *least* marked as 
"OFF-TOPIC" ?

That said, you can choose between the official download on the Python page:

http://www.python.org/download/

... or ActivePython's distribution:

http://www.activestate.com/activepython/python3/

--

-- 
Best Regards,
Steve Howe
Stefan Behnel | 2 Sep 21:32
Picon
Favicon
Gravatar

Re: Python 3.1 binary on Windows?


Steve Howe wrote:
>> maybe it's just me being stupid for overlooking something, but are there
>> Windows binaries built for Python 3.1 out there?
> Shouldn't this message be on Python-specific list ? Or at *least* marked as 
> "OFF-TOPIC" ?

I would guess from the context of this mailing list that the OP meant
binary builds of lxml for that platform.

I think that would be a question for Sidnei.

Stefan
Stefan Behnel | 2 Sep 21:39
Picon
Favicon
Gravatar

Re: copying an element will "reset" is nsmap


Hervé Cauwelier wrote:
> Hi, I have another unexpected behaviour.
> 
> I have a root element with many namespaces declared. When I introspect
> the first child of the root, the nsmap is full. When I "deepcopy" it,
> only the the namespace used in the tag name is kept. If the name is not
> qualified, nsmap turns empty. (Sorry if I don't use the right XML semantic.)
> 
> I tried to reaffect nsmap but the attribute is read-only.
> 
> How could I preserve the nsmap attribute of unattached elements?

My guess is that the namespaces end up being declared either on the new
document (libxml2) node, or at the element where they are first used in the
copied tree.

If the latter, there's not that much that lxml can do about it (I guess).
If the first, we might be able to fake something by adding the document
wide namespace declarations to the .nsmap of the root element. That might
be a nice feature anyway.

Could you check if the namespaces end up in .nsmap dicts at deeper tree
levels or not? (a short example script would be helpful, BTW)

Stefan
_______________________________________________
lxml-dev mailing list
lxml-dev <at> codespeak.net
http://codespeak.net/mailman/listinfo/lxml-dev
(Continue reading)

Stefan Behnel | 2 Sep 21:40
Picon
Favicon
Gravatar

Re: getname() method on 'smart' attribute string values


Nicholas Dudfield wrote:
>> You can give it a try on the trunk, if you like.
>>
>> https://codespeak.net/viewvc/?view=rev&revision=67010
>>
>> http://codespeak.net/lxml/build.html
>>
>> Stefan
>>    
> I also have need for this functionality and also a bugfix from a 
> revision ahead of the stable version 2.2.2 available for windows.
> 
> I heard libxml2/lxml is a PITA to build on windows so being 
> inexperienced I'll not bother attempting it before ruling out alternatives.
> 
> Is there a build bot with dist zips of the latest revisions available 
> anywhere for windows ?

Not that I know of.

Stefan
Stefan Behnel | 2 Sep 21:45
Picon
Favicon
Gravatar

Re: current trunk includes static build for libiconv


Pascal Oberndoerfer wrote:
> I copied the new 'buildlibxml.py' into a clean lxml-2.2.2 directory and
> started a build with '-- static-deps'.  Everything seems to work fine
> (libiconv, libxml2, and libxslt build nicely) except form some minor
> errors like:
> 
> - 'make[3]: [install-data-local] Error 71 (ignored)'
> - 'make[2]: [xsltproc.html] Error 4 (ignored)'
> 
> Unfortunately -- after installing -- I get this ImportError on doing
> 'import lxml.etree':
> 
>> ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.5/
>> lib/python2.5/site-packages/lxml-2.2.2-py2.5-macosx-10.3-ppc.egg/lxml/
>> etree.so, 2): Symbol not found: _libiconv_close
>>
>>   Referenced from: /Library/Frameworks/Python.framework/Versions/2.5/
>>   lib/python2.5/site-packages/lxml-2.2.2-py2.5-macosx-10.3-ppc.egg/lxml/
>>   etree.so
>>
>>   Expected in: dynamic lookup

Could you post the command line options of the calls to gcc that distutils
print during the build?

> As the problem is AFAICT only related to the PPC platform
> (and if running MacOS X 10.4.x?), would it make sense to
> build libiconv statically only
> 
(Continue reading)

Stefan Behnel | 2 Sep 21:46
Picon
Favicon
Gravatar

Re: problems trying to install lxml 2.2 on Mac OS X


Gael Pasgrimaud wrote:
> On Wed, Aug 12, 2009 at 6:01 PM, Stefan Behnel wrote:
>> we have binaries for 10.5:
>>
>> http://pypi.python.org/pypi/lxml/2.2.2
> 
> I still dont understand why my OSX 10.5 always want to compile lxml.

To be honest, I have no idea. But that's definitely a
distutils/setuptools/easyinstall thing, not an lxml problem.

Stefan
Sidnei da Silva | 2 Sep 21:49
Favicon

Re: Python 3.1 binary on Windows?

On Wed, Sep 2, 2009 at 4:32 PM, Stefan Behnel<stefan_ml <at> behnel.de> wrote:
>
> Steve Howe wrote:
>>> maybe it's just me being stupid for overlooking something, but are there
>>> Windows binaries built for Python 3.1 out there?
>> Shouldn't this message be on Python-specific list ? Or at *least* marked as
>> "OFF-TOPIC" ?
>
> I would guess from the context of this mailing list that the OP meant
> binary builds of lxml for that platform.
>
> I think that would be a question for Sidnei.

Uhm. Yeah. I thought I had those but I have only 3.0. When is the next
release of lxml due? If it will take a while I can upload a 3.1 build
of lxml 2.2.2.

-- Sidnei
Ted Dziuba | 2 Sep 21:27
Favicon
Gravatar

Re: Python 3.1 binary on Windows?

I believe he's looking for pre-build lxml binaries that target Python 3.1 on Windows.

On Wed, Sep 2, 2009 at 12:19 PM, Steve Howe <howesteve <at> gmail.com> wrote:
Hello all,
> Hi,
>
> maybe it's just me being stupid for overlooking something, but are there
> Windows binaries built for Python 3.1 out there?
Shouldn't this message be on Python-specific list ? Or at *least* marked as
"OFF-TOPIC" ?

That said, you can choose between the official download on the Python page:

http://www.python.org/download/

... or ActivePython's distribution:

http://www.activestate.com/activepython/python3/

--
Best Regards,
Steve Howe
_______________________________________________
lxml-dev mailing list
lxml-dev <at> codespeak.net
http://codespeak.net/mailman/listinfo/lxml-dev



--
Ted Dziuba
Co-Founder and Engineer

Milo.com, Inc.
165 University Avenue
Palo Alto, CA, 94301
http://milo.com

Cell: (609)-665-2639

_______________________________________________
lxml-dev mailing list
lxml-dev <at> codespeak.net
http://codespeak.net/mailman/listinfo/lxml-dev
Stefan Behnel | 2 Sep 21:58
Picon
Favicon
Gravatar

Re: Python 3.1 binary on Windows?


Sidnei da Silva wrote:
> On Wed, Sep 2, 2009 at 4:32 PM, Stefan Behnel wrote:
>> Steve Howe wrote:
>>>> maybe it's just me being stupid for overlooking something, but are there
>>>> Windows binaries built for Python 3.1 out there?
>>> Shouldn't this message be on Python-specific list ? Or at *least* marked as
>>> "OFF-TOPIC" ?
>> I would guess from the context of this mailing list that the OP meant
>> binary builds of lxml for that platform.
>>
>> I think that would be a question for Sidnei.
> 
> Uhm. Yeah. I thought I had those but I have only 3.0. When is the next
> release of lxml due?

I'd like to get a 2.2.3 ready soon and a 2.3 at about the same time, but
there's no deadline.

> If it will take a while I can upload a 3.1 build of lxml 2.2.2.

Please do, that will certainly help some users. The main problem on 3.x is
still the lack of available external (binary) packages.

Stefan

Gmane