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 =

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:

Re: XML Parsing

2015-04-05 Thread Ben Finney
Sepideh Ghanavati sepideh...@gmail.com 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

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. However, I am

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 included

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

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 very

Re: XML parsing: SAX/expat yield

2010-08-04 Thread kj
In i3c7lc$e6v$0...@news.t-online.com 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 with python

2009-08-18 Thread Stefan Behnel
inder wrote: On Aug 17, 8:31 pm, John Posner jjpos...@optimum.net 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

Re: XML parsing with python

2009-08-18 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/title'):

Re: XML parsing with python

2009-08-18 Thread inder
On Aug 18, 11:24 am, Stefan Behnel stefan...@behnel.de wrote: inder wrote: On Aug 17, 8:31 pm, John Posner jjpos...@optimum.net wrote: Use the iterparse() function of the xml.etree.ElementTree package. http://effbot.org/zone/element-iterparse.htm

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-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 it

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

Re: XML parsing with python

2009-08-17 Thread inder
On Aug 17, 8:31 pm, John Posner jjpos...@optimum.net 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

RE: XML Parsing

2009-02-26 Thread Paul McGuire
- 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 pt...@austin.rr.com wrote: From: Paul McGuire pt...@austin.rr.com

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 lie.1...@gmail.com wrote: From: Lie Ryan lie.1...@gmail.com Subject: Re: XML Parsing To: python-list@python.org Date: Wednesday, 25 February, 2009, 7:33 AM Are you searching for answer or searching

Re: XML Parsing

2009-02-25 Thread J. Clifford Dyer
xpath to extract xml text from a xml doc ? regards Hrishy --- On Wed, 25/2/09, Lie Ryan lie.1...@gmail.com wrote: From: Lie Ryan lie.1...@gmail.com Subject: Re: XML Parsing To: python-list@python.org Date: Wednesday, 25 February, 2009, 7:33 AM Are you searching for answer

Re: XML Parsing

2009-02-25 Thread Paul McGuire
On Feb 25, 1:17 am, hrishy hris...@yahoo.co.uk wrote: Hi Something like this snip solution using ElementTree 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

Re: XML Parsing

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

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 j...@sdf.lonestar.org wrote: From: J. Clifford Dyer j...@sdf.lonestar.org Subject: Re: XML Parsing To: hris...@yahoo.co.uk Cc: python-list@python.org, Lie Ryan

Re: XML Parsing

2009-02-24 Thread alex23
On Feb 25, 2:50 pm, Girish girish@gmail.com wrote: Can anyone please tell me how to get content of Signal 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

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: pids Parameter_Class Parameter Id=pid_031605_093137_283 Identifier$/Identifier TypePID/Type

Re: XML Parsing

2009-02-24 Thread hrishy
: From: Lie Ryan lie.1...@gmail.com 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: pids Parameter_Class

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 XQuery?

Re: XML Parsing

2009-02-24 Thread hrishy
Hi Something like this pids Parameter_Class ParameterId=pid_031605_093137_283 Identifier$/Identifier TypePID/Type Signal![CDATA[Parameter Identifiers Supported - $01 to $20]]/Signal Description![CDATA[This PID indicates which

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

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 = token pos=nnLetterman/tokentoken pos=bezis/

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 code:

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 = token pos=nnLetterman/tokentoken pos=bezis/ tokentoken

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 = token pos=nnLetterman/tokentoken pos=bezis/ tokentoken

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 module: Or

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: ?xml version=1.0 ? text text:one filefilename/file contents Hello /contents /text:one text:two filefilename2/file contents Hello2 /contents /text:two /text This XML will

Re: XML Parsing

2007-03-28 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: I want to parse this XML file: ?xml version=1.0 ? text text:one filefilename/file contents Hello /contents /text:one text:two filefilename2/file contents Hello2 /contents /text:two /text This XML will be in a file called filecreate.xml As

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: ?xml version=1.0 ? text text:one filefilename/file contents Hello /contents /text:one text:two filefilename2/file contents Hello2 /contents

Re: XML Parsing

2007-03-28 Thread Laurent Pointal
[EMAIL PROTECTED] a écrit : I want to parse this XML file: zip 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 a

Re: XML Parsing

2007-03-28 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : I want to parse this XML file: ?xml version=1.0 ? text text:one filefilename/file contents Hello /contents /text:one text:two filefilename2/file contents Hello2 /contents /text:two /text This XML will be in a file called filecreate.xml As

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 and W3C

Re: XML Parsing

2007-03-28 Thread Christian
[EMAIL PROTECTED] wrote: I want to parse this XML file: ?xml version=1.0 ? text text:one filefilename/file contents Hello /contents /text:one text:two filefilename2/file contents Hello2 /contents /text:two /text This XML will be in a file called filecreate.xml As

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 --

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 problem is. On

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 /F --

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 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 goes

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 a

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: Dbtag Dbtag_dbUCSC/Dbtag_db Dbtag_tag Object-id

Re: XML parsing per record

2005-04-22 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 only need

Re: XML parsing per record

2005-04-22 Thread Willem Ligtenberg
This is all the info I need from the xml file: ID -- Gene-track_geneid320632/Gene-track_geneid Name --Gene-ref Gene-ref_locusPzp/Gene-ref_locus Startbase -- Gene-commentary_seqs Seq-loc Seq-loc_int Seq-interval

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: Prot-ref_name_EATP-binding cassette, subfamily G, member 1/Prot-ref_name_E Prot-ref_name_EATP-binding cassette

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 Element 'Prot-ref_name_E' at 0xb7d10cf8 function Element 'Prot-ref_name_E' at 0xb7d10d10 But ofcourse I want the information in there... On Fri, 22 Apr 2005

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: Prot-ref_name_EATP-binding cassette, subfamily G, member 1/Prot-ref_name_E

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,

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 Element 'Prot-ref_name_E' at 0xb7d10cf8 function Element 'Prot-ref_name_E' at 0xb7d10d10 But ofcourse I want the information in there... for x in

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-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 (2.4 gig)

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 http://effbot.org/zone/celementtree.htm. -- Cheers, Simon

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

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 work here

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 a

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

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

Re: XML parsing per record

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

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

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

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 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

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

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 any

Re: xml parsing escape characters

2005-01-21 Thread Martin v. Lwis
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 --

Re: xml parsing escape characters

2005-01-20 Thread Luis P. Mendes
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 this is the xml document: ?xml version=1.0 encoding=utf-8? string xmlns=http://www..;lt;DataSetgt; ~ lt;Ordergt; ~ lt;Customergt;439lt;/Customergt; (... others ...) ~ lt;/Ordergt; lt;/DataSetgt;/string When I do: print

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: ?xml version=1.0 encoding=utf-8? string xmlns=http://www..;lt;DataSetgt; ~ lt;Ordergt; ~ lt;Customergt;439lt;/Customergt; (... others ...) ~ lt;/Ordergt; lt;/DataSetgt;/string This is an

Re: xml parsing escape characters

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

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, string, whose content is text containing entity-escaped XML. This is *not* an XML document containing tags DataSet, Order, Customer, etc. All the behaviour you are seeing is a consequence of this.

Re: xml parsing escape characters

2005-01-20 Thread Martin v. Lwis
Luis P. Mendes wrote: with:DataSetNode = stringNode.childNodes[0] print DataSetNode.toxml() I get: lt;DataSetgt; ~ lt;Ordergt; ~lt;Customergt;439lt;/Customergt; ~ lt;/Ordergt; lt;/DataSetgt; ___- so far so good, but when I

Re: xml parsing escape characters

2005-01-20 Thread Martin v. Lwis
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 lt; and gt;. The XML parser unescapes that as and . However, it does not

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 lt; and gt;. The XML parser unescapes that as

Re: xml parsing escape characters

2005-01-20 Thread Martin v. Lwis
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 lt; and gt;. 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 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: ?xml version=1.0 encoding=utf-8? string xmlns=httplt;DataSetgt;

Re: xml parsing escape characters

2005-01-20 Thread Martin v. Lwis
Luis P. Mendes wrote: When I access the url via the Firefox browser and look into the source code, I also get: ?xml version=1.0 encoding=utf-8? string xmlns=httplt;DataSetgt; ~ lt;Ordergt; ~lt;Customergt;439lt;/Customergt; ~ lt;/Ordergt; lt;/DataSetgt;/string Please do try to

Re: xml parsing escape characters

2005-01-20 Thread Jeremy Bowers
On Thu, 20 Jan 2005 21:54:30 +0100, Martin v. Lwis wrote: Luis P. Mendes wrote: When I access the url via the Firefox browser and look into the source code, I also get: ?xml version=1.0 encoding=utf-8? string xmlns=httplt;DataSetgt; ~ lt;Ordergt; ~

Re: xml parsing escape characters

2005-01-19 Thread Martin v. Lwis
Luis P. Mendes wrote: I get the following result: ?xml version=1.0 encoding=utf-8? string xmlns=http://www..;lt;DataSetgt; ~ lt;Ordergt; Most likely, this result is correct, and your document really does contain lt;Ordergt; I don't get any elements. But, if I access the same url via a