[XML-SIG] PyXML wierdness

Pete Black pete.black@metering.co.nz
Fri, 16 Jun 2000 17:29:37 +1200


This is a multi-part message in MIME format.

------=_NextPart_000_0005_01BFD7B8.722EB080
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi there,

i'm trying to use PyXML to parse some XML files, and i get some odd =
behaviour.

using this code:

from xml.dom import core,utils

reader =3D utils.FileReader('c:\\TMLIntranet\\headlines\\headlines.xml')
doc =3D reader.document
Storage =3D ""
print "."
for n in doc.documentElement.childNodes:
 if n.nodeType=3D=3Dcore.TEXT:
  Storage=3DStorage+ n.nodeValue
 =20

#print Storage


i get the following output:

[]
[]
[]
[]
[]
[]
[]
[]
[]
.

What is going on here? It seems that the utils.FileReader function is =
outputting these '[]'s to the screen when i run a file through it, but =
surely this is not intended?

Anyone know why this might happen and how i might fix it?

(I am using Python 1.52 (the version shipped with Zope 2.16) on Win =
2000.

I installed the PyXML module from the binary installer that was posted =
to this list a while back. Could it be that this build has debugging =
code in it or something?

Regards

-Pete
(please respond directly, as i only read the archives of this list)


------=_NextPart_000_0005_01BFD7B8.722EB080
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2920.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi there,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>i'm trying to use PyXML to parse some =
XML files,=20
and i get some odd behaviour.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>using this code:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>from xml.dom import =
core,utils</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>reader =3D=20
utils.FileReader('c:\\TMLIntranet\\headlines\\headlines.xml')<BR>doc =3D =

reader.document<BR>Storage =3D ""<BR>print "."<BR>for n in=20
doc.documentElement.childNodes:<BR>&nbsp;if=20
n.nodeType=3D=3Dcore.TEXT:<BR>&nbsp;&nbsp;Storage=3DStorage+=20
n.nodeValue<BR>&nbsp;&nbsp;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>#print Storage</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>i get the following =
output:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>[]</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>[]</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>[]</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>[]</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>[]</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>[]</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>[]</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>[]</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>[]</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>What is going on here? It seems that =
the=20
utils.FileReader function is outputting these '[]'s to the screen when i =
run a=20
file through it, but surely this is not intended?</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Anyone know why this might happen and =
how i might=20
fix it?</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>(I am using Python 1.52 (the version =
shipped with=20
Zope 2.16) on Win 2000.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I installed the PyXML module from the =
binary=20
installer that was posted to this list a while back. Could it be that =
this build=20
has debugging code in it or something?</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Regards</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>-Pete</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>(please respond directly, as i only =
read the=20
archives of this list)</FONT></DIV>
<DIV>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_0005_01BFD7B8.722EB080--