[XML-SIG] memory related issues in Python - bug??

Fred L. Drake, Jr. fdrake at acm.org
Tue Sep 9 15:30:19 EDT 2003


Mallick, Pinki writes:
 > This works properly for all files. But when I am trying to use it
 > on a very large XML file, one of the node's data is
 > incomplete. eg. if grandChildNode.toxml() returns "<mi>y18</mi>"
 > for this node, then "str(grandChildNode.firstChild.data)" returns
 > only "y" instead of "y18".

Have you checked how many children grandChildNode has?  It's entirely
possible that there are multiple children of grandChildNode, and the
first really does only have "y" as data.  (If in doubt, call
grandChildNode.normalize() first; that should combine adjacent text
nodes.)

 > This looks like some memory problem. Is there any workaround for
 > this problem.

I don't know what else you've done with the tree, but it sounds like
it may simply be a common misunderstanding of the DOM interface.


  -Fred

-- 
Fred L. Drake, Jr.  <fdrake at acm.org>
PythonLabs at Zope Corporation



More information about the XML-SIG mailing list