Parsing xml file in python

2007-10-30 Thread amjadcsu
I am a newbie in python I am trying to parse a xml file and write its content in a txt file. The txt contains null elements. Any reason what iam doing wrong here Here is the code that i wrote import sys,os import xml.sax import xml.sax.handler from xml.sax.handler import ContentHandler from

Re: Parsing xml file in python

2007-10-30 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: I am a newbie in python I am trying to parse a xml file and write its content in a txt file. The txt contains null elements. Any reason what iam doing wrong here Here is the code that i wrote import sys,os import xml.sax import xml.sax.handler from

Re: Parsing xml file in python

2007-10-30 Thread amjadcsu
That XML is just a snapshot I am not getting into the xml parser. The error is not generated but also the /root/yhpc-2.0/ganglia.txt does not contain anything. On Oct 30, 12:32 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] schrieb: I am a newbie in python I am trying

Re: Parsing xml file in python

2007-10-30 Thread Marc 'BlackJack' Rintsch
On Tue, 30 Oct 2007 11:45:17 -0700, amjadcsu wrote: I am not getting into the xml parser. What does this mean!? The error is not generated but also the /root/yhpc-2.0/ganglia.txt does not contain anything. Maybe becauseā€¦ def endElement(self,name): if name==HOST and

Re: Parsing xml file in python

2007-10-30 Thread J. Clifford Dyer
On Tue, Oct 30, 2007 at 11:45:17AM -0700, [EMAIL PROTECTED] wrote regarding Re: Parsing xml file in python: Top-posting corrected On Oct 30, 12:32 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] schrieb: I am a newbie in python I am trying to parse a xml

Re: Parsing xml file in python

2007-10-30 Thread Stefan Behnel
[EMAIL PROTECTED] wrote: I am a newbie in python I am trying to parse a xml file and write its content in a txt file. If you want to write code that does not hide your bugs behind cryptic event handlers and instead helps you get XML work done, try using ElementTree or lxml instead of SAX. The