Re: XML Parsing

2017-09-04 Thread Peter Otten
Sambit Samal wrote: > Hi , > > Need help in Python Script using xml.etree.ElementTree to update the > value of any element in below XML ( e.g SETNPI to be 5 ) based on some > constraint ( e.g ) . Something along the lines from xml.etree import ElementTree as ET tree = ET.parse("original.xml"

XML Parsing

2017-09-04 Thread Sambit Samal
Hi , Need help in Python Script using xml.etree.ElementTree to update the value of any element in below XML ( e.g SETNPI to be 5 ) based on some constraint ( e.g ) . DRATRN 1 1

Re: xml parsing with lxml

2016-10-07 Thread Doug OLeary
On Friday, October 7, 2016 at 3:21:43 PM UTC-5, John Gordon wrote: > root = doc.getroot() > for child in root: > print(child.tag) > Excellent! thank, you sir! that'll get me started. Appreciate the reply. Doug O'Leary -- https://mail.python.org/mailman/listinfo/python-list

Re: xml parsing with lxml

2016-10-07 Thread John Gordon
In <622ea3b0-88b4-420b-89e0-9e7c6e866...@googlegroups.com> Doug OLeary writes: > >>> from lxml import etree > >>> doc =3D etree.parse('config.xml') > Now what? For instance, how do I list the top level children of > ? root = doc.getroot() for child in root: print(child.tag) -- John Gord

xml parsing with lxml

2016-10-07 Thread Doug OLeary
Hey; I'm trying to gather information from a number of weblogic configuration xml files using lxml. I've found any number of tutorials on the web but they all seem to assume a knowledge that I apparently don't have... that, or I'm just being rock stupid today - that's distinct possibility too.

Re: XML Parsing

2015-04-05 Thread Stefan Behnel
Sepideh Ghanavati schrieb am 06.04.2015 um 04:26: > I know basic of python and I have an xml file created from csv which has > three attributes "category", "definition" and "definition description". > I want to parse through xml file and identify actors, constraints, > principal from the text. Howe

Re: XML Parsing

2015-04-05 Thread Ben Finney
Sepideh Ghanavati writes: > I know basic of python and I have an xml file created from csv What XML schema defines the document's format? Without knowing the schema, parsing will be unreliable. What created the document? Why is it relevant that the document was “created from CSV”? > which has

XML Parsing

2015-04-05 Thread Sepideh Ghanavati
Hi, I know basic of python and I have an xml file created from csv which has three attributes "category", "definition" and "definition description". I want to parse through xml file and identify actors, constraints, principal from the text. However, I am not sure what is the best way to go. An

Re: XML parsing ExpatError with xml.dom.minidom at line 1, column 0

2014-02-13 Thread MRAB
On 2014-02-13 20:10, Peter Otten wrote: ming wrote: Hi, i've a Python script which stopped working about a month ago. But until then, it worked flawlessly for months (if not years). A tiny self-contained 7-line script is provided below. i ran into an XML parsing problem

Re: XML parsing ExpatError with xml.dom.minidom at line 1, column 0

2014-02-13 Thread Peter Otten
ming wrote: > Hi, > i've a Python script which stopped working about a month ago. But until > then, it worked flawlessly for months (if not years). A tiny > self-contained 7-line script is provided below. > > i ran into an XML parsing problem with xml.dom.minidom and

XML parsing ExpatError with xml.dom.minidom at line 1, column 0

2014-02-13 Thread ming
Hi, i've a Python script which stopped working about a month ago. But until then, it worked flawlessly for months (if not years). A tiny self-contained 7-line script is provided below. i ran into an XML parsing problem with xml.dom.minidom and the error message is included below.

xml parsing as YML parser does does

2013-09-24 Thread bab mis
Hi , Here is an example how i do yml parsing and a proper pythonic object returns , is it possible in XML, tried lxml,dom, but there is no straight forward solution: [root@linux-source pyrun]# cat x.yml #Section for specifying test process information Test: commoninfo: buildhome

Re: problems with xml parsing (python 3.3)

2012-10-30 Thread jannidis
If someone comes across this posting with the same problem, the best answer seems to be: avoid Pythons xml.etree.ElementTree and use this library instead: http://lxml.de/ It works like expected and supports xpath much better. -- http://mail.python.org/mailman/listinfo/python-list

Re: problems with xml parsing (python 3.3)

2012-10-29 Thread jannidis
Am Sonntag, 28. Oktober 2012 03:27:14 UTC+1 schrieb jann...@gmail.com: > Hello all, > > > > I am new to Python and have a problem with the behaviour of the xml parser. > Assume we have this xml document: > > > > > > > > > > Title of the first book. > > > >

Re: problems with xml parsing (python 3.3)

2012-10-28 Thread Dieter Maurer
janni...@gmail.com writes: > I am new to Python and have a problem with the behaviour of the xml parser. > Assume we have this xml document: > > > > > Title of the first book. > > > > Title of the second book. > > > > > If I now chec

Re: problems with xml parsing (python 3.3)

2012-10-27 Thread MRAB
On 2012-10-28 02:27, janni...@gmail.com wrote: Hello all, I am new to Python and have a problem with the behaviour of the xml parser. Assume we have this xml document: Title of the first book. Title of the second book. If I no

Re: problems with xml parsing (python 3.3)

2012-10-27 Thread jannidis
To my understanding the empty element is a child of entry as is the text node. Is there anything I am doing wrong here? Any help is appreciated, Fotis -- http://mail.python.org/mailman/listinfo/python-list

problems with xml parsing (python 3.3)

2012-10-27 Thread jannidis
Hello all, I am new to Python and have a problem with the behaviour of the xml parser. Assume we have this xml document: Title of the first book. Title of the second book. If I now check for the text of all 'entry' nodes, the tex

Re: ElementTree XML parsing problem

2011-04-27 Thread Ervin Hegedüs
hello, On Thu, Apr 28, 2011 at 07:57:28AM +0200, Stefan Behnel wrote: > >So, I started change the codepage mark of xml: > > > > - same result > > - same result > > - same result > > You probably changed this in an editor that supports XML and thus > saves the file in the declared encoding. no

Re: ElementTree XML parsing problem

2011-04-27 Thread Stefan Behnel
Hegedüs Ervin, 27.04.2011 21:33: hello, I'm using ElementTree to parse an XML file, but it stops at the second record (id = 002), which contains a non-standard ascii character, ä. Here's the XML: The complaint offered up by the parser is I've checked this xml with your script, I thi

Re: ElementTree XML parsing problem

2011-04-27 Thread Mike
On 4/27/2011 12:24 PM, Neil Cerutti wrote: On 2011-04-27, Mike wrote: I'm using ElementTree to parse an XML file, but it stops at the second record (id = 002), which contains a non-standard ascii character, ?. Here's the XML: The complaint offered up by the parser is Unexpected error

Re: ElementTree XML parsing problem

2011-04-27 Thread Mike
On 4/27/2011 12:33 PM, Hegedüs Ervin wrote: hello, I'm using ElementTree to parse an XML file, but it stops at the second record (id = 002), which contains a non-standard ascii character, ä. Here's the XML: The complaint offered up by the parser is I've checked this xml with your sc

Re: ElementTree XML parsing problem

2011-04-27 Thread Hegedüs Ervin
hello, > I'm using ElementTree to parse an XML file, but it stops at the > second record (id = 002), which contains a non-standard ascii > character, ä. Here's the XML: > > > > > > > > > > > The complaint offered up by the parser is I've checked this xml with your script, I think your l

Re: ElementTree XML parsing problem

2011-04-27 Thread Philip Semanchuk
On Apr 27, 2011, at 2:26 PM, Mike wrote: > I'm using ElementTree to parse an XML file, but it stops at the second record > (id = 002), which contains a non-standard ascii character, ä. Here's the XML: > > > > > > > > > > > The complaint offered up by the parser is > > Unexpected error

Re: ElementTree XML parsing problem

2011-04-27 Thread Neil Cerutti
On 2011-04-27, Mike wrote: > I'm using ElementTree to parse an XML file, but it stops at the > second record (id = 002), which contains a non-standard ascii > character, ?. Here's the XML: > > > > > > > > > > > The complaint offered up by the parser is > > Unexpected error opening simple_fail.xml:

Re: ElementTree XML parsing problem

2011-04-27 Thread Benjamin Kaplan
On Wed, Apr 27, 2011 at 2:26 PM, Mike wrote: > I'm using ElementTree to parse an XML file, but it stops at the second > record (id = 002), which contains a non-standard ascii character, ä. Here's > the XML: > > > > > > > > > > > The complaint offered up by the parser is > > Unexpected erro

ElementTree XML parsing problem

2011-04-27 Thread Mike
I'm using ElementTree to parse an XML file, but it stops at the second record (id = 002), which contains a non-standard ascii character, ä. Here's the XML: The complaint offered up by the parser is Unexpected error opening simple_fail.xml: not well-formed (invalid token): line 5, col

Re: A Unique XML Parsing Problem

2010-10-24 Thread Lawrence D'Oliveiro
In message , Piet van Oostrum wrote: > With xsltproc song.xsl song*.xml you would get your output. > No python necessary. Is that supposed to be some kind of advantage? -- http://mail.python.org/mailman/listinfo/python-list

Re: A Unique XML Parsing Problem

2010-10-24 Thread Piet van Oostrum
Devon writes: > I must quickly and efficiently parse some data contained in multiple > XML files in order to perform some learning algorithms on the data. > Info: > > I have thousands of files, each file corresponds to a single song. > Each XML file contains information extracted from the song (c

Re: A Unique XML Parsing Problem

2010-10-24 Thread Stefan Behnel
out into a CSV file. Any help would be greatly appreciated. Mostly I am looking for a point in the right direction. I have heard about Beautiful Soup but never used it. I am currently reading Dive Into Python's chapters on HTML and XML parsing. That chapter is mostly out of date, and Beaut

Re: A Unique XML Parsing Problem

2010-10-23 Thread Lawrence D'Oliveiro
In message <0af3e9b1-8d3d-4efd-99d6-ca033204e...@n26g2000yqh.googlegroups.com>, Devon wrote: > I have heard about Beautiful Soup but never used it. BeautifulSoup is intended for HTML parsing. It is, or was, particularly good at dealing with badly-formed HTML, as commonly found on lots of websit

Re: A Unique XML Parsing Problem

2010-10-23 Thread Chris Rebert
red in CSV- > like files, with each row being a datapoint, and each column being a > feature. I would like to parse the data out of these XML files and > write them out into a CSV file. Any help would be greatly appreciated. > Mostly I am looking for a point in the right direction. El

A Unique XML Parsing Problem

2010-10-23 Thread Devon
. Mostly I am looking for a point in the right direction. I have heard about Beautiful Soup but never used it. I am currently reading Dive Into Python's chapters on HTML and XML parsing. And I am also more concerned about how to use the tags in the XML files to build feature names so I do not have to

Re: XML parsing: SAX/expat & yield

2010-08-04 Thread kj
In Peter Otten <__pete...@web.de> writes: >How about >http://effbot.org/zone/element-iterparse.htm#incremental-parsing Exactly! Thanks! ~K -- http://mail.python.org/mailman/listinfo/python-list

Re: XML parsing: SAX/expat & yield

2010-08-04 Thread Peter Otten
kj wrote: > I want to write code that parses a file that is far bigger than > the amount of memory I can count on. Therefore, I want to stay as > far away as possible from anything that produces a memory-resident > DOM tree. > > The top-level structure of this xml is very simple: it's just a > v

XML parsing: SAX/expat & yield

2010-08-04 Thread kj
I want to write code that parses a file that is far bigger than the amount of memory I can count on. Therefore, I want to stay as far away as possible from anything that produces a memory-resident DOM tree. The top-level structure of this xml is very simple: it's just a very long list of "reco

Re: What is the recommended library for xml parsing?

2009-08-23 Thread bot
voodoorai2000 on gmail.com has asked me for the current status of our votation.. so here you go: +1 => 1 vote -1 => 0 votes Time Line: -- (2009-08-24 01:25:11) Raimond Garcia: +1 Visit the fancy votation page: * http://letsdecide.us/4130bc4e0051016cb377d3436f4e8e683ed820ed -- http://ma

Re: What is the recommended library for xml parsing?

2009-08-23 Thread Raimond Garcia
+1 ::results:: Cheers, Peter Petrelli On Mon, Aug 24, 2009 at 12:59 AM, Chris Rebert wrote: > On Sun, Aug 23, 2009 at 3:07 PM, Raimond Garcia > wrote: > > Is there a good build in library or should I use a third party one? > > xml.etree.ElementTree: > http://docs.python.org/library/xml.etre

Re: What is the recommended library for xml parsing?

2009-08-23 Thread Chris Rebert
On Sun, Aug 23, 2009 at 3:07 PM, Raimond Garcia wrote: > Is there a good build in library or should I use a third party one? xml.etree.ElementTree: http://docs.python.org/library/xml.etree.elementtree.html Cheers, Chris -- http://blog.rebertia.com -- http://mail.python.org/mailman/listinfo/pytho

What is the recommended library for xml parsing?

2009-08-23 Thread Raimond Garcia
Is there a good build in library or should I use a third party one? Cheers, Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: XML parsing with python

2009-08-18 Thread Stefan Behnel
inder wrote: > Is lxml part of standard python package ? I am having python 2.5 . No, that's why I suggested ElementTree first. > I might not be able to use any additional package other than the > standard python . Could you please suggest something part of standard > python package ? No, there

Re: XML parsing with python

2009-08-18 Thread inder
On Aug 18, 11:24 am, Stefan Behnel wrote: > inder wrote: > > On Aug 17, 8:31 pm, John Posner wrote: > >>> Use the iterparse() function of the xml.etree.ElementTree package. > >>>http://effbot.org/zone/element-iterparse.htm > >>>http://codespeak.net/lxml/parsing.html#iterparse-and-iterwalk > >>> S

Re: XML parsing with python

2009-08-17 Thread Stefan Behnel
John Posner wrote: >> Use the iterparse() function of the xml.etree.ElementTree package. > > iterparse() is too big a hammer for this purpose, IMO. How about this: > > from xml.etree.ElementTree import ElementTree > tree = ElementTree(None, "myfile.xml") > for elem in tree.findall('//book/titl

Re: XML parsing with python

2009-08-17 Thread Stefan Behnel
inder wrote: > On Aug 17, 8:31 pm, John Posner wrote: >>> Use the iterparse() function of the xml.etree.ElementTree package. >>> http://effbot.org/zone/element-iterparse.htm >>> http://codespeak.net/lxml/parsing.html#iterparse-and-iterwalk >>> Stefan >> iterparse() is too big a hammer for this pur

Re: XML parsing with python

2009-08-17 Thread inder
On Aug 17, 8:31 pm, John Posner wrote: > > Use the iterparse() function of the xml.etree.ElementTree package. > > >http://effbot.org/zone/element-iterparse.htm > >http://codespeak.net/lxml/parsing.html#iterparse-and-iterwalk > > > Stefan > > iterparse() is too big a hammer for this purpose, IMO. H

Re: XML parsing with python

2009-08-17 Thread John Posner
Use the iterparse() function of the xml.etree.ElementTree package. http://effbot.org/zone/element-iterparse.htm http://codespeak.net/lxml/parsing.html#iterparse-and-iterwalk Stefan iterparse() is too big a hammer for this purpose, IMO. How about this: from xml.etree.ElementTree import E

Re: XML parsing with python

2009-08-17 Thread Stefan Behnel
inder wrote: > I am new to xml . I need to parse the xml file . After reading and > browsing on the web , I could get much help . > > I guess SAX would be better suited for my requirement . That's a common misconception. > Could some juct provide me a sample python code so that I can execute >

XML parsing with python

2009-08-17 Thread inder
Hi All, I am new to xml . I need to parse the xml file . After reading and browsing on the web , I could get much help . I guess SAX would be better suited for my requirement . Could some juct provide me a sample python code so that I can execute it and see how the parsing actually happens . Le

RE: XML Parsing

2009-02-26 Thread Paul McGuire
riginal Message- From: hrishy [mailto:hris...@yahoo.co.uk] Sent: Wednesday, February 25, 2009 11:36 PM To: python-list@python.org; Paul McGuire Subject: Re: XML Parsing Ha the guru himself responding :-) --- On Wed, 25/2/09, Paul McGuire wrote: > From: Paul McGuire > Subject: Re: XML

Re: XML Parsing

2009-02-25 Thread hrishy
Hi Cliff Thanks so using elementree is the right way to handle this problem regards Hrishy --- On Wed, 25/2/09, J. Clifford Dyer wrote: > From: J. Clifford Dyer > Subject: Re: XML Parsing > To: hris...@yahoo.co.uk > Cc: python-list@python.org, "Lie Ryan" > Dat

Re: XML Parsing

2009-02-25 Thread hrishy
Ha the guru himself responding :-) --- On Wed, 25/2/09, Paul McGuire wrote: > From: Paul McGuire > Subject: Re: XML Parsing > To: python-list@python.org > Date: Wednesday, 25 February, 2009, 2:04 PM > On Feb 25, 1:17 am, hrishy > wrote: > > Hi > > > > Som

Re: XML Parsing

2009-02-25 Thread Paul McGuire
On Feb 25, 1:17 am, hrishy wrote: > Hi > > Something like this > > > Note i am not a python programmer just a enthusiast and i was curious why > people on the list didnt suggest a code like above > You just beat the rest of us to it - good example of ElementTree for parsing XML (and I Iearned t

Re: XML Parsing

2009-02-25 Thread J. Clifford Dyer
er but the question is > why not use xpath to extract xml text from a xml doc ? > > regards > Hrishy > > > --- On Wed, 25/2/09, Lie Ryan wrote: > > > From: Lie Ryan > > Subject: Re: XML Parsing > > To: python-list@python.org > > Date: Wednesday,

Re: XML Parsing

2009-02-25 Thread hrishy
not use xpath to extract xml text from a xml doc ? regards Hrishy --- On Wed, 25/2/09, Lie Ryan wrote: > From: Lie Ryan > Subject: Re: XML Parsing > To: python-list@python.org > Date: Wednesday, 25 February, 2009, 7:33 AM > Are you searching for answer or searching for another peo

Re: XML Parsing

2009-02-24 Thread Lie Ryan
Are you searching for answer or searching for another people that have the same answer as you? :) "Many roads lead to Rome" is a very famous quotation... -- http://mail.python.org/mailman/listinfo/python-list

Re: XML Parsing

2009-02-24 Thread hrishy
Hi Something like this http://mail.python.org/mailman/listinfo/python-list

Re: XML Parsing

2009-02-24 Thread Lie Ryan
On Wed, 2009-02-25 at 06:09 +, hrishy wrote: > Hi > > I am just a python enthusiast and not a python user but was just wundering > why didnt the list members come up with or recommen XPATH based solution > which i think is very elegant for this type of a problem isnt it ? Did you mean XQuer

Re: XML Parsing

2009-02-24 Thread hrishy
yan > Subject: Re: XML Parsing > To: python-list@python.org > Date: Wednesday, 25 February, 2009, 5:43 AM > On Tue, 24 Feb 2009 20:50:20 -0800, Girish wrote: > > > Hello, > > > > I have a xml file which is as follows: > > > > > &g

Re: XML Parsing

2009-02-24 Thread Lie Ryan
On Tue, 24 Feb 2009 20:50:20 -0800, Girish wrote: > Hello, > > I have a xml file which is as follows: > > > > > $ > PID > > > .. > ... > > C

Re: XML Parsing

2009-02-24 Thread alex23
On Feb 25, 2:50 pm, Girish wrote: > Can anyone please tell me how to get content of tag.. that > is, how to extract the data "![CDATA[Parameter Identifiers Supported - > $01 to $20]]" Was there something in particular about Jean-Paul Calderone's solution that didn't satisfy you? http://tinyurl.c

XML Parsing

2009-02-24 Thread Girish
Hello, I have a xml file which is as follows: $ PID .. ... Can anyone please tell me how to get content of tag.. that is, how to extract the

Re: XML Parsing: Expat Error

2008-07-19 Thread Fredrik Lundh
Gerth, William D wrote: Hey all, I’m simply trying to get my feet wet with XML parsing, and I tried to just do something simple with ElementTree, just throw the XML tags from a file into a list. The code is as follows (and may be wrong): ... xml.parsers.expat.ExpatError: no element found

XML Parsing: Expat Error

2008-07-17 Thread Gerth, William D
Hey all, I'm simply trying to get my feet wet with XML parsing, and I tried to just do something simple with ElementTree, just throw the XML tags from a file into a list. The code is as follows (and may be wrong): import glob import xml.etree.ElementTree as ET tree = ET.

Re: XML Parsing

2008-04-01 Thread Gabriel Genellina
En Tue, 01 Apr 2008 20:44:41 -0300, 7stud <[EMAIL PROTECTED]> escribió: >>           I am new to XML parsing.Could you kindly tell me whats the >> problem with the following code: >> >> import xml.dom.minidom >> import xml.parsers.expat > > I don't know if you are aware of the BeautifulSoup modu

Re: XML Parsing

2008-04-01 Thread 7stud
On Apr 1, 1:42 pm, Alok Kothari <[EMAIL PROTECTED]> wrote: > Hello, >           I am new to XML parsing.Could you kindly tell me whats the > problem with the following code: > > import xml.dom.minidom > import xml.parsers.expat > document = """Lettermanis token>betterthan token>JayLeno""" > > # 3 h

Re: XML Parsing

2008-04-01 Thread Jason Scheirer
On Apr 1, 12:42 pm, Alok Kothari <[EMAIL PROTECTED]> wrote: > Hello, > I am new to XML parsing.Could you kindly tell me whats the > problem with the following code: > > import xml.dom.minidom > import xml.parsers.expat > document = """Lettermanis token>betterthan token>JayLeno""" > > # 3

Re: XML Parsing

2008-04-01 Thread Alok Kothari
Thanks ! it worked ! On Wed, Apr 2, 2008 at 1:31 AM, Konstantin Veretennicov < [EMAIL PROTECTED]> wrote: > On Tue, Apr 1, 2008 at 10:42 PM, Alok Kothari <[EMAIL PROTECTED]> > wrote: > > > Hello, > > I am new to XML parsing.Could you kindly tell me whats the > > problem with the following

Re: XML Parsing

2008-04-01 Thread Konstantin Veretennicov
On Tue, Apr 1, 2008 at 10:42 PM, Alok Kothari <[EMAIL PROTECTED]> wrote: > Hello, > I am new to XML parsing.Could you kindly tell me whats the > problem with the following code: > > import xml.dom.minidom > import xml.parsers.expat > document = """Lettermanis token>betterthan token>JayLen

XML Parsing

2008-04-01 Thread Alok Kothari
Hello, I am new to XML parsing.Could you kindly tell me whats the problem with the following code: import xml.dom.minidom import xml.parsers.expat document = """LettermanisbetterthanJayLeno""" # 3 handler functions def start_element(name, attrs): print 'Start element:', name, attr

Latest XML Parsing/Memory benchmark

2008-03-04 Thread jimmy Zhang
The latest benchmark results are now available using the latest Intel Core2 Duo processor. In summary, VTD-XML using JDK 1.6's server JVM achieved an astonishing 120MB/sec sustained throughput per core on a Core2 Duo 2.5 GHz processor. * Parsing Only: http://www.ximpleware.com/2.3/benchmark_2

XML Parsing Help,

2007-06-29 Thread Robert Rawlins - Think Blue
Hello Chaps, I'm looking for some help with XML parsing, I've been playing around with this over the past few days and the only solution I can come up with seems to be a little slow and also leaves what I think is a memory leak in my application, which causes all kinds of problems.

Re: Remote XML Parsing

2007-03-31 Thread Laurent Pointal
[EMAIL PROTECTED] wrote: > On Mar 30, 5:56 pm, Laurent Pointal <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] a écrit : >> >> > How can I parse a remote XML file with Python? >> > And what will I be able to do with this XML file in Python? >> >> > Sorry if this is a noob-ish question. >> >> You c

Re: Remote XML Parsing

2007-03-30 Thread [EMAIL PROTECTED]
On Mar 30, 5:56 pm, Laurent Pointal <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] a écrit : > > > How can I parse a remote XML file with Python? > > And what will I be able to do with this XML file in Python? > > > Sorry if this is a noob-ish question. > > You can process XML data with Python as l

Re: Remote XML Parsing

2007-03-30 Thread Laurent Pointal
[EMAIL PROTECTED] a écrit : > How can I parse a remote XML file with Python? > And what will I be able to do with this XML file in Python? > > Sorry if this is a noob-ish question. You can process XML data with Python as long as you can get it - you will be able to do what you want with it. How

Remote XML Parsing

2007-03-29 Thread [EMAIL PROTECTED]
How can I parse a remote XML file with Python? And what will I be able to do with this XML file in Python? Sorry if this is a noob-ish question. -- http://mail.python.org/mailman/listinfo/python-list

Re: XML Parsing

2007-03-28 Thread Urban, Gabor
HI, I could suggest you to use the minidom xml parser from xml module. Your XML schema does not seem to complocated. You will find detailed descriptions, and working code in the book: Dive ino Python. Google for it :-)) Gabor Urban NMC - ART -- http://mail.python.org/mailman/listinfo/pyth

Re: XML Parsing

2007-03-28 Thread Christian
[EMAIL PROTECTED] wrote: > I want to parse this XML file: > > > > > > > filename > > Hello > > > > > filename2 > > Hello2 > > > > > > This XML will be in a file called filecreate.xml > > As you might have guessed, I want to create files from this XML file > contents, so how can I

Re: XML Parsing

2007-03-28 Thread Diez B. Roggisch
> > The example is valid well-formed XML. It is permitted to use the ":" > character in element names. Whether one should in a non namespace > context is a different matter. It is? I was always under the impression one has to declare a namespace. But this might be shaped from the usage of XSLT an

Re: XML Parsing

2007-03-28 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > I want to parse this XML file: > > > > > > > filename > > Hello > > > > > filename2 > > Hello2 > > > > > > This XML will be in a file called filecreate.xml > > As you might have guessed, I want to create files from this XML file > contents, so how can

Re: XML Parsing

2007-03-28 Thread Laurent Pointal
[EMAIL PROTECTED] a écrit : > I want to parse this XML file: > As you might have guessed, I want to create files from this XML file > contents, so how can I do this? > What modules should I use? What options do I have? Where can I find > tutorials? Will I be able to put > this on the internet (on

Re: XML Parsing

2007-03-28 Thread harvey . thomas
On Mar 28, 10:51 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > I want to parse this XML file: > > > > > > > > > > > filename > > > > Hello > > > > > > > > > filename2 > > > > Hello2 > > > > > > > > > > This XML will be in a file called filecreate.xml >

Re: XML Parsing

2007-03-28 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > I want to parse this XML file: > > > > > > > filename > > Hello > > > > > filename2 > > Hello2 > > > > > > This XML will be in a file called filecreate.xml > > As you might have guessed, I want to create files from this XML file > contents, so how can I

Re: XML Parsing

2007-03-28 Thread Amit Khemka
On 28 Mar 2007 00:38:38 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I want to parse this XML file: > > > > > > > filename > > Hello > > > > > filename2 > > Hello2 > > > > > > This XML will be in a file called filecreate.xml > > As you might have guessed, I want to create files

XML Parsing

2007-03-27 Thread [EMAIL PROTECTED]
I want to parse this XML file: filename Hello filename2 Hello2 This XML will be in a file called filecreate.xml As you might have guessed, I want to create files from this XML file contents, so how can I do this? What modules should I use? What options do I have? Where can I find

Re: How use XML parsing tools on this one specific URL?

2007-03-05 Thread Stefan Behnel
[EMAIL PROTECTED] schrieb: > I understand that the web is full of ill-formed XHTML web pages but > this is Microsoft: > > http://moneycentral.msn.com/companyreport?Symbol=BBBY > > I can't validate it and xml.minidom.dom.parseString won't work on it. Interestingly, no-one mentioned lxml so far:

Re: How use XML parsing tools on this one specific URL?

2007-03-05 Thread Paul Boddie
On 4 Mar, 20:21, Nikita the Spider <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > > > I can't validate it and xml.minidom.dom.parseString won't work on it. [...] > Valid XHTML is scarcer than hen's teeth. It probably doesn't need to be valid: being well-formed would be sufficient

Re: How use XML parsing tools on this one specific URL?

2007-03-05 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > >Chris> http://moneycentral.msn.com/companyreport?Symbol=BBBY > >Chris> I can't validate it and xml.minidom.dom.parseString won't work on >Chris> it. > >Chris> If this was just some teenager's web site I'd move on. Is there >Chris> any hope avoiding r

Re: How use XML parsing tools on this one specific URL?

2007-03-04 Thread Paul McGuire
P.S. Please send me 1% of all the money you make from your automated- stock speculation program. On the other hand, if you lose money with your program, don't bother sending me a bill. -- Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: How use XML parsing tools on this one specific URL?

2007-03-04 Thread Paul McGuire
On Mar 4, 11:42 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I understand that the web is full of ill-formed XHTML web pages but > this is Microsoft: > > http://moneycentral.msn.com/companyreport?Symbol=BBBY > > I can't validate it and xml.minidom.dom.parseString won't work on it. > > If th

Re: How use XML parsing tools on this one specific URL?

2007-03-04 Thread Paul Boddie
[EMAIL PROTECTED] wrote: > I understand that the web is full of ill-formed XHTML web pages but > this is Microsoft: > > http://moneycentral.msn.com/companyreport?Symbol=BBBY Yes, thank you Microsoft! > I can't validate it and xml.minidom.dom.parseString won't work on it. > > If this was just some

Re: How use XML parsing tools on this one specific URL?

2007-03-04 Thread Nikita the Spider
In article <[EMAIL PROTECTED]>, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I understand that the web is full of ill-formed XHTML web pages but > this is Microsoft: > > http://moneycentral.msn.com/companyreport?Symbol=BBBY > > I can't validate it and xml.minidom.dom.parseString won't work

Re: How use XML parsing tools on this one specific URL?

2007-03-04 Thread Jorge Godoy
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > I understand that the web is full of ill-formed XHTML web pages but > this is Microsoft: Yes... And Microsoft is responsible for a lot of the ill-formed pages on the web be it on their website or made by their applications. > > http://moneycentr

Re: How use XML parsing tools on this one specific URL?

2007-03-04 Thread skip
Chris> http://moneycentral.msn.com/companyreport?Symbol=BBBY Chris> I can't validate it and xml.minidom.dom.parseString won't work on Chris> it. Chris> If this was just some teenager's web site I'd move on. Is there Chris> any hope avoiding regular expression hacks to extrac

How use XML parsing tools on this one specific URL?

2007-03-04 Thread [EMAIL PROTECTED]
I understand that the web is full of ill-formed XHTML web pages but this is Microsoft: http://moneycentral.msn.com/companyreport?Symbol=BBBY I can't validate it and xml.minidom.dom.parseString won't work on it. If this was just some teenager's web site I'd move on. Is there any hope avoiding re

Re: XML parsing and writing

2006-08-29 Thread Fredrik Lundh
someone wrote: >> Nice package ElementTree is but sadly it doesn't have a pretty print, >> well, guess I'll have to do it myself, if you have one already can you >> please give it to me? thanks :) http://effbot.python-hosting.com/file/stuff/sandbox/elementlib/indent.py -- http://mail.pytho

Re: XML parsing and writing

2006-08-29 Thread Stefan Behnel
c00i90wn wrote: > Stefan Behnel wrote: >> c00i90wn wrote: >>> Hey, I'm having a problem with the xml.dom.minidom package, I want to >>> generate a simple xml for storing configuration variables, for that >>> purpose I've written the following code, but before pasting it I'll >>> tell you what my pr

Re: XML parsing and writing

2006-08-28 Thread uche . ogbuji
c00i90wn wrote: > Nice package ElementTree is but sadly it doesn't have a pretty print, > well, guess I'll have to do it myself, if you have one already can you > please give it to me? thanks :) FWIW Amara and plain old 4Suite both support pretty-print, canonical XML print and more such options.

Re: XML parsing and writing

2006-08-01 Thread Jim
c00i90wn wrote: On first write of the xml everything goes > as it should but on subsequent writes it starts to add more and more > unneeded newlines to it making it hard to read and ugly. Pretty make it pretty by putting in newlines (and spaces) that are not in the original data. That is, if you

Re: XML parsing and writing

2006-07-31 Thread c00i90wn
Nice package ElementTree is but sadly it doesn't have a pretty print, well, guess I'll have to do it myself, if you have one already can you please give it to me? thanks :) Stefan Behnel wrote: > c00i90wn wrote: > > Hey, I'm having a problem with the xml.dom.minidom package, I want to > > generate

Re: XML parsing and writing

2006-07-31 Thread Stefan Behnel
c00i90wn wrote: > Hey, I'm having a problem with the xml.dom.minidom package, I want to > generate a simple xml for storing configuration variables, for that > purpose I've written the following code, but before pasting it I'll > tell you what my problem is. On first write of the xml everything goe

  1   2   >