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"

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

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

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 with xml.dom.minido

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 the error > message is in

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

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 >

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

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:

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

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

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

Re: XML parsing per record

2005-04-23 Thread Kent Johnson
Willem Ligtenberg wrote: Is there an easy way, to couple data together. Because I have discoverd an irritating feature in the xml file. Sometimes this is a database reference: UCSC 1234 And sometimes: UCS

Re: XML parsing per record

2005-04-22 Thread Fredrik Lundh
Willem Ligtenberg wrote: By the way, I know about findall, but when I iterate thruogh it like: for x in function: print 'function', x I get: function function But ofcourse I want the information in there... for x in function: print 'function', x.text -- http://mail.python.org/mailman/l

Re: XML parsing per record

2005-04-22 Thread Willem Ligtenberg
As you can read in the other post of mine, my problem was with the iterating through the list. didn't know that you should do. e.text. I did only print e, not print e.text Did read documentation, but must admit not everything. Anyway, thank you very much! On Fri, 22 Apr 2005 15:47:08 +0200, Fredr

Re: XML parsing per record

2005-04-22 Thread Fredrik Lundh
Willem Ligtenberg wrote: As I'm trying to write the code using cElementTree. I stumble across one problem. Sometimes there are multiple values to retrieve from one record for the same element. Like this: ATP-binding cassette, subfamily G, member 1 ATP-binding cassette 8 How do you get not only the

Re: XML parsing per record

2005-04-22 Thread Willem Ligtenberg
By the way, I know about findall, but when I iterate thruogh it like: for x in function: print 'function', x I get: function function But ofcourse I want the information in there... On Fri, 22 Apr 2005 15:22:17 +0200, Willem Ligtenberg wrote: > As I'm trying to write the code using cE

Re: XML parsing per record

2005-04-22 Thread Willem Ligtenberg
As I'm trying to write the code using cElementTree. I stumble across one problem. Sometimes there are multiple values to retrieve from one record for the same element. Like this: ATP-binding cassette, subfamily G, member 1 ATP-binding cassette 8 How do you get not only the first, but the rest as w

Re: XML parsing per record

2005-04-22 Thread Willem Ligtenberg
This is all the info I need from the xml file: ID --> 320632 Name --> Pzp Startbase --> 126957426 126989473 51860

Re: XML parsing per record

2005-04-21 Thread William Park
Willem Ligtenberg <[EMAIL PROTECTED]> wrote: > On Sun, 17 Apr 2005 02:16:04 +, William Park wrote: > > Care to post more details? > > The XML file I need to parse contains information about genes. > So the first element is a gene and then there are a lot sub-elements with > sub-elements. I onl

Re: XML parsing per record

2005-04-21 Thread Paul McGuire
Don't assume that just because you have a 2.4G XML file that you have 2.4G of data. Looking at these verbose tags, plus the fact that the XML is pretty-printed (all those leading spaces - not even tabs! - add up), I'm guessing you only have about 5-10% actual data, and the rest is just XML tagging

Re: XML parsing per record

2005-04-21 Thread Simon Brunning
On 4/21/05, Willem Ligtenberg <[EMAIL PROTECTED]> wrote: > Sorry I just decided that I want to use your solution, but I am wondering > is cElemenTree in expat or is that something different? Nope, cElemenTree is very much its own man. See . -- Cheers, Si

Re: XML parsing per record

2005-04-21 Thread Willem Ligtenberg
Sorry I just decided that I want to use your solution, but I am wondering is cElemenTree in expat or is that something different? On Wed, 20 Apr 2005 08:03:00 -0400, Kent Johnson wrote: > Willem Ligtenberg wrote: >>>Willem Ligtenberg <[EMAIL PROTECTED]> wrote: >>> I want to parse a very large

Re: XML parsing per record

2005-04-21 Thread Willem Ligtenberg
I'll first try it using SAX, because I want to have as little dependancies as possible. I already have BioPython as a dependancy. And I personally don't like to install lot's of packages for a program to work. So I don't want to impose that on other people. But thanks anyway and I might go for the

Re: XML parsing per record

2005-04-20 Thread Kent Johnson
Willem Ligtenberg wrote: Willem Ligtenberg <[EMAIL PROTECTED]> wrote: I want to parse a very large (2.4 gig) XML file (bioinformatics ofcourse :)) But I have no clue how to do that. Most things I see read the entire xml file at once. That isn't going to work here ofcourse. So I would like to parse

Re: XML parsing per record

2005-04-20 Thread Willem Ligtenberg
On Sun, 17 Apr 2005 02:16:04 +, William Park wrote: > Willem Ligtenberg <[EMAIL PROTECTED]> wrote: >> I want to parse a very large (2.4 gig) XML file (bioinformatics >> ofcourse :)) But I have no clue how to do that. Most things I see read >> the entire xml file at once. That isn't going to wo

Re: XML parsing per record

2005-04-17 Thread Fredrik Lundh
William Park wrote: You may want to try Expat (www.libexpat.org) or Python wrapper to it. Python comes with a low-level expat wrapper (pyexpat). however, if you want performance, cElementTree (which also uses expat) is a lot faster than pyexpat. (see my other post for links to benchmarks and code)

Re: XML parsing per record

2005-04-16 Thread William Park
Willem Ligtenberg <[EMAIL PROTECTED]> wrote: > I want to parse a very large (2.4 gig) XML file (bioinformatics > ofcourse :)) But I have no clue how to do that. Most things I see read > the entire xml file at once. That isn't going to work here ofcourse. > > So I would like to parse a XML file one

Re: XML parsing per record

2005-04-16 Thread Fredrik Lundh
Kent Johnson wrote: So I would like to parse a XML file one record at a time and then be able to store the information in another object. You might be interested in this recipe using ElementTree: http://online.effbot.org/2004_12_01_archive.htm#element-generator if you have ElementTree 1.2.5 or late

Re: XML parsing per record

2005-04-16 Thread Kent Johnson
Willem Ligtenberg wrote: I want to parse a very large (2.4 gig) XML file (bioinformatics ofcourse :)) But I have no clue how to do that. Most things I see read the entire xml file at once. That isn't going to work here ofcourse. So I would like to parse a XML file one record at a time and then be a

Re: XML parsing per record

2005-04-16 Thread Ivan Voras
Irmen de Jong wrote: XML is not known for its efficiency Surely you are blaspheming, sir! XML's the greatest thing since peanut butter! I'm just *waiting* for the day someone finds its use on the rolls of toilet paper... oh the glorious day... -- http://mail.python.org/mailman/listinfo/py

Re: XML parsing per record

2005-04-16 Thread Irmen de Jong
Willem Ligtenberg wrote: I want to parse a very large (2.4 gig) XML file (bioinformatics ofcourse :)) But I have no clue how to do that. Most things I see read the entire xml file at once. That isn't going to work here ofcourse. So I would like to parse a XML file one record at a time and then be a

Re: xml parsing escape characters

2005-01-21 Thread "Martin v. LÃwis"
Luis P. Mendes wrote: From your experience, do you think that if this wrong XML code could be meant to be read only by somekind of Microsoft parser, the error will not occur? This is very unlikely. MSXML would never do this incorrectly. Regards, Martin -- http://mail.python.org/mailman/listinfo/py

Re: xml parsing escape characters

2005-01-21 Thread Fredrik Lundh
Luis P. Mendes wrote: > xml producer writes the code in Windows platform and 'thinks' that every > client will read/parse the code with a specific Windows parser. Could > that (wrong) XML code parse correctly in that kind of specific Windows > client? not if it's an XML parser. > Do you know an

Re: xml parsing escape characters

2005-01-21 Thread Luis P. Mendes
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 ~From your experience, do you think that if this wrong XML code could be meant to be read only by somekind of Microsoft parser, the error will not occur? I'll try to explain: xml producer writes the code in Windows platform and 'thinks' that every clie

Re: xml parsing escape characters

2005-01-21 Thread Luis P. Mendes
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 ~From your experience, do you think that if this wrong XML code could be meant to be read only by somekind of Microsoft parser, the error will not occur? I'll try to explain: xml producer writes the code in Windows platform and 'thinks' that every clie

Re: xml parsing escape characters

2005-01-20 Thread Jeremy Bowers
On Thu, 20 Jan 2005 21:54:30 +0100, Martin v. LÃwis wrote: > Luis P. Mendes wrote: >> When I access the url via the Firefox browser and look into the source >> code, I also get: >> >> > xmlns="http"> ~ >> ~439 ~ >> >

Re: xml parsing escape characters

2005-01-20 Thread "Martin v. Löwis"
Luis P. Mendes wrote: When I access the url via the Firefox browser and look into the source code, I also get: ~ ~439 ~ Please do try to understand what you are seeing. This is crucial for understanding what happens. You may have the

Re: xml parsing escape characters

2005-01-20 Thread Luis P. Mendes
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I would like to thank everyone for your answers, but I'm not seeing the light yet! When I access the url via the Firefox browser and look into the source code, I also get: ~ ~439 ~ should

Re: xml parsing escape characters

2005-01-20 Thread "Martin v. Löwis"
Irmen de Jong wrote: Usually, but not in this case. If you have a text that looks like XML, and you want to put it into an XML element, the XML file uses < and >. The XML parser unescapes that as < and >. However, it does not then consider the < and > as markup, and it shouldn't. That's also what

Re: xml parsing escape characters

2005-01-20 Thread Irmen de Jong
Martin v. Löwis wrote: Irmen de Jong wrote: The unescaping is usually done for you by the xml parser that you use. Usually, but not in this case. If you have a text that looks like XML, and you want to put it into an XML element, the XML file uses < and >. The XML parser unescapes that as < and >.

Re: xml parsing escape characters

2005-01-20 Thread "Martin v. Löwis"
Irmen de Jong wrote: The unescaping is usually done for you by the xml parser that you use. Usually, but not in this case. If you have a text that looks like XML, and you want to put it into an XML element, the XML file uses < and >. The XML parser unescapes that as < and >. However, it does not th

Re: xml parsing escape characters

2005-01-20 Thread "Martin v. Löwis"
Luis P. Mendes wrote: with:DataSetNode = stringNode.childNodes[0] print DataSetNode.toxml() I get: ~ ~439 ~ ___- so far so good, but when I issue the command: print D

Re: xml parsing escape characters

2005-01-20 Thread Kent Johnson
Irmen de Jong wrote: Kent Johnson wrote: [...] This is an XML document containing a single tag, , whose content is text containing entity-escaped XML. This is *not* an XML document containing tags , , , etc. All the behaviour you are seeing is a consequence of this. You need to unescape the co

Re: xml parsing escape characters

2005-01-20 Thread Irmen de Jong
Kent Johnson wrote: [...] This is an XML document containing a single tag, , whose content is text containing entity-escaped XML. This is *not* an XML document containing tags , , , etc. All the behaviour you are seeing is a consequence of this. You need to unescape the contents of the tag to

Re: xml parsing escape characters

2005-01-20 Thread Kent Johnson
Luis P. Mendes wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 this is the xml document: http://www..";> ~ ~ 439 (... others ...) ~ This is an XML document containing a single tag, , whose content is text containing en

Re: xml parsing escape characters

2005-01-20 Thread Luis P. Mendes
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 this is the xml document: http://www..";> ~ ~ 439 (... others ...) ~ When I do: print xmldoc.toxml() it prints: http://www...";> ~ ~439

Re: xml parsing escape characters

2005-01-19 Thread "Martin v. Löwis"
Luis P. Mendes wrote: I get the following result: http://www..";> ~ Most likely, this result is correct, and your document really does contain I don't get any elements. But, if I access the same url via a browser, the result in the browser window is something like