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

xml parsing escape characters

2005-01-19 Thread Luis P. Mendes
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, I only know a little bit of xml and I'm trying to parse a xml document in order to save its elements in a file (dictionaries inside a list). When I access a url from python 2.3.3 running in Linux with the following lines: resposta =

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