Re: parse xml

2011-10-03 Thread Adam Tauno Williams
Quoting 守株待兔 <1248283...@qq.com>: please click the http://www.secinfo.com/d14qfp.q9j.htm then ,click the following: 44: XML IDEA: Condensed Consolidating Statements of Income XML 5.11M (Details)--R158 there is the citigroup's annual financial report --statements of income,xml file.

Re: parse xml

2010-10-15 Thread Hidura
First every element represents a node so you have to use value=n.childNodes[0].nodeValue with that you'll have the 5000 2010/10/15, kostia : > I have xml file: > > > 5 > > > I want to get the value of n (= 5) inside my python program, I'm > doing this: > > import xml.dom.minidom

Re: parse xml

2010-10-15 Thread kostia
Thank you all! -- http://mail.python.org/mailman/listinfo/python-list

Re: parse xml

2010-10-15 Thread MRAB
On 15/10/2010 18:49, kostia wrote: I have xml file: 5 I want to get the value of n (= 5) inside my python program, I'm doing this: import xml.dom.minidom from xml.dom.minidom import Node doc = xml.dom.minidom.parseString("boolean_width.xml") n = doc.getElementsByTagName("roo

Re: parse xml

2010-10-15 Thread Nitin Pawar
this is wrong xml.dom.minidom.parseString("boolean_width.xml") ... if u r parsing from String use string variable as argument or use parse only if parsing from file On Sat, Oct 16, 2010 at 12:07 AM, Andreas Waldenburger wrote: > On Fri, 15 Oct 2010 10:49:18 -0700 (PDT) kostia > wrote: > > > I h

Re: parse xml

2010-10-15 Thread Sudheer Satyanarayana
On 10/15/2010 11:19 PM, kostia wrote: I have xml file: 5 I want to get the value of n (= 5) inside my python program, I'm doing this: import xml.dom.minidom from xml.dom.minidom import Node doc = xml.dom.minidom.parseString("boolean_width.xml") Use parse to parse a file

Re: parse xml

2010-10-15 Thread Andreas Waldenburger
On Fri, 15 Oct 2010 10:49:18 -0700 (PDT) kostia wrote: > I have xml file: > > > 5 > > > I want to get the value of n (= 5) inside my python program, I'm > doing this: > > import xml.dom.minidom > from xml.dom.minidom import Node > doc = xml.dom.minidom.parseString("boolean_wi

Re: parse xml with invalid chars

2010-06-04 Thread Someone Something
What d'ya mean hang? On Fri, Jun 4, 2010 at 10:16 AM, Roman Makurin wrote: > Hi all > > Last time i have a big problem, i need parse xml files > which have invalid xml chars outside of CDATA and xml > parser hangs everytime on such files. Is there any way > to parse such files ??? > > thanks > >

Re: Parse xml file

2009-08-30 Thread Mag Gam
XML is a structured file. I never knew you can read it line by line and process. iterparse() More info on iterparse(): http://effbot.org/zone/element-iterparse.htm On Thu, Aug 27, 2009 at 10:39 AM, Stefan Behnel wrote: > loial wrote: >> Is there a quick way to retrieve data from an xml file in p

Re: Parse xml file

2009-08-27 Thread Stefan Behnel
loial wrote: > Is there a quick way to retrieve data from an xml file in python 2.4, > rather than read the whole file? ElementTree is available as an external package for Py2.4 (and it's in the stdlib xml.etree package since 2.5). It's pretty much the easiest way to get data out of XML files. I

Re: Parse xml file

2009-08-27 Thread Balamurugan S
On Thu, Aug 27, 2009 at 2:26 PM, loial wrote: > Is there a quick way to retrieve data from an xml file in python 2.4, > rather than read the whole file? Universal Feed parser can do the job for you. This can be imported and used in your python programs. For more information, http://www.feedparser

Re: Parse XML using Python

2004-12-10 Thread Uche Ogbuji
This is a neat solution. You can parse any well-formed general entitity (e.g. Anil's document with multiple root nodes) in 4Suite 1.0a4: from Ft.Xml.Domlette import EntityReader s = """ eggs more eggs """ docfrag = EntityReader.parseString(s, 'http://foo/test/spam.xml') docfrag is now ready for

Re: Parse XML using Python

2004-12-09 Thread Anil
William Park wrote: > [EMAIL PROTECTED] wrote: > > Hi, > > > > I wanted to write a script that will read the below file: > > > > > > . > > > > > > > > .. > > > > .. > > > > > > > > .. > > > > .. > > > > .. > > > > . > > . > > > > . > > > > > > > > .. > > > > > > > > .. > > >

Re: Parse XML using Python

2004-12-09 Thread William Park
[EMAIL PROTECTED] wrote: > Hi, > > I wanted to write a script that will read the below file: > > > . > > > > .. > > .. > > > > .. > > .. > > .. > > . > . > > . > > > > .. > > > > .. > > > > > > .. > and so on > > The output of the script shud be > > ABC > ..EFGA >

Re: Parse XML using Python

2004-12-09 Thread Fredrik Lundh
<[EMAIL PROTECTED]> wrote: > > > . > . > > > > .. > and so on an XML document can only have a single root element, but your example has at least two top-level elements (abcd and xyz). here is some elementtree code that handles this by wrapping your data in a "root" element. from elementtr

Re: Parse XML using Python

2004-12-09 Thread Jeremy Bowers
On Thu, 09 Dec 2004 06:00:27 -0800, Anil wrote: > > Thomas Guettler wrote: >> Hi, >> >> Here is an example how to use sax: >> >> http://pyxml.sourceforge.net/topics/howto/node12.html >> >> Thomas >> >> -- >> Thomas GÃttler, http://www.thomas-guettler.de/ > > > Could you please tell me how to a

Re: Parse XML using Python

2004-12-09 Thread Diez B. Roggisch
Anil wrote: > Could you please tell me how to achieve the below. > I am interested in getting the output like: > > ABC > EFGA --> child of ABC > ABDG --> child of AEFGA > MON --> child of ABC > A1 > FGA --> child of A1 > BG--> child of FGA print """ ABC EFGA --> child of

Re: Parse XML using Python

2004-12-09 Thread Anil
Thomas Guettler wrote: > Am Wed, 08 Dec 2004 23:25:49 -0800 schrieb anilby: > > > Hi, > > > > I wanted to write a script that will read the below file: > > Hi, > > Here is an example how to use sax: > > http://pyxml.sourceforge.net/topics/howto/node12.html > > Thomas > > -- > Thomas Güttler, http

Re: Parse XML using Python

2004-12-09 Thread Thomas Guettler
Am Wed, 08 Dec 2004 23:25:49 -0800 schrieb anilby: > Hi, > > I wanted to write a script that will read the below file: Hi, Here is an example how to use sax: http://pyxml.sourceforge.net/topics/howto/node12.html Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ -- http://mail.pyt