[lxml-dev] xml:space and xml:lang problem

Scott Haeger bashautomation at gmail.com
Wed Feb 22 19:32:00 CET 2006


I upgraded to the latest SVN version.  I believe it has fixed the problem.
Strange, my version of lxml was only about a week old.  Thanks for the help.

Scott

On 2/22/06, Stefan Behnel <behnel_ml at gkec.informatik.tu-darmstadt.de> wrote:
>
>
> Scott Haeger wrote:
> > Problem occurs: Note the xml namespace in the output.
> >
> > from lxml import etree
> > import sys
> > intree = etree.parse("test.xml")
> > outroot = etree.Element("root")
> > doc = intree.getiterator()
> > for el in doc:
> >     newel = el
> >     outroot.append (newel)
> > outtree = etree.ElementTree(outroot)
> > outtree.write(sys.stdout)
> >
> > Test file:
> >
> > <?xml version="1.0"?>
> > <svg
> >     xmlns:svg="http://www.w3.org/2000/svg <http://www.w3.org/2000/svg>"
> >     xmlns:xml=" http://www.w3.org/XML/1998/namespace">
> > <a id="first" xml:space="default"></a>
> > </svg>
>
> My system:
> Python  - 2.4.2
> lxml    - from scoder2 branch and current SVN
> libxml2 - 2.6.23
>
> My output for the above script:
> <root><svg xmlns:svg="http://www.w3.org/2000/svg ">
> </svg><a id="first" xml:space="default"/>
> </root>
>
> I do not see a problem here. Maybe you are using an outdated version of
> libxml2?
>
> Stefan
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://codespeak.net/pipermail/lxml-dev/attachments/20060222/40ad4dd8/attachment.htm


More information about the lxml-dev mailing list