nodes attached to one of the element nodes are joined?
-----Ursprüngliche Nachricht-----
Von: py*******************************************@pyth on.org
[mailto:py***************************************** **@python.org] Im Auftrag
von Fredrik Lundh
Gesendet: Freitag, 28. November 2003 12:14
An: py*********@python.org
Betreff: Re: Buffer restriction in dom.minidom?
Oliver Walczak wrote:
In one of my projects i use dom.minidom as XML parser. I recently had a
problem when the value of a text node as a child of an element node was
larger than 1024 characters. It created 2 or more child nodes out of it so i had to concatenate both items again manually. On another machine it only
created one child node out of the text node as i further expected although
both are running Python 2.2.3 on WinXP.
Does anyone know whats going on there?
the parser may chose to split CDATA over multiple Text nodes:
http://www.python.org/doc/current/li...t-objects.html
"A single CDATA section may be represented by more than one
node in the document tree."
if this matters to your program, use "normalize" before accessing the
contents:
http://www.python.org/doc/current/li...e-objects.html
(using normalize is a good idea even if you're using a normalizing parser;
it prevents nasty surprises the day you or someone else wants to use
your code on a DOM tree created by some other part of your program...)
</F>
--
http://mail.python.org/mailman/listinfo/python-list