From jyllyj at gcom-cn.com Tue Jul 1 14:13:45 2003 From: jyllyj at gcom-cn.com (pita) Date: Tue Jul 1 01:14:25 2003 Subject: [XML-SIG] how to get xml parse with non ascii charset Message-ID: <002601c33f8f$8c8474f0$fc4ea8c0@pita> i had installed the CJKCodec package correctly. in python shell >>> import codecs >>> codecs.lookup('gb2312') (, , , ) >>> >>> t='大家好' #some gb2312 char >>> ut=t.decode('gb2312') >>> print ut 大家好 #looks fine in my computer >>> utf8str=ut.encode(utf-8) >>> but i can't use the gb2312 in xml document i.e: str_gb2312=""" this is a children. this is other children. """ print 'parse str with encoding gb2312' dom=minidom.parseString(str_gb2312) error here: Traceback (most recent call last): File "E:\temp\xmlparse_gb2312.py", line 50, in ? dom=minidom.parseString(str_gb2312) File "C:\Python23\lib\xml\dom\minidom.py", line 1925, in parseString return expatbuilder.parseString(string) File "C:\Python23\lib\xml\dom\expatbuilder.py", line 940, in parseString return builder.parseString(string) File "C:\Python23\lib\xml\dom\expatbuilder.py", line 223, in parseString parser.Parse(string, True) xml.parsers.expat.ExpatError: unknown encoding: line 1, column 30 >>>You need to download and install the CJKCodec package I mentioned >>>in an earlier mail on this list: >>> http://sourceforge.net/project/showfiles.php?group_id=46747 >>>For more info: >>> http://mail.python.org/pipermail/i18n-sig/2003-June/001586.html From jyllyj at gcom-cn.com Tue Jul 1 14:17:45 2003 From: jyllyj at gcom-cn.com (pita) Date: Tue Jul 1 01:18:33 2003 Subject: [XML-SIG] how to get xml parse with non ascii charset Message-ID: <003d01c33f90$20860380$fc4ea8c0@pita> i had installed the CJKCodec package correctly. in python shell >>> import codecs >>> codecs.lookup('gb2312') (, , , ) >>> >>> t='大家好' #some gb2312 char >>> ut=t.decode('gb2312') >>> print ut 大家好 #looks fine in my computer >>> utf8str=ut.encode(utf-8) >>> but i can't use the gb2312 in xml document i.e: str_gb2312=""" this is a children. this is other children. """ print 'parse str with encoding gb2312' dom=minidom.parseString(str_gb2312) error here: Traceback (most recent call last): File "E:\temp\xmlparse_gb2312.py", line 50, in ? dom=minidom.parseString(str_gb2312) File "C:\Python23\lib\xml\dom\minidom.py", line 1925, in parseString return expatbuilder.parseString(string) File "C:\Python23\lib\xml\dom\expatbuilder.py", line 940, in parseString return builder.parseString(string) File "C:\Python23\lib\xml\dom\expatbuilder.py", line 223, in parseString parser.Parse(string, True) xml.parsers.expat.ExpatError: unknown encoding: line 1, column 30 >>>You need to download and install the CJKCodec package I mentioned >>>in an earlier mail on this list: >>> http://sourceforge.net/project/showfiles.php?group_id=46747 >>>For more info: >>> http://mail.python.org/pipermail/i18n-sig/2003-June/001586.html From uche.ogbuji at fourthought.com Wed Jul 2 08:37:19 2003 From: uche.ogbuji at fourthought.com (Uche Ogbuji) Date: Wed Jul 2 03:37:20 2003 Subject: [XML-SIG] ANN: 4Suite 1.0a2 Message-ID: <1057131124.1696.23.camel@localhost.localdomain> Today we release of 1.0 alpha 2, now available from Sourceforge and ftp.4suite.org. 4Suite is a comprehensive platform for XML and RDF processing, with base libraries and a server framework. It is implemented in Python and C, and provides Python and XSLT APIs, Web and command line interfaces. For general information, see: http://4suite.org http://uche.ogbuji.net/tech/4Suite/ http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/pyxml-akara For the files, see: ftp://ftp.4suite.org/pub/4Suite/ Sources: ftp://ftp.4suite.org/pub/4Suite/4Suite-1.0a2.tar.gz Windows installer: ftp://ftp.4suite.org/pub/4Suite/4Suite-1.0a2.win32-py2.1.exe ftp://ftp.4suite.org/pub/4Suite/4Suite-1.0a2.win32-py2.2.exe ftp://ftp.4suite.org/pub/4Suite/4Suite-1.0a2.win32-py2.3.exe Windows zip: ftp://ftp.4suite.org/pub/4Suite/4Suite-1.0a2.zip You can also get the files on Sourceforge: https://sourceforge.net/projects/foursuite/ https://sourceforge.net/project/showfiles.php?group_id=39954 IMPORTANT alpha release notes ----------------------------- If you have built a 4Suite repository using an older version of 4Suite, you will probably have to make adjustments for this new release. If you used 0.12.0a3, or a more recent version, then it should suffice to recompile all stylesheets for each repository instance: 4ss_manager recompile In any case, see the following document for more details: http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/backup There has been some progress with builds on Mac OS X in this release. See http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/osx Please offer any suggestions on the mailing list. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com XML Data Bindings in Python - http://www.xml.com/pub/a/2003/06/11/py-xml.html Introducing Examplotron - http://www-106.ibm.com/developerworks/xml/library/x-xmptron/ Charming Jython - http://www-106.ibm.com/developerworks/java/library/j-jython.html The commons of creativity - http://www-106.ibm.com/developerworks/xml/library/x-think18.html A custom-fit career in app development - http://www.adtmag.com/article.asp?id=7744 From noreply at sourceforge.net Thu Jul 3 05:18:55 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Jul 3 07:18:58 2003 Subject: [XML-SIG] [ pyxml-Bugs-765249 ] Problems building PyXML 0.8.2 on MacOSX 10.2.6 Message-ID: Bugs item #765249, was opened at 2003-07-03 13:18 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=106473&aid=765249&group_id=6473 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: David Kaasen (davidkaasen) Assigned to: Nobody/Anonymous (nobody) Summary: Problems building PyXML 0.8.2 on MacOSX 10.2.6 Initial Comment: Having fixed the bug reported 2003-01-30 by brianl ("0.8.2 setup.py errors on OS X") the build of PyXML 0.8.2 complains about "-arch i386" when using the Python that is distributed with MacOSX 10.2.6. It turns out that there is an error in LDFLAGS in /usr/lib/python2.2/config/Makefile, so changing "LDFLAGS= -arch i386 -arch ppc" to "LDFLAGS= -arch ppc" solves this bug. Building PyXML when using the Python installed with Fink (http://fink.sourceforge.net/) also gives an error, not the one mentioned above, but one regarding the included Expat library. I have reported this bug to the Expat project (http://sourceforge.net/tracker/index.php?func=detail&aid=765227&group_id=10127&atid=110127). Regards, David Kaasen. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=106473&aid=765249&group_id=6473 From uche.ogbuji at fourthought.com Fri Jul 4 06:41:57 2003 From: uche.ogbuji at fourthought.com (Uche Ogbuji) Date: Fri Jul 4 01:41:59 2003 Subject: [XML-SIG] ANN: 4Suite 1.0a3 Message-ID: <1057296898.5608.9.camel@localhost.localdomain> Today we release 1.0 alpha 3, now available from Sourceforge and ftp.4suite.org. 1.0a3 replaces the last release, 1.0a2, which had some files missing, and has been withdrawn. 4Suite is a comprehensive platform for XML and RDF processing, with base libraries and a server framework. It is implemented in Python and C, and provides Python and XSLT APIs, Web and command line interfaces. For general information, see: http://4suite.org http://uche.ogbuji.net/tech/4Suite/ http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/pyxml-akara For the files, see: ftp://ftp.4suite.org/pub/4Suite/ Sources: ftp://ftp.4suite.org/pub/4Suite/4Suite-1.0a3.tar.gz Windows installer: ftp://ftp.4suite.org/pub/4Suite/4Suite-1.0a3.win32-py2.1.exe ftp://ftp.4suite.org/pub/4Suite/4Suite-1.0a3.win32-py2.2.exe ftp://ftp.4suite.org/pub/4Suite/4Suite-1.0a3.win32-py2.3.exe Windows zip: ftp://ftp.4suite.org/pub/4Suite/4Suite-1.0a3.zip You can also get the files on Sourceforge: https://sourceforge.net/projects/foursuite/ https://sourceforge.net/project/showfiles.php?group_id=39954 IMPORTANT alpha release notes ----------------------------- If you have built a 4Suite repository using an older version of 4Suite, you will probably have to make adjustments for this new release. If you used 0.12.0a3, or a more recent version, then it should suffice to recompile all stylesheets for each repository instance: 4ss_manager recompile In any case, see the following document for more details: http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/backup There has been some progress with builds on Mac OS X in this release. See http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/osx Please offer any suggestions on the mailing list. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com XML Data Bindings in Python, Part 2 - http://www.xml.com/pub/a/2003/07/02/py-xml.html Introducing Examplotron - http://www-106.ibm.com/developerworks/xml/library/x-xmptron/ Charming Jython - http://www-106.ibm.com/developerworks/java/library/j-jython.html Python, Web services, and XSLT - http://www-106.ibm.com/developerworks/xml/library/ws-pyth13/ A custom-fit career in app development - http://www.adtmag.com/article.asp?id=7744 From dieter at handshake.de Fri Jul 4 21:53:27 2003 From: dieter at handshake.de (Dieter Maurer) Date: Fri Jul 4 17:13:58 2003 Subject: [XML-SIG] how to get xml parse with non ascii charset In-Reply-To: <002601c33f8f$8c8474f0$fc4ea8c0@pita> References: <002601c33f8f$8c8474f0$fc4ea8c0@pita> Message-ID: <16133.52519.697584.430463@gargle.gargle.HOWL> pita wrote at 2003-7-1 13:13 +0800: > ... > str_gb2312=""" > > > this is a children. > > > this is other children. > > > """ > print 'parse str with encoding gb2312' > dom=minidom.parseString(str_gb2312) > ... > File "C:\Python23\lib\xml\dom\expatbuilder.py", line 223, in parseString > parser.Parse(string, True) > xml.parsers.expat.ExpatError: unknown encoding: line 1, column 30 XML processing systems (such as the parser "Expat") are only required to support UTF-8 (and maybe UTF-16) encodings. All other encodings are optional. Apparently, "Expat" does not support "gb2312". A work around would be to convert your string first to unicode and then to UTF-8. Dieter From martin at v.loewis.de Sat Jul 5 09:35:21 2003 From: martin at v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: Sat Jul 5 04:35:22 2003 Subject: [XML-SIG] how to get xml parse with non ascii charset In-Reply-To: <16133.52519.697584.430463@gargle.gargle.HOWL> References: <002601c33f8f$8c8474f0$fc4ea8c0@pita> <16133.52519.697584.430463@gargle.gargle.HOWL> Message-ID: Dieter Maurer writes: > XML processing systems (such as the parser "Expat") are only required > to support UTF-8 (and maybe UTF-16) encodings. All other > encodings are optional. > > Apparently, "Expat" does not support "gb2312". Correct. pyexpat only supports single-byte encodings, and UTF-8. If you want to use other encodings with PyXML, you will have to use xmlproc. Regards, Martin From noreply at sourceforge.net Mon Jul 7 07:28:31 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Jul 7 09:28:34 2003 Subject: [XML-SIG] [ pyxml-Bugs-767130 ] Invalid charset breaks installation with Python 2.3(beta) Message-ID: Bugs item #767130, was opened at 2003-07-07 13:28 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=106473&aid=767130&group_id=6473 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Thorstein Thorsteinsson (thorstein) Assigned to: Nobody/Anonymous (nobody) Summary: Invalid charset breaks installation with Python 2.3(beta) Initial Comment: The file ./site-packages/_xmlplus/dom/en_US/LC_MESSAGES/4Suite.mo contains the setting "charset=CHARSET". This looks suspicious, and also leads to the following test failures (test/regrtest.py): test test_c14n crashed -- exceptions.LookupError : unknown encoding: CHARSET test test_dom crashed -- exceptions.NameError : global name 'DOMExceptionStrings' is not defined test test_minidom failed -- Writing: 'Test Failed: ', expected: '' ... 16 tests OK. 3 tests failed: test_c14n test_dom test_minidom Replacing "CHARSET" by "iso-8859-1" in the above line resurrects the failing tests. As explained in the title, I'm using the very latest Python release: > python Python 2.3b2 (#1, Jul 7 2003, 11:49:45) [GCC 3.2.2 (Mandrake Linux 9.1 3.2.2-3mdk)] on linux2 Type "help", "copyright", "credits" or "license" for more information. > With the latest version of PyXML (-0.8.2), (a vanilla "python setup.py build install" installation). Thorstein PS. I have not tested the other localizations, but the German localization file seems to have the correct charset setting, while the French one omits such a specification. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=106473&aid=767130&group_id=6473 From janet at tppinternet.com Mon Jul 14 07:04:26 2003 From: janet at tppinternet.com (Janet) Date: Mon Jul 14 02:04:28 2003 Subject: [XML-SIG] DTD help Message-ID: <1058162362.7776.48.camel@max> Hi, I've got some understanding about processing XML with Python, which has already allowed me to develop an application. However, I didn't manage to find a way to link what I did with the DTD. My application works very well, but just because I created classes for generating & parsing each particular XML entity. Is that the way it is? I really think there must be more to it. I should be able to use the DTD document to generate and parse XML and/or check that XML documents conform to it by doing some kind of stuff about which I don't have any idea. I would really appreciate if someone showed me the way and guide me to achieve this (maybe by sharing some examples or some useful documentation). Thank you very much Regards, -- Janet Valbuena Systems Programmer and Database Administrator TPP Internet From betty at eccnet.com Mon Jul 14 10:09:42 2003 From: betty at eccnet.com (Betty Harvey) Date: Mon Jul 14 09:11:26 2003 Subject: [XML-SIG] DTD help In-Reply-To: <1058162362.7776.48.camel@max> Message-ID: Janet: You can marry a document with a specific DTD by adding a DOCTYPE statement in your document. or The system identifier tells the parser where to locate the DTD. Hope this helps. Betty On 14 Jul 2003, Janet wrote: > Hi, > > I've got some understanding about processing XML with Python, which has > already allowed me to develop an application. > > However, I didn't manage to find a way to link what I did with the DTD. > My application works very well, but just because I created classes for > generating & parsing each particular XML entity. > > Is that the way it is? > > I really think there must be more to it. I should be able to use the DTD > document to generate and parse XML and/or check that XML documents > conform to it by doing some kind of stuff about which I don't have any > idea. > > I would really appreciate if someone showed me the way and guide me to > achieve this (maybe by sharing some examples or some useful > documentation). > > Thank you very much > > Regards, > > > > From kamel.hamard at ericsson.com Tue Jul 15 16:06:25 2003 From: kamel.hamard at ericsson.com (Kamel Hamard (LMC)) Date: Tue Jul 15 15:10:48 2003 Subject: [XML-SIG] PyXML API problem Message-ID: <2DBF697D5B36014ABA46E66A96107DA072051B@lmc37.lmc.ericsson.se> > Hi Guys, > > Python version : 2.2.2 > PyXML Version : 0.8.2 > > I'm using PyXML API in my project and I have a strange behaviour. I dont know if its a memory leak problem or not. > The problem I'm expreriencing is the following: > > - I have a server receiving queries of audit and inventory of the system. The server creates XML dom for each query it receives. > - Before receiving the queries, I take a look to the memory used by my server and I see that its 9 Megs > > - When the server starts processing the first audit the memory grows up to 36 Megs > > - but the memory is never released. but the strange is that when I do another audit, the memory dont grow anymore. > > - How I can confirm that there is a memory leak? > - How I can free this this memory ? > - Is it normal that a dom takes all this memory ? > > I was using 4Suite API and I found a memory leak. Its why I'm using PyXML now, Its slower and it takes more memory. > > Thanks for any hints > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/xml-sig/attachments/20030715/e7fc60b9/attachment.htm From tim at red56.co.uk Tue Jul 15 21:48:48 2003 From: tim at red56.co.uk (Tim Diggins) Date: Tue Jul 15 15:50:30 2003 Subject: [XML-SIG] PyXML API problem In-Reply-To: <2DBF697D5B36014ABA46E66A96107DA072051B@lmc37.lmc.ericsson.se> Message-ID: <000c01c34b0a$1ebc5100$1402a8c0@timxe3> a meagre (non expert) hint on the memory leak follows DOM objects are notorious for having cyclic references and thus preventing garbage collection. Are you breaking this dependency and deleting the DOM objects when you're finished with them? Apologies if this is no longer relevant with the 2.x garbage collector. I still delete things to free up memory when I'm feeling nervous and am not sure when I'm doing it unnecessarily. best Tim -----Original Message----- From: xml-sig-bounces@python.org [mailto:xml-sig-bounces@python.org] On Behalf Of Kamel Hamard (LMC) Sent: Tuesday, July 15, 2003 8:06 PM To: 'xml-sig@python.org' Subject: [XML-SIG] PyXML API problem Hi Guys, Python version : 2.2.2 PyXML Version : 0.8.2 I'm using PyXML API in my project and I have a strange behaviour. I dont know if its a memory leak problem or not. The problem I'm expreriencing is the following: - I have a server receiving queries of audit and inventory of the system. The server creates XML dom for each query it receives. - Before receiving the queries, I take a look to the memory used by my server and I see that its 9 Megs - When the server starts processing the first audit the memory grows up to 36 Megs - but the memory is never released. but the strange is that when I do another audit, the memory dont grow anymore. - How I can confirm that there is a memory leak? - How I can free this this memory ? - Is it normal that a dom takes all this memory ? I was using 4Suite API and I found a memory leak. Its why I'm using PyXML now, Its slower and it takes more memory. Thanks for any hints -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/xml-sig/attachments/20030715/9969a30b/attachment.htm From kamel.hamard at ericsson.com Tue Jul 15 16:53:54 2003 From: kamel.hamard at ericsson.com (Kamel Hamard (LMC)) Date: Tue Jul 15 15:58:15 2003 Subject: [XML-SIG] PyXML API problem Message-ID: <2DBF697D5B36014ABA46E66A96107DA072051D@lmc37.lmc.ericsson.se> Hi Tim, I'm using releaseNode method to free the memory. This method is not provided in 4Suite API, in which I found a memory leak and it's why I using PyXML API. Thanks -----Original Message----- From: Tim Diggins [mailto:tim@red56.co.uk] Sent: Tuesday, July 15, 2003 3:49 PM To: Kamel Hamard (QC/LMC); xml-sig@python.org Subject: RE: [XML-SIG] PyXML API problem a meagre (non expert) hint on the memory leak follows DOM objects are notorious for having cyclic references and thus preventing garbage collection. Are you breaking this dependency and deleting the DOM objects when you're finished with them? Apologies if this is no longer relevant with the 2.x garbage collector. I still delete things to free up memory when I'm feeling nervous and am not sure when I'm doing it unnecessarily. best Tim -----Original Message----- From: xml-sig-bounces@python.org [mailto:xml-sig-bounces@python.org] On Behalf Of Kamel Hamard (LMC) Sent: Tuesday, July 15, 2003 8:06 PM To: 'xml-sig@python.org' Subject: [XML-SIG] PyXML API problem Hi Guys, Python version : 2.2.2 PyXML Version : 0.8.2 I'm using PyXML API in my project and I have a strange behaviour. I dont know if its a memory leak problem or not. The problem I'm expreriencing is the following: - I have a server receiving queries of audit and inventory of the system. The server creates XML dom for each query it receives. - Before receiving the queries, I take a look to the memory used by my server and I see that its 9 Megs - When the server starts processing the first audit the memory grows up to 36 Megs - but the memory is never released. but the strange is that when I do another audit, the memory dont grow anymore. - How I can confirm that there is a memory leak? - How I can free this this memory ? - Is it normal that a dom takes all this memory ? I was using 4Suite API and I found a memory leak. Its why I'm using PyXML now, Its slower and it takes more memory. Thanks for any hints -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/xml-sig/attachments/20030715/d299bc0b/attachment.htm From fdrake at acm.org Tue Jul 15 18:29:38 2003 From: fdrake at acm.org (Fred L. Drake, Jr.) Date: Tue Jul 15 17:30:17 2003 Subject: [XML-SIG] PyXML API problem In-Reply-To: <000c01c34b0a$1ebc5100$1402a8c0@timxe3> References: <2DBF697D5B36014ABA46E66A96107DA072051B@lmc37.lmc.ericsson.se> <000c01c34b0a$1ebc5100$1402a8c0@timxe3> Message-ID: <16148.29250.217249.953070@grendel.zope.com> Kamel Hamard writes: > - Before receiving the queries, I take a look to the memory used by my > server and I see that its 9 Megs > > - When the server starts processing the first audit the memory grows up to > 36 Megs With just this information, it's impossible to know whether this is a leak or not. Depending on the application, there may be a lot of delayed imports that get loaded on the first request, and the memory contains imported Python modules, libraries, message catalogs, or the like. Figuring it out would require your application code and version information on the libraries. And a chunk of time. ;-) > - Is it normal that a dom takes all this memory ? DOM implementations have an incredible tendency to be memory hogs. It's possible to do things to cut back on this, but they tend to be an amazing amount of work and can impact other aspect of the application as well, depending on the approach taken. > I was using 4Suite API and I found a memory leak. Its why I'm using PyXML > now, Its slower and it takes more memory. Are you saying PyXML is slower and uses more memory, or 4Suite? What version of PyXML? (I'm sure you've stated it in the thread; I just don't recall.) Tim Diggins writes: > DOM objects are notorious for having cyclic references and thus preventing > garbage collection. Are you breaking this dependency and deleting the DOM > objects when you're finished with them? > > Apologies if this is no longer relevant with the 2.x garbage collector. I > still delete things to free up memory when I'm feeling nervous and am not > sure when I'm doing it unnecessarily. It's not necessary with the new collector, but it's still a good idea to free the resource when you're done with it. The collector will handle it, but may not do so at a predictable time. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From fdrake at acm.org Tue Jul 15 18:34:01 2003 From: fdrake at acm.org (Fred L. Drake, Jr.) Date: Tue Jul 15 17:34:40 2003 Subject: [XML-SIG] PyXML API problem In-Reply-To: <2DBF697D5B36014ABA46E66A96107DA072051B@lmc37.lmc.ericsson.se> References: <2DBF697D5B36014ABA46E66A96107DA072051B@lmc37.lmc.ericsson.se> Message-ID: <16148.29513.946510.632262@grendel.zope.com> Kamel Hamard (LMC) writes: > Python version : 2.2.2 > PyXML Version : 0.8.2 Ok, here's the answer to my earlier question. Next question: How are you parsing the XML text? Please be very specific; how PyXML responds varies depending on how you set this up. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From kamel.hamard at ericsson.com Tue Jul 15 18:51:24 2003 From: kamel.hamard at ericsson.com (Kamel Hamard (LMC)) Date: Tue Jul 15 17:55:44 2003 Subject: [XML-SIG] PyXML API problem Message-ID: <2DBF697D5B36014ABA46E66A96107DA0720520@lmc37.lmc.ericsson.se> Hi Fred, I'm creating the dom in memory after collecting the data from the system. In my current implementation I'm using ReleaseNode method to free the memory used and it works fine. PyXML is slower then 4Suite for manipulating XML document. With 4Suite API, I was not able to find a way to free the memory after creating documents (equivalent of ReleaseNode or unlink) Do you have any idea on how to release the memory used by a dom using the 4Suite API ?? Thanks -----Original Message----- From: Fred L. Drake, Jr. [mailto:fdrake@acm.org] Sent: Tuesday, July 15, 2003 5:34 PM To: Kamel Hamard (QC/LMC) Cc: 'xml-sig@python.org' Subject: Re: [XML-SIG] PyXML API problem Kamel Hamard (LMC) writes: > Python version : 2.2.2 > PyXML Version : 0.8.2 Ok, here's the answer to my earlier question. Next question: How are you parsing the XML text? Please be very specific; how PyXML responds varies depending on how you set this up. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From kamel.hamard at ericsson.com Tue Jul 15 18:54:44 2003 From: kamel.hamard at ericsson.com (Kamel Hamard (LMC)) Date: Tue Jul 15 17:59:02 2003 Subject: [XML-SIG] PyXML API problem Message-ID: <2DBF697D5B36014ABA46E66A96107DA0720521@lmc37.lmc.ericsson.se> -----Original Message----- From: Kamel Hamard (QC/LMC) Sent: Tuesday, July 15, 2003 5:51 PM To: 'Fred L. Drake, Jr.' Cc: 'xml-sig@python.org' Subject: RE: [XML-SIG] PyXML API problem Hi Fred, I'm creating the dom in memory after collecting the data from the system. In my current implementation I'm using ReleaseNode method to free the memory used and it works fine but the memory used is not released. (I use top command to see the memory usage) PyXML is slower then 4Suite for manipulating XML document. With 4Suite API, I was not able to find a way to free the memory after creating documents (equivalent of ReleaseNode or unlink) Do you have any idea on how to release the memory used by a dom using the 4Suite API ?? Thanks -----Original Message----- From: Fred L. Drake, Jr. [mailto:fdrake@acm.org] Sent: Tuesday, July 15, 2003 5:34 PM To: Kamel Hamard (QC/LMC) Cc: 'xml-sig@python.org' Subject: Re: [XML-SIG] PyXML API problem Kamel Hamard (LMC) writes: > Python version : 2.2.2 > PyXML Version : 0.8.2 Ok, here's the answer to my earlier question. Next question: How are you parsing the XML text? Please be very specific; how PyXML responds varies depending on how you set this up. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation _______________________________________________ XML-SIG maillist - XML-SIG@python.org http://mail.python.org/mailman/listinfo/xml-sig From jeremy.kloth at fourthought.com Tue Jul 15 17:21:31 2003 From: jeremy.kloth at fourthought.com (Jeremy Kloth) Date: Tue Jul 15 18:22:20 2003 Subject: [XML-SIG] PyXML API problem References: <2DBF697D5B36014ABA46E66A96107DA0720520@lmc37.lmc.ericsson.se> Message-ID: <004701c34b1f$7195fbf0$f701a8c0@zeus> Kamel Hamard (LMC) wrote: > Hi Fred, > > I'm creating the dom in memory after collecting the data from the > system. > > In my current implementation I'm using ReleaseNode method to free the > memory used and it works fine. > > PyXML is slower then 4Suite for manipulating XML document. With > 4Suite API, I was not able to find a way to free the memory after > creating documents (equivalent of ReleaseNode or unlink) Do you have > any idea on how to release the memory used by a dom using the 4Suite > API ?? > 4Sutie relies on Python's GC to release the memory when it is no longer needed. So I guess if you want to force the release of the memory use: import gc gc.collect() -- Jeremy Kloth Fourthought, Inc. From jeremy.kloth at fourthought.com Tue Jul 15 17:24:03 2003 From: jeremy.kloth at fourthought.com (Jeremy Kloth) Date: Tue Jul 15 18:24:46 2003 Subject: [XML-SIG] PyXML API problem Message-ID: <005101c34b1f$cc8f5240$f701a8c0@zeus> Jeremy Kloth wrote: > Kamel Hamard (LMC) wrote: >> Hi Fred, >> >> I'm creating the dom in memory after collecting the data from the >> system. >> >> In my current implementation I'm using ReleaseNode method to free the >> memory used and it works fine. >> >> PyXML is slower then 4Suite for manipulating XML document. With >> 4Suite API, I was not able to find a way to free the memory after >> creating documents (equivalent of ReleaseNode or unlink) Do you have >> any idea on how to release the memory used by a dom using the 4Suite >> API ?? >> > > 4Sutie relies on Python's GC to release the memory when it is no > longer needed. So I guess if you want to force the release of the > memory use: > > import gc > gc.collect() I forget to mention one other thing. By using gc.collect() you are simply telling Python to run the collection cycle, which is something that it does itself at some interval. -- Jeremy Kloth Fourthought, Inc. From tpassin at comcast.net Tue Jul 15 20:59:38 2003 From: tpassin at comcast.net (Thomas B. Passin) Date: Tue Jul 15 19:55:57 2003 Subject: [XML-SIG] PyXML API problem References: <2DBF697D5B36014ABA46E66A96107DA0720520@lmc37.lmc.ericsson.se> <004701c34b1f$7195fbf0$f701a8c0@zeus> Message-ID: <006101c34b2d$2c684bb0$6401a8c0@tbp1> [Jeremy Kloth > 4Sutie relies on Python's GC to release the memory when it is no longer > needed. So I guess if you want to force the release of the memory use: > > import gc > gc.collect() > I had a java program that would keep allocating memory and occasionally pop up its memory usage dramatically. Eventually, it would bog the machine down as it started swapping to virtual memory, then the java VM would quit. It would happen every day or several days (this was a persistent application). I put in a few of the java equivalent of gc.collect() at the places I suspected, and completely stopped the excessive memory growth. (And I put in a few assignments to null, too, but it was the forced collection that did the job) Cheers, Tom P From Mike.Olson at fourthought.com Tue Jul 15 22:39:28 2003 From: Mike.Olson at fourthought.com (Michael Olson) Date: Tue Jul 15 23:40:07 2003 Subject: [XML-SIG] PyXML API problem In-Reply-To: <2DBF697D5B36014ABA46E66A96107DA0720520@lmc37.lmc.ericsson.se> Message-ID: <1A4BC62B-B73F-11D7-8D30-000393CFDA9C@fourthought.com> > PyXML is slower then 4Suite for manipulating XML document. With 4Suite > API, I was not able to find a way to free the memory after creating > documents (equivalent of ReleaseNode or unlink) Do you have any idea > on how to release the memory used by a dom using the 4Suite API ?? > It uses Pythons circular GC detection to release it for you. You shouldn't have to do anything special. Mike > Thanks > > -----Original Message----- > From: Fred L. Drake, Jr. [mailto:fdrake@acm.org] > Sent: Tuesday, July 15, 2003 5:34 PM > To: Kamel Hamard (QC/LMC) > Cc: 'xml-sig@python.org' > Subject: Re: [XML-SIG] PyXML API problem > > > > Kamel Hamard (LMC) writes: >> Python version : 2.2.2 >> PyXML Version : 0.8.2 > > Ok, here's the answer to my earlier question. > > Next question: How are you parsing the XML text? Please be very > specific; how PyXML responds varies depending on how you set this up. > > > -Fred > > -- > Fred L. Drake, Jr. > PythonLabs at Zope Corporation > > _______________________________________________ > XML-SIG maillist - XML-SIG@python.org > http://mail.python.org/mailman/listinfo/xml-sig > ------------------------------------------------------------------------ ----------------- Mike Olson Principal Consultant mike.olson@fourthought.com +1 303 583 9900 Fourthought, Inc. http://Fourthought.com PO Box 270590, http://4Suite.org Louisville, CO 80027-5009, USA XML strategy, XML tools, knowledge management From martin at v.loewis.de Wed Jul 16 05:48:55 2003 From: martin at v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: Wed Jul 16 00:48:56 2003 Subject: [XML-SIG] PyXML API problem In-Reply-To: <005101c34b1f$cc8f5240$f701a8c0@zeus> References: <005101c34b1f$cc8f5240$f701a8c0@zeus> Message-ID: "Jeremy Kloth" writes: > I forget to mention one other thing. By using gc.collect() you are simply > telling Python to run the collection cycle, which is something that it does > itself at some interval. Interestingly enough, for XML DOM, the collection frequency might be too low. Python invokes collection every 700 (used to be 1000) allocations of container objects. If you have documents with little structure and large CDATA, the string objects (which are not accounted for in cyclic thresholds) could consume a lot of memory. So if invoking gc.collect explicitly helps, you might just as well invoke gc.set_threshold, to invoke automatic collection more frequently. HTH, Martin From kamel.hamard at ericsson.com Wed Jul 16 09:50:07 2003 From: kamel.hamard at ericsson.com (Kamel Hamard (LMC)) Date: Wed Jul 16 08:54:33 2003 Subject: [XML-SIG] PyXML API problem Message-ID: <2DBF697D5B36014ABA46E66A96107DA0720522@lmc37.lmc.ericsson.se> Hi Guys, Thanks for your anwers. I'm doing a small test, one with PyXML API and another with 4Suite. In the test with PyXML I'm able to stabilise the memory growth but with the one with 4Suite I'm not able to do it and the GC is not collecting the memory. Here the python example in which I'm creating a dom, in the top unix command, you can see the memory growing. I'll be happy if there is a good explaination to this behaviour. 4suite.py use 4Suite API pyxml.py uses PyXML API Thanks Kamel -----Original Message----- From: martin@v.loewis.de [mailto:martin@v.loewis.de] Sent: Wednesday, July 16, 2003 12:49 AM To: Jeremy Kloth Cc: Kamel Hamard (QC/LMC); 'Fred L. Drake, Jr.'; xml-sig@python.org Subject: Re: [XML-SIG] PyXML API problem "Jeremy Kloth" writes: > I forget to mention one other thing. By using gc.collect() you are simply > telling Python to run the collection cycle, which is something that it does > itself at some interval. Interestingly enough, for XML DOM, the collection frequency might be too low. Python invokes collection every 700 (used to be 1000) allocations of container objects. If you have documents with little structure and large CDATA, the string objects (which are not accounted for in cyclic thresholds) could consume a lot of memory. So if invoking gc.collect explicitly helps, you might just as well invoke gc.set_threshold, to invoke automatic collection more frequently. HTH, Martin -------------- next part -------------- A non-text attachment was scrubbed... Name: 4suite.py Type: application/octet-stream Size: 3954 bytes Desc: not available Url : http://mail.python.org/pipermail/xml-sig/attachments/20030716/4ba07c0a/4suite.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: pyxml.py Type: application/octet-stream Size: 1801 bytes Desc: not available Url : http://mail.python.org/pipermail/xml-sig/attachments/20030716/4ba07c0a/pyxml.obj From kamel.hamard at ericsson.com Wed Jul 16 09:56:38 2003 From: kamel.hamard at ericsson.com (Kamel Hamard (LMC)) Date: Wed Jul 16 09:01:03 2003 Subject: [XML-SIG] PyXML API problem Message-ID: <2DBF697D5B36014ABA46E66A96107DA0720523@lmc37.lmc.ericsson.se> I forgot to specify all the versions I'm using. OS : SunOS 5.7 python version : 2.2.2 PyXML Version : 0.8.2 4Suite version : Version 1.0a3 Regards -----Original Message----- From: martin@v.loewis.de [mailto:martin@v.loewis.de] Sent: Wednesday, July 16, 2003 12:49 AM To: Jeremy Kloth Cc: Kamel Hamard (QC/LMC); 'Fred L. Drake, Jr.'; xml-sig@python.org Subject: Re: [XML-SIG] PyXML API problem "Jeremy Kloth" writes: > I forget to mention one other thing. By using gc.collect() you are simply > telling Python to run the collection cycle, which is something that it does > itself at some interval. Interestingly enough, for XML DOM, the collection frequency might be too low. Python invokes collection every 700 (used to be 1000) allocations of container objects. If you have documents with little structure and large CDATA, the string objects (which are not accounted for in cyclic thresholds) could consume a lot of memory. So if invoking gc.collect explicitly helps, you might just as well invoke gc.set_threshold, to invoke automatic collection more frequently. HTH, Martin From martin at v.loewis.de Wed Jul 16 20:29:19 2003 From: martin at v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: Wed Jul 16 15:29:20 2003 Subject: [XML-SIG] PyXML API problem In-Reply-To: <2DBF697D5B36014ABA46E66A96107DA0720522@lmc37.lmc.ericsson.se> References: <2DBF697D5B36014ABA46E66A96107DA0720522@lmc37.lmc.ericsson.se> Message-ID: "Kamel Hamard (LMC)" writes: > I'll be happy if there is a good explaination to this behaviour. Looks like a bug to me. Someone should investigate this further. Regards, Martin From mertz at gnosis.cx Wed Jul 16 18:20:49 2003 From: mertz at gnosis.cx (David Mertz, Ph.D.) Date: Wed Jul 16 17:25:20 2003 Subject: [XML-SIG] [Announce] Gnosis Utils 1.1.0 (update) Message-ID: ** I bit the bullet an bought more bandwidth, this notice is ** updated to reflect the permanent URL for Gnosis Utilities [Announce] Gnosis Utils 1.1.0 This release contains enhancements to gnosis.xml.objectify. Added _XO_.__repr__ method to make nodes print in a nicer, more compact fashion. Added ._seq attribute to node objects to support structure preserving convenience functions. Specifically, older versions of gnosis.xml.objectify lost information about mixed content and the order of children. E.g., >>> xml = 'Mixed content is good' >>> obj = XO(xml,EXPAT).make_instance() >>> obj.PCDATA, obj.i.PCDATA, obj.b.PCDATA (u'Mixed is', u'content', u'good') We had no way of knowing where inside the and the occur, nor even which child element occurs first. Now we can recover that information: >>> from gnosis.xml.objectify import content, children >>> content(obj) [u'Mixed ', , u' is ', ] >>> children(obj) [, ] Sequence information and convenience methods are NOT SUPPORTED (yet?) for the DOM parser, only for EXPAT! Changed default parser to EXPAT. If you have relied on the special attribute ._XML that the DOM parser attaches to nodes, you will now need to explicitly specify DOM as the parser used. However, the new sequence functions pretty well handle the job pyobj._XML used to do (in a different way). Some newer versions of PyXML report CDATA as #cdata-section nodes rather than as #text. We deal with it either way now. It may be obtained at: http://gnosis.python-hosting.com/Gnosis_Utils-1.1.0.tar.gz (this URL is different from usual since my main site was slashdotted, and I'm worried about my monthly bandwidth limit; I'll copy the file to its regular home next month). Try it out, have fun, send feedback! David Mertz (mertz@gnosis.cx) Frank McIngvale (frankm@hiwaay.net) ------------------------------------------------------------------------ BACKGROUND: Gnosis Utilities contains a number of Python libraries, most (but not all) related to working with XML. These include: gnosis.indexer (Full-text indexing/searching) gnosis.xml.pickle (XML pickling of Python objects) gnosis.xml.objectify (Any XML to "native" Python objects) gnosis.xml.validity (Enforce validity constraints) gnosis.xml.indexer (XPATH indexing of XML documents) [...].convert.txt2html (Convert ASCII source files to HTML) gnosis.util.dtd2sql (DTD -> SQL 'CREATE TABLE' statements) gnosis.util.sql2dtd (SQL query -> DTD for query results) gnosis.util.xml2sql (XML -> SQL 'INSERT INTO' statements) gnosis.util.combinators (Combinatorial higher-order functions) gnosis.util.introspect (Introspect Python objects) gnosis.magic (Multimethods, metaclasses, etc) ...and so much more! :-) From mertz at gnosis.cx Wed Jul 16 18:24:05 2003 From: mertz at gnosis.cx (Lulu of the Lotus-Eaters) Date: Wed Jul 16 17:29:17 2003 Subject: [XML-SIG] [Announce] Gnosis Utils 1.1.0 (update) Message-ID: <1JcF/kKkXshL092yn@gnosis.cx> ** SECOND TRY (aaggh!) ** I bit the bullet and bought more bandwidth, this notice is ** updated to reflect the permanent URL for Gnosis Utilities [Announce] Gnosis Utils 1.1.0 This release contains enhancements to gnosis.xml.objectify. Added _XO_.__repr__ method to make nodes print in a nicer, more compact fashion. Added ._seq attribute to node objects to support structure preserving convenience functions. Specifically, older versions of gnosis.xml.objectify lost information about mixed content and the order of children. E.g., >>> xml = 'Mixed content is good' >>> obj = XO(xml,EXPAT).make_instance() >>> obj.PCDATA, obj.i.PCDATA, obj.b.PCDATA (u'Mixed is', u'content', u'good') We had no way of knowing where inside the and the occur, nor even which child element occurs first. Now we can recover that information: >>> from gnosis.xml.objectify import content, children >>> content(obj) [u'Mixed ', , u' is ', ] >>> children(obj) [, ] Sequence information and convenience methods are NOT SUPPORTED (yet?) for the DOM parser, only for EXPAT! Changed default parser to EXPAT. If you have relied on the special attribute ._XML that the DOM parser attaches to nodes, you will now need to explicitly specify DOM as the parser used. However, the new sequence functions pretty well handle the job pyobj._XML used to do (in a different way). Some newer versions of PyXML report CDATA as #cdata-section nodes rather than as #text. We deal with it either way now. It may be obtained at: http://gnosis.cx/download/Gnosis_Utils-1.1.0.tar.gz The current release is always available as: http://gnosis.cx/download/Gnosis_Utils-current.tar.gz Try it out, have fun, send feedback! David Mertz (mertz@gnosis.cx) Frank McIngvale (frankm@hiwaay.net) ------------------------------------------------------------------------ BACKGROUND: Gnosis Utilities contains a number of Python libraries, most (but not all) related to working with XML. These include: gnosis.indexer (Full-text indexing/searching) gnosis.xml.pickle (XML pickling of Python objects) gnosis.xml.objectify (Any XML to "native" Python objects) gnosis.xml.validity (Enforce validity constraints) gnosis.xml.indexer (XPATH indexing of XML documents) [...].convert.txt2html (Convert ASCII source files to HTML) gnosis.util.dtd2sql (DTD -> SQL 'CREATE TABLE' statements) gnosis.util.sql2dtd (SQL query -> DTD for query results) gnosis.util.xml2sql (XML -> SQL 'INSERT INTO' statements) gnosis.util.combinators (Combinatorial higher-order functions) gnosis.util.introspect (Introspect Python objects) gnosis.magic (Multimethods, metaclasses, etc) ...and so much more! :-) From jeremy.kloth at fourthought.com Wed Jul 16 23:11:10 2003 From: jeremy.kloth at fourthought.com (Jeremy Kloth) Date: Thu Jul 17 00:12:03 2003 Subject: [XML-SIG] PyXML API problem In-Reply-To: References: <2DBF697D5B36014ABA46E66A96107DA0720522@lmc37.lmc.ericsson.se> Message-ID: <200307162211.10572.jeremy.kloth@fourthought.com> On Wednesday 16 July 2003 01:29 pm, Martin v. L?wis wrote: > "Kamel Hamard (LMC)" writes: > > I'll be happy if there is a good explaination to this behaviour. > > Looks like a bug to me. Someone should investigate this further. > Well, there was an issue with the GC support in 4Suite. It is fixed in CVS for those interested in trying that out. The problem was that we were simply DECREFing the children and attributes containers instead of emptying them in the tp_clear method. -- Jeremy Kloth Fourthought, Inc. http://fourthought.com http://4suite.org From cybersamurai at mac.com Thu Jul 17 09:30:35 2003 From: cybersamurai at mac.com (Luiz Siqueira Neto) Date: Thu Jul 17 07:29:42 2003 Subject: [XML-SIG] Where is the documentation? Message-ID: <200307170830.35695.cybersamurai@mac.com> I can't find a simple documentation to learn how I use XPath, DOM, SAX in Python. I use XPath in Java and it is very easy. I believe XPath in Python is very easy too but I need some good start point. If some body have some idea or URL will be wellcome. : ) From paul.boddie at ementor.no Thu Jul 17 14:50:04 2003 From: paul.boddie at ementor.no (paul.boddie@ementor.no) Date: Thu Jul 17 07:50:39 2003 Subject: [XML-SIG] Where is the documentation? Message-ID: Luiz Siqueira Neto [mailto:cybersamurai@mac.com] wrote: > > I can't find a simple documentation to learn how I use XPath, DOM, SAX in > Python. I use XPath in Java and it is very easy. I believe XPath in Python is > very easy too but I need some good start point. If some body have some idea > or URL will be wellcome. : ) Using PyXML, try opening a document: import xml.dom.minidom document = xml.dom.minidom.parse(some_file_or_filename) Then, use the XPath features of PyXML: import xml.xpath elements = xml.xpath.Evaluate(some_xpath_query, document) Obviously, you'll need to define 'some_xpath_query' using the XPath notation: http://www.w3.org/TR/xpath Like the Jaxen API for Java (if that's what you mean by "XPath in Java"), you can compile/prepare XPath expressions in advance: expr = xml.xpath.Compile(some_xpath_query) # In Jaxen: expr = org.jaxen.dom.DOMXPath(some_xpath_query) It appears that you need to wrap your document up in an XPath context before you can evaluate that expression: context = xml.xpath.CreateContext(document) # Or: context = xml.xpath.Context.Context(document) You can add namespace prefix definitions and variable definitions to the context either during its initialisation or by using certain methods: context.setVarBindings( { (some_ns_often_None, some_variable) : some_value, # ... }) Then you can do the evaluation: elements = expr.evaluate(context) # In Jaxen: elements = expr.selectNodes(context) # Although Jaxen uses the document directly, I think. Use document.toxml() or xml.dom.ext.PrettyPrint(document) to write the file. Good luck! Paul From kamel.hamard at ericsson.com Thu Jul 17 09:54:22 2003 From: kamel.hamard at ericsson.com (Kamel Hamard (LMC)) Date: Thu Jul 17 08:58:47 2003 Subject: [XML-SIG] PyXML API problem Message-ID: <2DBF697D5B36014ABA46E66A96107DA072052E@lmc37.lmc.ericsson.se> Hi Jeremy, Good news then. I want to test it, how to get the fix from CVS please? Is it solving the problem in XSLT API to? Thanks Kamel -----Original Message----- From: Jeremy Kloth [mailto:jeremy.kloth@fourthought.com] Sent: Thursday, July 17, 2003 12:11 AM To: martin@v.loewis.de; Kamel Hamard (QC/LMC) Cc: xml-sig@python.org; 'Fred L. Drake, Jr.' Subject: Re: [XML-SIG] PyXML API problem On Wednesday 16 July 2003 01:29 pm, Martin v. L?wis wrote: > "Kamel Hamard (LMC)" writes: > > I'll be happy if there is a good explaination to this behaviour. > > Looks like a bug to me. Someone should investigate this further. > Well, there was an issue with the GC support in 4Suite. It is fixed in CVS for those interested in trying that out. The problem was that we were simply DECREFing the children and attributes containers instead of emptying them in the tp_clear method. -- Jeremy Kloth Fourthought, Inc. http://fourthought.com http://4suite.org From felix at fbreuer.de Thu Jul 17 23:19:56 2003 From: felix at fbreuer.de (Felix Breuer) Date: Thu Jul 17 18:19:57 2003 Subject: [XML-SIG] syncing DOM trees Message-ID: <1058480164.23452.17.camel@tapir> Hello *! Is there a way to keep two (or more) DOM trees in sync? Scenario 1) I simply have two identical DOM trees in memory. When one of them changes I want the change to be applied to the other tree as well. Of course I could catch mutation events and handle them by appropriately modifying the target tree. Has this been done before somewhere? Scenario 2) I have two identical DOM trees *on two different machines* connected via a network. Is there some canonical way (protocol) to communicate the changes made to the first one accross a network so that they can be applied to the second one? Is there an implementation of such a protocol? I know there is http://www.deltaxml.com, but is there a free solution? Scenario 3) I have a single DOM tree which I can easily reproduce (because I have the XML file in serialized form). Now this DOM tree is changed and I want to log these changes. At some point I want to recreate the DOM tree from the file and apply a part of the logged mutations to it. (So as to implement an "Undo" function.) How to do this? It would be optimal of course to literally undo the last changes applied to the modified tree - is there a canonical mapping of DOM methods to their inverse? Opinions, pointers, comments? Thanks all, Felix From Alexandre.Fayolle at logilab.fr Fri Jul 18 09:58:48 2003 From: Alexandre.Fayolle at logilab.fr (Alexandre Fayolle) Date: Fri Jul 18 02:58:54 2003 Subject: [XML-SIG] syncing DOM trees In-Reply-To: <1058480164.23452.17.camel@tapir> References: <1058480164.23452.17.camel@tapir> Message-ID: <20030718065848.GC1270@calvin> On Fri, Jul 18, 2003 at 12:16:12AM +0200, Felix Breuer wrote: > Scenario 3) I have a single DOM tree which I can easily reproduce > (because I have the XML file in serialized form). Now this DOM tree is > changed and I want to log these changes. At some point I want to > recreate the DOM tree from the file and apply a part of the logged > mutations to it. (So as to implement an "Undo" function.) How to do > this? It would be optimal of course to literally undo the last changes > applied to the modified tree - is there a canonical mapping of DOM > methods to their inverse? xmldiff (http://www.logilab.org/xmldiff/) could be useful for this scenario. -- Alexandre Fayolle LOGILAB, Paris (France). http://www.logilab.com http://www.logilab.fr http://www.logilab.org D?veloppement logiciel avanc? - Intelligence Artificielle - Formations From mike at skew.org Fri Jul 18 05:14:10 2003 From: mike at skew.org (Mike Brown) Date: Fri Jul 18 06:14:11 2003 Subject: [XML-SIG] PyXML API problem In-Reply-To: <2DBF697D5B36014ABA46E66A96107DA072052E@lmc37.lmc.ericsson.se> "from Kamel Hamard (LMC) at Jul 17, 2003 08:54:22 am" Message-ID: <200307181014.h6IAEA1V070448@chilled.skew.org> Kamel Hamard (LMC) wrote: > I want to test it, how to get the fix from CVS please? Either wait till after midnight Mountain time (US) the next day and download from ftp.4suite.org/pub/cvs-snapshots/ or use a CVS client at your convenience (this is preferable): http://4suite.org/docs/4SuiteCVS.xml (scroll down to section 4) All check-ins are sent to a mailing list, archived here: http://lists.fourthought.com/pipermail/4suite-checkins From cybersamurai at mac.com Fri Jul 18 14:47:23 2003 From: cybersamurai at mac.com (Luiz Siqueira Neto) Date: Fri Jul 18 12:46:58 2003 Subject: [XML-SIG] Where is the documentation? Message-ID: <200307181347.23293.cybersamurai@mac.com> I can't find information about how use XPath with Python and documentation about DOM and SAX. Thanks for help From kamel.hamard at ericsson.com Fri Jul 18 15:08:30 2003 From: kamel.hamard at ericsson.com (Kamel Hamard (LMC)) Date: Fri Jul 18 14:12:51 2003 Subject: [XML-SIG] Leak in XSLT API Message-ID: <2DBF697D5B36014ABA46E66A96107DA0720540@lmc37.lmc.ericsson.se> Hi Guys, I think that its another leak. This time its on XSLT API. I have a example using multiple xsl and xslt files, I dont know if its correct to send them on this mailing list. If someone want to test them and confirm the leak just let me know. Thanks Kamel -------------- next part -------------- A non-text attachment was scrubbed... Name: xslt.py Type: application/octet-stream Size: 758 bytes Desc: not available Url : http://mail.python.org/pipermail/xml-sig/attachments/20030718/f0e2866e/xslt.obj From dieter at handshake.de Fri Jul 18 22:26:02 2003 From: dieter at handshake.de (Dieter Maurer) Date: Fri Jul 18 16:26:31 2003 Subject: [XML-SIG] syncing DOM trees In-Reply-To: <1058480164.23452.17.camel@tapir> References: <1058480164.23452.17.camel@tapir> Message-ID: <16152.18890.782040.124402@gargle.gargle.HOWL> Felix Breuer wrote at 2003-7-18 00:16 +0200: > Is there a way to keep two (or more) DOM trees in sync? > > Scenario 1) I simply have two identical DOM trees in memory. When one of > them changes I want the change to be applied to the other tree as well. > Of course I could catch mutation events and handle them by appropriately > modifying the target tree. Has this been done before somewhere? Why do you have 2 identical DOM trees? Looks as if you should just have a single one. Dieter From kamel.hamard at ericsson.com Fri Jul 18 17:26:09 2003 From: kamel.hamard at ericsson.com (Kamel Hamard (LMC)) Date: Fri Jul 18 16:30:27 2003 Subject: [XML-SIG] nodeIterator Problem Message-ID: <2DBF697D5B36014ABA46E66A96107DA0720544@lmc37.lmc.ericsson.se> Hi Guys, I was using in my code a nodeiterator with 4Suite API. Here is a simple code: def iterator(self): iter = self.getDoc().createNodeIterator(self.inv.getDocElt(),\ NodeFilter.SHOW_ELEMENT, None, 0) node = iter.nextNode() I'm getting this error: AttributeError: createNodeIterator Why I cannot use this method anymore ? This code was working correctly. Is it possible that some new stuff was includedin the version provided with CVS ? Thanks Kamel From kamel.hamard at ericsson.com Fri Jul 18 17:59:10 2003 From: kamel.hamard at ericsson.com (Kamel Hamard (LMC)) Date: Fri Jul 18 17:06:52 2003 Subject: [XML-SIG] PyXML API problem Message-ID: <2DBF697D5B36014ABA46E66A96107DA0720545@lmc37.lmc.ericsson.se> Hi, The code I was using with 4Suite until now was working but it seems that there is small updates in this API. Like in the example bellow: from Ft.Xml.Domlette import NonvalidatingReader, PrettyPrint, implementation def createDoc(self, node): #Create a document type node using the doctype name "report" #A blank system ID and blank public ID (i.e. no DTD information) doctype = implementation.createDocumentType(node, None, None) #Create a document node, which also creates a document element node #For the element, use a blank namespace URI and local name "message" return(implementation.createDocument(EMPTY_NAMESPACE, node, None)) I'm not able to use implementation.createDocumentType(node, None, None) The same problem with createNodeIterator? Could someone tell me what I'm doing wrong ? (this code was working correctly so far) Thanks Kamel From jeremy.kloth at fourthought.com Fri Jul 18 18:37:55 2003 From: jeremy.kloth at fourthought.com (Jeremy Kloth) Date: Fri Jul 18 19:38:53 2003 Subject: [XML-SIG] Pyexpat memory leak Message-ID: <00f801c34d85$9d3aa040$f701a8c0@zeus> I've checked in fixes for pyexpat which solve a refcount issue when passing an instance to ParseFile. The readmethod wasn't being decref'ed before exit of that function. -- Jeremy Kloth Fourthought, Inc. From noreply at sourceforge.net Sat Jul 19 01:42:09 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Sat Jul 19 03:42:15 2003 Subject: [XML-SIG] [ pyxml-Bugs-774091 ] minidom CharacterData string methods fail when offset=length Message-ID: Bugs item #774091, was opened at 2003-07-19 07:42 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=106473&aid=774091&group_id=6473 Category: DOM Group: None Status: Open Resolution: None Priority: 5 Submitted By: Andrew Clover (bobince) Assigned to: Nobody/Anonymous (nobody) Summary: minidom CharacterData string methods fail when offset=length Initial Comment: In all minidom versions up to that released in 0.8.2, an IndexSizeErr is raised by the methods substringData, insertData, deleteData and replaceData when the offset parameter passed is beyond *or at* the end of the current string value. According to DOM Level 1 Core, the exception should be raised only if the offset is *greater than* the length. The comparisons at lines 967, 979, 988 and 998 of minidom.py should be changed from: if offset >= len(self.data): to: if offset > len(self.data): ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=106473&aid=774091&group_id=6473 From noreply at sourceforge.net Sat Jul 19 01:59:58 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Sat Jul 19 04:00:51 2003 Subject: [XML-SIG] [ pyxml-Bugs-774095 ] minidom hasAttributes method only available on Element Message-ID: Bugs item #774095, was opened at 2003-07-19 07:59 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=106473&aid=774095&group_id=6473 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Andrew Clover (bobince) Assigned to: Nobody/Anonymous (nobody) Summary: minidom hasAttributes method only available on Element Initial Comment: According to DOM L2 Core it should be in the Node interface. Suggest adding to minidom.py at line 210: def hasAttributes(): return False ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=106473&aid=774095&group_id=6473 From noreply at sourceforge.net Sat Jul 19 02:42:42 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Sat Jul 19 04:42:45 2003 Subject: [XML-SIG] [ pyxml-Bugs-774099 ] minidom setAttributeNodeNS return value may be wrong Message-ID: Bugs item #774099, was opened at 2003-07-19 08:42 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=106473&aid=774099&group_id=6473 Category: DOM Group: None Status: Open Resolution: None Priority: 5 Submitted By: Andrew Clover (bobince) Assigned to: Nobody/Anonymous (nobody) Summary: minidom setAttributeNodeNS return value may be wrong Initial Comment: In 0.8.2, minidom tries to remove attributes that have the same name *or* nsURI/localName as the new attribute when setAttributeNode[NS] is called. An attribute replaced because it matches namespaceURI and localName will likely not be returned by the following code at line 745 of minidom.py: if old1 is not attr: return old1 if old2 is not attr: return old2 Suggest replacement something like: for old in (old1, old2): if old is not None and old is not attr: return old return None (Ideally there ought to be separate calls for setAttributeNode and setAttributeNodeNS, since one should only replace based on name and the other on nsURI/localName.) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=106473&aid=774099&group_id=6473 From noreply at sourceforge.net Sat Jul 19 02:44:44 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Sat Jul 19 04:44:47 2003 Subject: [XML-SIG] [ pyxml-Bugs-774100 ] minidom removeAttributeNode return value Message-ID: Bugs item #774100, was opened at 2003-07-19 08:44 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=106473&aid=774100&group_id=6473 Category: DOM Group: None Status: Open Resolution: None Priority: 5 Submitted By: Andrew Clover (bobince) Assigned to: Nobody/Anonymous (nobody) Summary: minidom removeAttributeNode return value Initial Comment: This method should return the removed node. Trivial fix, line 780 minidom.py: return node ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=106473&aid=774100&group_id=6473 From noreply at sourceforge.net Sat Jul 19 02:54:04 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Sat Jul 19 04:54:07 2003 Subject: [XML-SIG] [ pyxml-Bugs-774104 ] minidom setNamedItem unlinks replaced attributes Message-ID: Bugs item #774104, was opened at 2003-07-19 08:54 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=106473&aid=774104&group_id=6473 Category: DOM Group: None Status: Open Resolution: None Priority: 5 Submitted By: Andrew Clover (bobince) Assigned to: Nobody/Anonymous (nobody) Summary: minidom setNamedItem unlinks replaced attributes Initial Comment: Older minidoms used to prematurely unlink attributes that were being replaced in setAttributeNode[NS] calls, resulting in Attr objects whose ownerDocument was None. This was fixed by having removeAttributeNode writing to ownerDocument after unlinking, but the same problem remains in NamedNodeMap.setNamedItem[NS]. Suggest fix to add after line 589 of minidom.py: old.ownerDocument = self.ownerDocument (Again, setNamedItem and setNamedItemNS ought to be different calls, as they may replace different nodes.) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=106473&aid=774104&group_id=6473 From noreply at sourceforge.net Sat Jul 19 03:04:17 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Sat Jul 19 05:04:21 2003 Subject: [XML-SIG] [ pyxml-Bugs-774108 ] 4DOM setAttributeNode[NS] setting attribute already on node Message-ID: Bugs item #774108, was opened at 2003-07-19 09:04 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=106473&aid=774108&group_id=6473 Category: DOM Group: None Status: Open Resolution: None Priority: 5 Submitted By: Andrew Clover (bobince) Assigned to: Nobody/Anonymous (nobody) Summary: 4DOM setAttributeNode[NS] setting attribute already on node Initial Comment: setAttributeNode[NS] where the newAttr is already owned by the element in question should have no effect. 4DOM instead generated InuseAttributeErr. Suggest replacing line 112 of Element.py: if node.ownerElement != None: With: if node.ownerElement not in (None, self): ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=106473&aid=774108&group_id=6473 From and-xml at doxdesk.com Sat Jul 19 17:51:25 2003 From: and-xml at doxdesk.com (Andrew Clover) Date: Sat Jul 19 13:03:09 2003 Subject: [XML-SIG] Bugs 'n' bindings Message-ID: <20030719165125.GA22616@doxdesk.com> Evening all, I've been updating that table of bugs and other compliance issues I posted earlier, which is the cause of the bug tracker mail spurt, sorry about that. ;-) The table can now be found at: http://pyxml.sourceforge.net/topics/compliance.html Meanwhile, I'm thinking we should update the Python DOM bindings in the Python Library Reference, as it currently only defines the Level 1 Core object types. I'd recommend: - DOMTimeStamp (L3 Core) to be bound to long. - DOMUserData (L3 Core) to be bound to any object/type. - UserDataHandler to be bound to any object with the appropriate method; user should not be expected to define the constants NODE_CLONED etc. inside the object. Similarly for NodeFilter (L2 Traversal) etc. - DOMInputStream and DOMReader (L3 Load) to be bound to any stream-like object, implementing read(n) method that returns a string object. (It would be expected, but probably shouldn't be required, that DOMInputStream would return narrow strings and DOMReader would return Unicode strings.) - DOMOutputStream and DOMWriter (L3 Save) to be bound to any stream- like object, implementing write(s) method that accepts a string (which in the case of DOMOutputStream will contain no characters >128). - DOMException (L1 Core) ought really to be bound to *something*, so that authors can catch exceptions generated by any DOM implementation. xml.dom.DOMException would be a good candidate except that to my tastes it says too much about the implementation of the object (I'd really want a pure interface-like class to inherit from), and it isn't available in Python 2.0 (or earlier Pythons without the xml package for that matter). Any thoughts? - For that matter, the same goes for EventException, RangeException, etc. (L2) Also the following changes seem sensible: - boolean to be redefined as optionally bound to the Python native boolean type (when available) - the obligation of a DOM implementation to support live editing of writable (childNodes) NodeLists through Python __setitem__ and __delitem__ methods should be removed (PLR 13.6.2.3). The utility of this feature is limited (since no slicing or mutable sequence methods are available), and it's difficult for some kinds of DOM implementation to support. Plus in practical terms it's not actually supported properly (ie. keeping the tree consistent) by any Python DOM I know of. (*) Also it might be useful to state explicitly that any reserved words used by a DOM specification will be used with a trailing underline. I don't think there are any Python reserved words in current DOM specs, but an earlier draft of Level 3 Load/Save used 'is' quite a lot for parameter names, so it could well happen. (*) - well okay, not supported by any DOM except for my own pet DOM, currently unreleased, which sticks to standards to a pathological degree. I am a WaSP member after all, sorry... -- Andrew Clover mailto:and@doxdesk.com http://www.doxdesk.com/ From kamel.hamard at ericsson.com Sun Jul 20 11:32:37 2003 From: kamel.hamard at ericsson.com (Kamel Hamard (LMC)) Date: Sun Jul 20 10:36:55 2003 Subject: [XML-SIG] CVS Version of PyXML Message-ID: <2DBF697D5B36014ABA46E66A96107DA0720547@lmc37.lmc.ericsson.se> Hi, I'm looking on CVS version of PyXML. Could someone give me the link to the latest version to test Jeremy fixes ? Thanks Kamel -----Original Message----- From: Jeremy Kloth [mailto:jeremy.kloth@fourthought.com] Sent: Friday, July 18, 2003 7:38 PM To: xml-sig@python.org Subject: [XML-SIG] Pyexpat memory leak I've checked in fixes for pyexpat which solve a refcount issue when passing an instance to ParseFile. The readmethod wasn't being decref'ed before exit of that function. -- Jeremy Kloth Fourthought, Inc. _______________________________________________ XML-SIG maillist - XML-SIG@python.org http://mail.python.org/mailman/listinfo/xml-sig From kamel.hamard at ericsson.com Sun Jul 20 12:32:34 2003 From: kamel.hamard at ericsson.com (Kamel Hamard (LMC)) Date: Sun Jul 20 11:36:57 2003 Subject: [XML-SIG] Pyexpat memory leak Message-ID: <2DBF697D5B36014ABA46E66A96107DA0720548@lmc37.lmc.ericsson.se> Hi Jeremy, The script is not leaking on python 2.2.2 but when I use my complete application creating doms like I'm doing in the script, I see a small leak. Why I dont see the leak in the script and I see it in the application ? Its strange. Its a pure python program. Its as you said, python 2.2.2 is leaking. I can not use python 2.3 because its not yet packaged by activestate for the moment. Kamel Thanks -----Original Message----- From: Jeremy Kloth [mailto:jeremy.kloth@fourthought.com] Sent: Friday, July 18, 2003 7:38 PM To: xml-sig@python.org Subject: [XML-SIG] Pyexpat memory leak I've checked in fixes for pyexpat which solve a refcount issue when passing an instance to ParseFile. The readmethod wasn't being decref'ed before exit of that function. -- Jeremy Kloth Fourthought, Inc. _______________________________________________ XML-SIG maillist - XML-SIG@python.org http://mail.python.org/mailman/listinfo/xml-sig From kamel.hamard at ericsson.com Sun Jul 20 13:26:52 2003 From: kamel.hamard at ericsson.com (Kamel Hamard (LMC)) Date: Sun Jul 20 12:31:16 2003 Subject: [XML-SIG] Pyexpat memory leak Message-ID: <2DBF697D5B36014ABA46E66A96107DA0720549@lmc37.lmc.ericsson.se> Hi Jeremy, I think I found what is causing the leak. After adding a small method using Evaluate method, I observe a leak. I my application I'm using this method to find element in XML dom. Take a look at the new version of my script and you will see a leak. Its why I dont have any leak in python 2.2.2 but when I use the method the problem reapear again. Here is the script Thanks Kamel -----Original Message----- From: Jeremy Kloth [mailto:jeremy.kloth@fourthought.com] Sent: Friday, July 18, 2003 7:38 PM To: xml-sig@python.org Subject: [XML-SIG] Pyexpat memory leak I've checked in fixes for pyexpat which solve a refcount issue when passing an instance to ParseFile. The readmethod wasn't being decref'ed before exit of that function. -- Jeremy Kloth Fourthought, Inc. _______________________________________________ XML-SIG maillist - XML-SIG@python.org http://mail.python.org/mailman/listinfo/xml-sig -------------- next part -------------- A non-text attachment was scrubbed... Name: 4suite.py Type: application/octet-stream Size: 4351 bytes Desc: not available Url : http://mail.python.org/pipermail/xml-sig/attachments/20030720/96420ccb/4suite.obj From martin at v.loewis.de Sun Jul 20 22:41:59 2003 From: martin at v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: Sun Jul 20 17:42:01 2003 Subject: [XML-SIG] CVS Version of PyXML In-Reply-To: <2DBF697D5B36014ABA46E66A96107DA0720547@lmc37.lmc.ericsson.se> References: <2DBF697D5B36014ABA46E66A96107DA0720547@lmc37.lmc.ericsson.se> Message-ID: "Kamel Hamard (LMC)" writes: > I'm looking on CVS version of PyXML. See https://sourceforge.net/projects/pyxml, and follow the CVS links at the bottom. Regards, Martin From sdixon at vocam.com Mon Jul 21 12:19:29 2003 From: sdixon at vocam.com (stib) Date: Sun Jul 20 21:19:37 2003 Subject: [XML-SIG] problem installing XML Message-ID: <602489E6-BB19-11D7-9644-0003930A96AE@vocam.com> I'm not 100% sure what I'm doing here, but this is as far as I can get installing pyXML on an OSX machine: [G4:~/downloads/PyXML-0.8.2] stib% python setup.py build Traceback (most recent call last): File "setup.py", line 58, in ? if sys.platform[:6] == "darwin" and \ NameError: name 'distutils' is not defined my version of python is 2.2.2-2 get back to me if there's something you can help me with, otherwise, keep up the good work. -stephen From jasj at miller.cs.uwm.edu Sun Jul 20 22:08:39 2003 From: jasj at miller.cs.uwm.edu (Jason Michael Jurkowski) Date: Sun Jul 20 22:08:43 2003 Subject: [XML-SIG] problem installing XML In-Reply-To: <602489E6-BB19-11D7-9644-0003930A96AE@vocam.com> Message-ID: i explain how to fix this in: http://mail.python.org/pipermail/xml-sig/2003-March/009181.html i would have expected someone would have checked in a fix. it seems a lot of people run into this. jason On Mon, 21 Jul 2003, stib wrote: > I'm not 100% sure what I'm doing here, but this is as far as I can get > installing pyXML on an OSX machine: > > [G4:~/downloads/PyXML-0.8.2] stib% python setup.py build > Traceback (most recent call last): > File "setup.py", line 58, in ? > if sys.platform[:6] == "darwin" and \ > NameError: name 'distutils' is not defined > > my version of python is 2.2.2-2 > get back to me if there's something you can help me with, otherwise, > keep up the good work. > > -stephen > > > _______________________________________________ > XML-SIG maillist - XML-SIG@python.org > http://mail.python.org/mailman/listinfo/xml-sig > From cybersamurai at mac.com Mon Jul 21 00:22:43 2003 From: cybersamurai at mac.com (cybersamurai@mac.com) Date: Sun Jul 20 22:20:14 2003 Subject: [XML-SIG] XML documentation Message-ID: <359178A8-BB22-11D7-B454-000393B10A78@mac.com> I need know here I can find documentation about XML and Python. I know How read and write a new XML file but I don't know edit. From kamel.hamard at ericsson.com Mon Jul 21 09:51:30 2003 From: kamel.hamard at ericsson.com (Kamel Hamard (LMC)) Date: Mon Jul 21 08:55:49 2003 Subject: [XML-SIG] CVS Version of PyXML Message-ID: <2DBF697D5B36014ABA46E66A96107DA072054E@lmc37.lmc.ericsson.se> Hi, I used the following command to access to the pyxml source code in CVS : cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/pyxml login I'm getting the message: Logging in to :pserver:anonymous@cvs.sourceforge.net:2401/cvsroot/pyxml CVS password: and it hangs there. I need to access to the source to get Jeremy's fixes on Pyxml. For 4suite I'm able to get the gtar after the nigthly build, is it possible to do the same thing with pyxml? What a bout releasing a new official version for Pyxml and 4suite including the fixes ? Regards Kamel -----Original Message----- From: martin@v.loewis.de [mailto:martin@v.loewis.de] Sent: Sunday, July 20, 2003 5:42 PM To: Kamel Hamard (QC/LMC) Cc: xml-sig@python.org Subject: Re: [XML-SIG] CVS Version of PyXML "Kamel Hamard (LMC)" writes: > I'm looking on CVS version of PyXML. See https://sourceforge.net/projects/pyxml, and follow the CVS links at the bottom. Regards, Martin From fdrake at acm.org Mon Jul 21 14:08:11 2003 From: fdrake at acm.org (Fred L. Drake, Jr.) Date: Mon Jul 21 13:39:26 2003 Subject: [XML-SIG] Pyexpat memory leak In-Reply-To: <00f801c34d85$9d3aa040$f701a8c0@zeus> References: <00f801c34d85$9d3aa040$f701a8c0@zeus> Message-ID: <16156.7675.799715.766722@grendel.zope.com> Jeremy Kloth writes: > I've checked in fixes for pyexpat which solve a refcount issue when passing > an instance to ParseFile. The readmethod wasn't being decref'ed before exit > of that function. Thanks! I've added the patch to the pyexpat in Python's CVS, so this fix will appear in Python 2.3. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From kamel.hamard at ericsson.com Mon Jul 21 15:08:51 2003 From: kamel.hamard at ericsson.com (Kamel Hamard (LMC)) Date: Mon Jul 21 14:40:05 2003 Subject: [XML-SIG] Pyexpat memory leak Message-ID: <2DBF697D5B36014ABA46E66A96107DA0720554@lmc37.lmc.ericsson.se> Hi Fred, How I can get the fix now? I need to incorporate it in the current version of pyxml I installalled in my environment. I tryed to access with CVS to the source code but without success. Is it possible to get the gz file of pyxml with the fix from somewhere? Thanks Kamel -----Original Message----- From: Fred L. Drake, Jr. [mailto:fdrake@acm.org] Sent: Monday, July 21, 2003 1:08 PM To: Jeremy Kloth Cc: xml-sig@python.org Subject: Re: [XML-SIG] Pyexpat memory leak Jeremy Kloth writes: > I've checked in fixes for pyexpat which solve a refcount issue when passing > an instance to ParseFile. The readmethod wasn't being decref'ed before exit > of that function. Thanks! I've added the patch to the pyexpat in Python's CVS, so this fix will appear in Python 2.3. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation _______________________________________________ XML-SIG maillist - XML-SIG@python.org http://mail.python.org/mailman/listinfo/xml-sig From fdrake at acm.org Mon Jul 21 15:44:08 2003 From: fdrake at acm.org (Fred L. Drake, Jr.) Date: Mon Jul 21 14:44:46 2003 Subject: [XML-SIG] Pyexpat memory leak In-Reply-To: <2DBF697D5B36014ABA46E66A96107DA0720554@lmc37.lmc.ericsson.se> References: <2DBF697D5B36014ABA46E66A96107DA0720554@lmc37.lmc.ericsson.se> Message-ID: <16156.13432.828415.413321@grendel.zope.com> Kamel Hamard (LMC) writes: > How I can get the fix now? > > I need to incorporate it in the current version of pyxml I installalled in my environment. > I tryed to access with CVS to the source code but without success. > > Is it possible to get the gz file of pyxml with the fix from somewhere? If you have a version of the patch program, you can simply apply Jeremy's patch directly to the file extensions/pyexpat.c that came with your PyXML sources, and re-build and re-install. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From martin at v.loewis.de Mon Jul 21 23:32:31 2003 From: martin at v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: Mon Jul 21 18:32:32 2003 Subject: [XML-SIG] CVS Version of PyXML In-Reply-To: <2DBF697D5B36014ABA46E66A96107DA072054E@lmc37.lmc.ericsson.se> References: <2DBF697D5B36014ABA46E66A96107DA072054E@lmc37.lmc.ericsson.se> Message-ID: "Kamel Hamard (LMC)" writes: > I'm getting the message: > Logging in to :pserver:anonymous@cvs.sourceforge.net:2401/cvsroot/pyxml > CVS password: > > and it hangs there. Please try again repeatedly, e.g. once every minute. SF has access problems due to overload, but if you persist, you should succeed. > > I need to access to the source to get Jeremy's fixes on Pyxml. For > 4suite I'm able to get the gtar after the nigthly build, is it > possible to do the same thing with pyxml? Sorry, I don't have the time to set that up. > What a bout releasing a new official version for Pyxml and 4suite > including the fixes ? I'll do so when I find the time (atleast for PyXML; I can't speak for 4suite) Regards, Martin From jeremiah at facility9.com Wed Jul 23 09:08:10 2003 From: jeremiah at facility9.com (Jeremiah McElroy) Date: Wed Jul 23 08:08:43 2003 Subject: [XML-SIG] WebServices Tutorial Message-ID: <3F1E7AAA.9020109@facility9.com> I have been searching on Google in a vain attempt to find a decent tutorial on using either SOAP.py or ZSI. I've found the IBM DeveloperWorks tutorials, however they do not offer everything that I am looking for. While the tutorials cover how to access a web service that returns a single item, they do not cover how one might go about interacting with a web service that returns a complex dataset (such as a strongly typed DataSet from a .NET web service). Nor do they go over how to create a web service that can return a strongly typed dataset or go over the creation of WSDL. Thanks in advance for the help, Jeremiah McElroy From rsalz at datapower.com Thu Jul 24 13:40:11 2003 From: rsalz at datapower.com (Rich Salz) Date: Thu Jul 24 12:40:15 2003 Subject: [XML-SIG] libxml python bindings and other python DOM's Message-ID: <3F200BEB.9010301@datapower.com> Has anyone looked at what it would take to use the Gnome libxml python bindings as a drop-in for 4dom, minidom, etc? /r$ From veillard at redhat.com Thu Jul 24 14:55:33 2003 From: veillard at redhat.com (Daniel Veillard) Date: Thu Jul 24 13:55:39 2003 Subject: [XML-SIG] libxml python bindings and other python DOM's In-Reply-To: <3F200BEB.9010301@datapower.com>; from rsalz@datapower.com on Thu, Jul 24, 2003 at 12:40:11PM -0400 References: <3F200BEB.9010301@datapower.com> Message-ID: <20030724135533.C4835@redhat.com> On Thu, Jul 24, 2003 at 12:40:11PM -0400, Rich Salz wrote: > Has anyone looked at what it would take to use the Gnome libxml python > bindings as a drop-in for 4dom, minidom, etc? I would appreciate API description, suggestions or even patches toward getting a unified platform I could conform too. Daniel -- Daniel Veillard | Red Hat Network https://rhn.redhat.com/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ From krjackson at lbl.gov Thu Jul 24 12:13:18 2003 From: krjackson at lbl.gov (Keith Jackson) Date: Thu Jul 24 14:13:37 2003 Subject: [XML-SIG] WebServices Tutorial In-Reply-To: <3F1E7AAA.9020109@facility9.com> Message-ID: <80493A4C-BE02-11D7-BA06-000A9577489A@lbl.gov> Jeremiah, I don't think there is such a tutorial. We're in the process of adding code into zsi to automatically generate bindings to web services given a wsdl file. This works with .Net services and generates the proper ZSI type codes and python classes to wrap them. While the code currently works, it is going to be a bit before we have it integrated into zsi and write some docs. --keith On Wednesday, July 23, 2003, at 05:08 AM, Jeremiah McElroy wrote: > I have been searching on Google in a vain attempt to find a decent > tutorial on using either SOAP.py or ZSI. I've found the IBM > DeveloperWorks tutorials, however they do not offer everything that I > am looking for. > While the tutorials cover how to access a web service that returns a > single item, they do not cover how one might go about interacting with > a web service that returns a complex dataset (such as a strongly typed > DataSet from a .NET web service). Nor do they go over how to create a > web service that can return a strongly typed dataset or go over the > creation of WSDL. > > Thanks in advance for the help, > > Jeremiah McElroy > > > _______________________________________________ > XML-SIG maillist - XML-SIG@python.org > http://mail.python.org/mailman/listinfo/xml-sig From martin at v.loewis.de Thu Jul 24 19:28:44 2003 From: martin at v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: Thu Jul 24 14:28:45 2003 Subject: [XML-SIG] libxml python bindings and other python DOM's In-Reply-To: <20030724135533.C4835@redhat.com> References: <3F200BEB.9010301@datapower.com> <20030724135533.C4835@redhat.com> Message-ID: Daniel Veillard writes: > I would appreciate API description, suggestions or even patches toward > getting a unified platform I could conform too. SAX: http://www.python.org/doc/current/lib/module-xml.sax.html http://www.python.org/doc/current/lib/module-xml.sax.handler.html http://www.python.org/doc/current/lib/module-xml.sax.xmlreader.html DOM: http://www.python.org/doc/current/lib/module-xml.dom.html Regards, Martin From paul.boddie at ementor.no Fri Jul 25 14:15:43 2003 From: paul.boddie at ementor.no (paul.boddie@ementor.no) Date: Fri Jul 25 07:16:20 2003 Subject: [XML-SIG] libxml python bindings and other python DOM's Message-ID: Rich Salz [mailto:rsalz@datapower.com] wrote: > > Has anyone looked at what it would take to use the Gnome libxml python > bindings as a drop-in for 4dom, minidom, etc? After seeing how fast libxml2 was, I gave it some consideration - it isn't that hard to write some elementary DOM wrapper classes, after all. However, for my purposes I rapidly discovered that libxml2's handling of namespaces was somewhat different to minidom/cDomlette, and whilst it could be me who has previously misunderstood the nuances of namespaces (see Andrew Clover's chart for a slight indication of how inconsistencies between implementations might promote such misunderstanding), I decided to reprioritize the work until I could have a proper look at it. I don't have my experiments in front of me, unfortunately, but I can dig some code out which illustrates my confusion, if necessary. Paul From veillard at redhat.com Fri Jul 25 11:57:35 2003 From: veillard at redhat.com (Daniel Veillard) Date: Fri Jul 25 10:57:41 2003 Subject: [XML-SIG] libxml python bindings and other python DOM's In-Reply-To: ; from paul.boddie@ementor.no on Fri, Jul 25, 2003 at 01:15:43PM +0200 References: Message-ID: <20030725105735.F18145@redhat.com> On Fri, Jul 25, 2003 at 01:15:43PM +0200, paul.boddie@ementor.no wrote: > After seeing how fast libxml2 was, I gave it some consideration - it isn't > that hard to write some elementary DOM wrapper classes, after all. However, > for my purposes I rapidly discovered that libxml2's handling of namespaces > was somewhat different to minidom/cDomlette, and whilst it could be me who libxml2 tree support only generate nodes for namespace declarations. It does not generate equivalent attribute node. When an attribute or an element uses a namespace there is a reference to the associated namespace declaration. This is more memory efficient, the drawback is that to create a namespaced node you need to have a reference to the namespace declaration node handy. This makes pure DOM implementation a bit more complex than a pure straighforward libxml2 API call. Daniel -- Daniel Veillard | Red Hat Network https://rhn.redhat.com/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ From paul.boddie at ementor.no Fri Jul 25 18:10:18 2003 From: paul.boddie at ementor.no (paul.boddie@ementor.no) Date: Fri Jul 25 11:10:53 2003 Subject: [XML-SIG] libxml python bindings and other python DOM's Message-ID: Daniel Veillard [mailto:veillard@redhat.com] wrote: > > libxml2 tree support only generate nodes for namespace declarations. > It does not generate equivalent attribute node. When an attribute or an > element uses a namespace there is a reference to the associated > namespace declaration. This didn't affect me, though. I would have to look at the exact problem that I experienced to be able to comment thoroughly, I'm afraid. However, it could be that I just didn't understand the API well enough, since I managed to try out some code which did exactly what I had in mind (and what I thought might have been the problem). For example: >>> s = """""" >>> from xml.dom.minidom import parseString >>> from libxml2 import parseDoc >>> doc = parseDoc(s) >>> doc2 = parseString(s) >>> doc.children.children.nsProp("attr", "http://www.test.org") 'horse' >>> doc2.childNodes[0].childNodes[0].getAttributeNS("http://www.test.org", "attr") u'horse' >>> doc.children.children.ns().content 'http://www.test.org' >>> doc2.childNodes[0].childNodes[0].namespaceURI u'http://www.test.org' I don't believe that I have much more sophisticated usage of namespaces than that. The only other exotic thing that caused me DOM portability issues was importNode, so that might be something to consider (ie. how it is done with the libxml2 API). Anyway, I'll try and take a look at all this and report back later, because libxml2 seems to be widely deployed/available and fast. Getting some level of XPath API unification would also be rather nice. Paul From dieter at handshake.de Fri Jul 25 22:51:34 2003 From: dieter at handshake.de (Dieter Maurer) Date: Fri Jul 25 16:36:56 2003 Subject: [XML-SIG] libxml python bindings and other python DOM's In-Reply-To: <3F200BEB.9010301@datapower.com> References: <3F200BEB.9010301@datapower.com> Message-ID: <16161.35398.831398.608075@gargle.gargle.HOWL> Rich Salz wrote at 2003-7-24 12:40 -0400: > Has anyone looked at what it would take to use the Gnome libxml python > bindings as a drop-in for 4dom, minidom, etc? I recently checked whether the XPath and XSLT support of "libxml2/libxslt" could be used with a Python based DOM. The (almost sure) answer has been: "no, they work only with the 'libxml2' DOM". Our DOM/XPath/XSLT implementations are more flexible (though probably much slower) than the ones of "libxml". But, almost surely, you are not interested in this but to take "libxml" for parsing and build our DOM structures from this process. Dieter From rsalz at datapower.com Fri Jul 25 18:51:28 2003 From: rsalz at datapower.com (Rich Salz) Date: Fri Jul 25 17:51:32 2003 Subject: [XML-SIG] libxml python bindings and other python DOM's In-Reply-To: <16161.35398.831398.608075@gargle.gargle.HOWL> Message-ID: > But, almost surely, you are not interested in this but to > take "libxml" for parsing and build our DOM structures from > this process. Yes. Or something close enough that ZSI (pywebsvcs.sf.net) can use. /r$ -- Rich Salz Chief Security Architect DataPower Technology http://www.datapower.com XS40 XML Security Gateway http://www.datapower.com/products/xs40.html XML Security Overview http://www.datapower.com/xmldev/xmlsecurity.html From uche.ogbuji at fourthought.com Sat Jul 26 09:18:17 2003 From: uche.ogbuji at fourthought.com (Uche Ogbuji) Date: Sat Jul 26 10:19:18 2003 Subject: [XML-SIG] how to get xml parse with non ascii charset In-Reply-To: Message from martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) of "05 Jul 2003 10:34:55 +0200." Message-ID: <20030726141823.23AAB1340AC@borgia.local> > Dieter Maurer writes: > > > XML processing systems (such as the parser "Expat") are only required > > to support UTF-8 (and maybe UTF-16) encodings. All other > > encodings are optional. > > > > Apparently, "Expat" does not support "gb2312". > > Correct. pyexpat only supports single-byte encodings, and UTF-8. If > you want to use other encodings with PyXML, you will have to use > xmlproc. FWIW, 4Suite's Domlettes extend Expat's built-in decoders by using the Python codec for unknown encodings. This means that as long as you have a Python codec named "gb2312" installed, that your document should parse OK. If you want to give it a try, see http://www.xml.com/pub/a/2002/10/16/py-xml.html http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/domlettes for intros to Domlette. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com XML Data Bindings in Python, Part 2 - http://www.xml.com/pub/a/2003/07/02/py-xm l.html Introducing Examplotron - http://www-106.ibm.com/developerworks/xml/library/x-x mptron/ Charming Jython - http://www-106.ibm.com/developerworks/java/library/j-jython.h tml Python, Web services, and XSLT - http://www-106.ibm.com/developerworks/xml/libr ary/ws-pyth13/ A custom-fit career in app development - http://www.adtmag.com/article.asp?id=7 744 From uche.ogbuji at fourthought.com Sat Jul 26 09:25:30 2003 From: uche.ogbuji at fourthought.com (Uche Ogbuji) Date: Sat Jul 26 10:26:55 2003 Subject: [XML-SIG] Where is the documentation? In-Reply-To: Message from Luiz Siqueira Neto of "Fri, 18 Jul 2003 13:47:23 -0300." <200307181347.23293.cybersamurai@mac.com> Message-ID: <20030726142535.7F6231340AC@borgia.local> > I can't find information about how use XPath with Python and documentation > about DOM and SAX. http://www.xml.com/pub/a/2002/09/25/py.html http://www.xml.com/pub/a/2002/10/16/py-xml.html http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/dom http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/sax http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/python-xpath http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/domlettes http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/basic-xpath In general: http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/pyxml-akara Good luck. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com XML Data Bindings in Python, Part 2 - http://www.xml.com/pub/a/2003/07/02/py-xm l.html Introducing Examplotron - http://www-106.ibm.com/developerworks/xml/library/x-x mptron/ Charming Jython - http://www-106.ibm.com/developerworks/java/library/j-jython.h tml Python, Web services, and XSLT - http://www-106.ibm.com/developerworks/xml/libr ary/ws-pyth13/ A custom-fit career in app development - http://www.adtmag.com/article.asp?id=7 744 From uche.ogbuji at fourthought.com Sat Jul 26 09:57:10 2003 From: uche.ogbuji at fourthought.com (Uche Ogbuji) Date: Sat Jul 26 11:00:31 2003 Subject: [XML-SIG] XML documentation In-Reply-To: Message from cybersamurai@mac.com of "Sun, 20 Jul 2003 23:22:43 -0300." <359178A8-BB22-11D7-B454-000393B10A78@mac.com> Message-ID: <20030726145716.1702B1340AC@borgia.local> > I need know here I can find documentation about XML and Python. I know > How read and write a new XML file but I don't know edit. I offer: http://www.xml.com/pub/q/pyxml http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/pyxml-akara -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com XML Data Bindings in Python, Part 2 - http://www.xml.com/pub/a/2003/07/02/py-xm l.html Introducing Examplotron - http://www-106.ibm.com/developerworks/xml/library/x-x mptron/ Charming Jython - http://www-106.ibm.com/developerworks/java/library/j-jython.h tml Python, Web services, and XSLT - http://www-106.ibm.com/developerworks/xml/libr ary/ws-pyth13/ A custom-fit career in app development - http://www.adtmag.com/article.asp?id=7 744 From martin at v.loewis.de Mon Jul 28 07:43:56 2003 From: martin at v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: Mon Jul 28 02:43:57 2003 Subject: [XML-SIG] Preparing 0.8.3 Message-ID: I'm going to release PyXML 0.8.3 later this week. If you want to include any additional changes, please commit them now. Regards, Martin From paul.boddie at ementor.no Mon Jul 28 11:03:39 2003 From: paul.boddie at ementor.no (paul.boddie@ementor.no) Date: Mon Jul 28 04:04:20 2003 Subject: [XML-SIG] Preparing 0.8.3 Message-ID: Martin v. L?wis [mailto:martin@v.loewis.de] wrote: > > I'm going to release PyXML 0.8.3 later this week. If you want to > include any additional changes, please commit them now. It would be great if patch #721163 could get reviewed and included, especially since it's a one-liner. Even if XPath isn't a priority, a fix in that area would at least keep the support a bit more usable - it's a bit embarrassing not to be able to do "//element/subelement" without patching the sources. Paul From martin at v.loewis.de Mon Jul 28 21:55:52 2003 From: martin at v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: Mon Jul 28 16:55:54 2003 Subject: [XML-SIG] Preparing 0.8.3 In-Reply-To: References: Message-ID: writes: > It would be great if patch #721163 could get reviewed and included, > especially since it's a one-liner. Even if XPath isn't a priority, a fix in > that area would at least keep the support a bit more usable - it's a bit > embarrassing not to be able to do "//element/subelement" without patching > the sources. I feel very uncomfortable with unjustified changes, i.e. changes for which there is no test case which fails without the change, but passes with the change. So unless you can demonstrate a problem in the next few days, I'll likely ignore the patch for now - only to reject it later if still not test case materializes. Regards, Martin From blais at iro.umontreal.ca Tue Jul 29 00:07:44 2003 From: blais at iro.umontreal.ca (Martin Blais) Date: Mon Jul 28 23:07:31 2003 Subject: [XML-SIG] disabling catalog support Message-ID: <3F25E500.4060509@iro.umontreal.ca> hi is there a quick way to disable the catalog parsing in PyXML? i've got code that doesn't need catalogs for parsing but since updating to the new version of PyXML it doesn't work anymore (code trying to fetch DTD file from the internet, machine not connected to internet, don't want to setup catalog from python code...) thanks. p.s. please Cc i'm not on the list. From martin at v.loewis.de Tue Jul 29 05:45:12 2003 From: martin at v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: Tue Jul 29 00:45:57 2003 Subject: [XML-SIG] disabling catalog support In-Reply-To: <3F25E500.4060509@iro.umontreal.ca> References: <3F25E500.4060509@iro.umontreal.ca> Message-ID: Martin Blais writes: > is there a quick way to disable the catalog parsing in PyXML? > > i've got code that doesn't need catalogs for parsing but since > updating to the new version of PyXML it doesn't work anymore (code > trying to fetch DTD file from the internet, machine not connected to > internet, don't want to setup catalog from python code...) > thanks. It depends on the XML parser that you are using in the first place whether PyXML tries to parse the catalog. For example, sgmlop will never try that. Regards, Martin From tony.mcdonald at ncl.ac.uk Tue Jul 29 10:52:47 2003 From: tony.mcdonald at ncl.ac.uk (Tony McDonald) Date: Tue Jul 29 04:52:57 2003 Subject: [XML-SIG] Problems with elementtree and versions of python. Message-ID: Hi all, I've downloaded the elementtree module as it looks like a simpler way (for me anyhow) of navigating through XML documents. I'm having real problems with it though - and I think it's a python version thing. Eg using the code from http://online.effbot.org/2003_07_01_archive.htm#element-tricks-2 OS-X 10.2.6, python 2.3b2 PyXML 0.8.2 % python Python 2.3b2 (#3, Jul 3 2003, 22:26:01) [GCC 3.1 20020420 (prerelease)] on darwin Type "help", "copyright", "credits" or "license" for more information. Welcome to Lazy Python. Type "help LazyPython" for help. >>> ^D [506][tonymcd@saturn5 : Tue Jul 29 09:44] ~/python % python testrss.py FEED 'online.effbot.org' Traceback (most recent call last): File "testrss.py", line 50, in ? for item in feed: TypeError: 'NoneType' object is not callable Solaris 5.8, python 2.1.2, PyXML 0.6.5 (I believe that Uche, in his article on elementtree used 2.1.2) 213[9:48]nnle@caduceus-temp ~/python > python Python 2.1.3 (#3, May 3 2002, 16:46:21) [GCC 2.95.3 20010315 (release)] on sunos5 Type "copyright", "credits" or "license" for more information. Welcome to Lazy Python. Type "help LazyPython" for help. >>> 214[9:48]nnle@localhost ~/python > python testrss testrss.py testrss.py~ 214[9:48]nnle@localhost ~/python > python testrss.py FEED 'online.effbot.org' ITEM 'no observations' http://online.effbot.org#20030729 ITEM 'stupid element tricks, part 4 (PEA)' http://online.effbot.org#element-tricks-4 ITEM 'observations' http://online.effbot.org#20030728 ITEM 'stupid element tricks, part 3 (RSS 0.9)' http://online.effbot.org#element-tricks-3 ITEM 'the 2003 frank willison award for contributions to the python community' http://online.effbot.org#frank-willison-award ITEM 'stupid element tricks, part 2 (RSS 1.0)' http://online.effbot.org#element-tricks-2 ITEM 'stupid element tricks' http://online.effbot.org#element-tricks ITEM 'van rossum (and blokland) in new york times' http://online.effbot.org#letterror ITEM 'observations' http://online.effbot.org#20030724 ITEM 'observations' http://online.effbot.org#20030723 Solaris 5.8, python 2.2.3, PyXML 0.8.2 215[9:48]nnle@localhost ~/python > python2.2 Python 2.2.3 (#1, Jul 14 2003, 10:29:08) [GCC 2.95.3 20010315 (release)] on sunos5 Type "help", "copyright", "credits" or "license" for more information. >>> 216[9:48]nnle@localhost ~/python > python2.2 testrss.py FEED 'online.effbot.org' Traceback (most recent call last): File "testrss.py", line 50, in ? for item in feed: TypeError: 'NoneType' object is not callable I had thought initially that it may be a PyXML problem, but it seems it's deeper than that, and frankly, I have no idea how to take this any further... Any thoughts? Cheers, Tone. -- Dr Tony McDonald, Assistant Director, FMSC, http://www.fmcc.org.uk/ The Medical School, Newcastle University Tel: +44 191 245 4223 Project Manager, FDTL-4 Electronic Portfolios http://www.eportfolios.ac.uk A Zope list for UK HE/FE http://www.fmcc.org.uk/mailman/listinfo/zope From paul.boddie at ementor.no Tue Jul 29 12:40:09 2003 From: paul.boddie at ementor.no (paul.boddie@ementor.no) Date: Tue Jul 29 05:40:44 2003 Subject: [XML-SIG] Preparing 0.8.3 Message-ID: Martin v. L?wis [mailto:martin@v.loewis.de] wrote: > > I feel very uncomfortable with unjustified changes, i.e. changes for > which there is no test case which fails without the change, but passes > with the change. So unless you can demonstrate a problem in the next > few days, I'll likely ignore the patch for now - only to reject it > later if still not test case materializes. Yes, sorry about this. As my comments to the patch state, I couldn't reproduce what seemed to be a pretty pathological issue with Python 2.2.2 and PyXML 0.8.2. I suppose there could have been some interference between previously installed releases and/or 4Suite, but I thought I had been thorough in erasing all that stuff. Anyway, I'll keep trying - the patch made a lot of sense at the time. Paul From torsten.rueger at hiit.fi Wed Jul 30 11:11:06 2003 From: torsten.rueger at hiit.fi (Torsten Rueger) Date: Wed Jul 30 03:11:09 2003 Subject: [XML-SIG] Tiny XPath Message-ID: Moi, does anyone know of a pure python xpath implementation. It doesn't have to be 100%. Just small , pure python and working with minidom, Any pointers ? Torsten From martin at v.loewis.de Wed Jul 30 08:45:35 2003 From: martin at v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: Wed Jul 30 03:45:37 2003 Subject: [XML-SIG] Tiny XPath In-Reply-To: References: Message-ID: Torsten Rueger writes: > does anyone know of a pure python xpath implementation. It doesn't > have to be 100%. Just small , pure python and working with minidom, The one in PyXML is 100% pure, and works with minidom. Regards, Martin From noreply at sourceforge.net Wed Jul 30 02:35:44 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Jul 30 04:35:48 2003 Subject: [XML-SIG] [ pyxml-Bugs-780081 ] Installing 0.8.2 breaks xml.dom package (Python 2.3, OSX) Message-ID: Bugs item #780081, was opened at 2003-07-30 18:35 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=106473&aid=780081&group_id=6473 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Stuart Bishop (zenzen) Assigned to: Nobody/Anonymous (nobody) Summary: Installing 0.8.2 breaks xml.dom package (Python 2.3, OSX) Initial Comment: 0.8.2 builds and installs happily. However, 'import xml.dom' no longer works: Python 2.3c2+ (#12, Jul 25 2003, 12:58:00) [GCC 3.1 20020420 (prerelease)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import xml.dom Traceback (most recent call last): File "", line 1, in ? File "/Library/Frameworks/Python.framework/Versions/2.3/ lib/python2.3/site-packages/_xmlplus/dom/__init__.py", line 237, in ? import MessageSource File "/Library/Frameworks/Python.framework/Versions/2.3/ lib/python2.3/site-packages/_xmlplus/dom/ MessageSource.py", line 22, in ? gettext.install('4Suite', locale_dir) File "/Library/Frameworks/Python.framework/Versions/2.3/ lib/python2.3/gettext.py", line 428, in install translation(domain, localedir, fallback=True).install(unicode) File "/Library/Frameworks/Python.framework/Versions/2.3/ lib/python2.3/gettext.py", line 416, in translation t = _translations.setdefault(key, class_(open(mofile, 'rb'))) File "/Library/Frameworks/Python.framework/Versions/2.3/ lib/python2.3/gettext.py", line 176, in __init__ self._parse(fp) File "/Library/Frameworks/Python.framework/Versions/2.3/ lib/python2.3/gettext.py", line 304, in _parse tmsg = unicode(tmsg, self._charset) LookupError: unknown encoding: CHARSET >>> import xml.dom >>> Note that it works the second time you do 'import xml.dom' in that session Adding LookupError to the list of exceptions caught on line 22 of xml/dom/MessageSource.py seems to work around the problem (no idea if this breaks other stuff though). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=106473&aid=780081&group_id=6473 From torsten.rueger at hiit.fi Wed Jul 30 15:10:53 2003 From: torsten.rueger at hiit.fi (Torsten Rueger) Date: Wed Jul 30 07:17:38 2003 Subject: [XML-SIG] Tiny XPath In-Reply-To: Message-ID: <7C460316-C27E-11D7-8D2B-000A959C1BB0@hiit.fi> On Wednesday, Jul 30, 2003, at 10:45 Europe/Helsinki, Martin v. L?wis wrote: > > The one in PyXML is 100% pure, and works with minidom. > Thanks. Is there a way of installing just the xpath ? Also it seems to clash with Ft stuff and even I deleted that still does not work ? Torsten >>> import xml.xpath Traceback (most recent call last): File "", line 1, in ? File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site- packages/_xmlplus/xpath/__init__.py", line 23, in ? from xml.dom import Node File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site- packages/_xmlplus/dom/__init__.py", line 237, in ? import MessageSource File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site- packages/_xmlplus/dom/MessageSource.py", line 22, in ? gettext.install('4Suite', locale_dir) File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ gettext.py", line 428, in install translation(domain, localedir, fallback=True).install(unicode) File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ gettext.py", line 416, in translation t = _translations.setdefault(key, class_(open(mofile, 'rb'))) File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ gettext.py", line 176, in __init__ self._parse(fp) File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ gettext.py", line 304, in _parse tmsg = unicode(tmsg, self._charset) LookupError: unknown encoding: CHARSET From martin.vonloewis at hpi.uni-potsdam.de Wed Jul 30 16:48:20 2003 From: martin.vonloewis at hpi.uni-potsdam.de (Martin von Loewis) Date: Wed Jul 30 09:49:10 2003 Subject: [XML-SIG] PyXML 0.8.3 is released Message-ID: <3F27CCA4.3040707@hpi.uni-potsdam.de> Version 0.8.3 of the Python/XML distribution is now available. It should be considered a beta release, and can be downloaded from the following URLs: http://prdownloads.sourceforge.net/pyxml/PyXML-0.8.3.tar.gz http://prdownloads.sourceforge.net/pyxml/PyXML-0.8.3.win32-py2.2.exe http://prdownloads.sourceforge.net/pyxml/PyXML-0.8.3.win32-py2.3.exe http://prdownloads.sourceforge.net/pyxml/PyXML-0.8.3-2.2.Suse82.i386.rpm Changes in this version, compared to 0.8.2: * Fix memory leak in Expat bindings (content model information provided by Expat was not freed as required). * New convenience classes in the xml.ns module: ClosedNamespace, OpenNamespace. * The symbol "_" is no longer inserted into the built-in namespace via the gettext module; I18N support is no longer invasive. * expatreader now implements feature_namespace_prefixes. * drv_xmlproc now supports EntityResolvers that return system IDs. * Various bugs have been fixed: 677768: 0.8.2 setup.py errors on OS X 684522: ns_parse parsing error for ampersands in description field 696457: public/system ID swapped [in expatreader] 725010: Script text not contained in script element 728810: Forgotten print statement [in wddx] 733890: Memory Leak in expatparser.py 757799: Correct XmlWriter.processingInstruction() 765249: Problems building PyXML 0.8.2 on MacOSX 767130: Invalid charset breaks installation with Python 2.3(beta) [4DOM] 774091: minidom CharacterData string methods fail when offset=length 774095: minidom hasAttributes method only available on Element 774100: minidom removeAttributeNode return value 774104: minidom setNamedItem unlinks replaced attributes 774108: 4DOM setAttributeNode[NS] setting attribute already on node The Python/XML distribution contains the basic tools required for processing XML data using the Python programming language, assembled into one easy-to-install package. The distribution includes parsers and standard interfaces such as SAX and DOM, along with various other useful modules. The package currently contains: * XML parsers: Pyexpat (Jack Jansen), xmlproc (Lars Marius Garshol), sgmlop (Fredrik Lundh). * SAX interface (Lars Marius Garshol) * minidom DOM implementation (Paul Prescod, others) * 4DOM and 4XPath from Fourthought (Uche Ogbuji, Mike Olson) * Schema implementations: TREX (James Tauber) * Various utility modules and functions (various people) * Documentation and example programs (various people) The code is being developed bazaar-style by contributors from the Python XML Special Interest Group, so please send comments and questions to . Bug reports may be filed on SourceForge: http://sourceforge.net/tracker/index.php?group_id=6473&atid=106473 For more information about Python and XML, see: http://www.python.org/topics/xml/ -- Martin v. L?wis http://loewis.de/martin From torsten.rueger at hiit.fi Wed Jul 30 19:06:55 2003 From: torsten.rueger at hiit.fi (Torsten Rueger) Date: Wed Jul 30 11:07:00 2003 Subject: [XML-SIG] PyXML 0.8.3 is released In-Reply-To: <3F27CCA4.3040707@hpi.uni-potsdam.de> Message-ID: <7559D6D1-C29F-11D7-8D2B-000A959C1BB0@hiit.fi> On Wednesday, Jul 30, 2003, at 16:48 Europe/Helsinki, Martin von Loewis wrote: > Version 0.8.3 of the Python/XML distribution is now available. It > Great > 677768: 0.8.2 setup.py errors on OS X Good. I'm on 10.2.6 > 765249: Problems building PyXML 0.8.2 on MacOSX and it builds and installs but then I get this . >>> import xml.xpath Traceback (most recent call last): File "", line 1, in ? File "xml/xpath/__init__.py", line 105, in ? import Context File "xml/xpath/Context.py", line 15, in ? import CoreFunctions File "xml/xpath/CoreFunctions.py", line 20, in ? from xml.xpath import Util, Conversions File "xml/xpath/Conversions.py", line 22, in ? from xml.utils import boolean ImportError: cannot import name boolean >>> Any clues anyone ? Torsten From martin at v.loewis.de Wed Jul 30 18:47:10 2003 From: martin at v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: Wed Jul 30 13:47:11 2003 Subject: [XML-SIG] PyXML 0.8.3 is released In-Reply-To: <7559D6D1-C29F-11D7-8D2B-000A959C1BB0@hiit.fi> References: <7559D6D1-C29F-11D7-8D2B-000A959C1BB0@hiit.fi> Message-ID: Torsten Rueger writes: > Any clues anyone ? Can you tell whether the boolean module was built? Also, what Python version are you using? Regards, Martin From martin at v.loewis.de Wed Jul 30 18:50:56 2003 From: martin at v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: Wed Jul 30 13:50:57 2003 Subject: [XML-SIG] Tiny XPath In-Reply-To: <7C460316-C27E-11D7-8D2B-000A959C1BB0@hiit.fi> References: <7C460316-C27E-11D7-8D2B-000A959C1BB0@hiit.fi> Message-ID: Torsten Rueger writes: > > The one in PyXML is 100% pure, and works with minidom. > > > Thanks. Is there a way of installing just the xpath ? I think so. Just copy the xpath subdirectory. No guarantees, though. > Also it seems to clash with Ft stuff and even I deleted that still > does not work ? It shouldn't clash with Ft stuff. > LookupError: unknown encoding: CHARSET Please try 0.8.3. Regards, Martin From fredrik at pythonware.com Thu Jul 31 02:01:57 2003 From: fredrik at pythonware.com (Fredrik Lundh) Date: Wed Jul 30 19:03:37 2003 Subject: [XML-SIG] Re: Problems with elementtree and versions of python. References: Message-ID: Tony McDonald wrote: > I'm having real problems with it though - and I think it's a python version > thing. > > Eg using the code from > http://online.effbot.org/2003_07_01_archive.htm#element-tricks-2 it took me a while to figure it out, but it's a bug in the ElementWrapper sample, not in the ElementTree library. changing the ElementWrapper __getattr__ code from def __getattr__(self, tag): return self._element.findtext(self._ns + tag) to def __getattr__(self, tag): if tag.startswith("__"): raise AttributeError(tag) return self._element.findtext(self._ns + tag) should help. From fredrik at pythonware.com Thu Jul 31 10:39:05 2003 From: fredrik at pythonware.com (Fredrik Lundh) Date: Thu Jul 31 03:39:21 2003 Subject: [XML-SIG] ANN: ElementTree 1.2 alpha 2, ElementTidy 1.0 alpha 1 Message-ID: The Element type is a simple but flexible container object, designed to store hierarchical data structures, such as simplified XML infosets, in memory. The ElementTree package provides a Python implementation of this type, plus code to serialize element trees to and from XML files. The 1.2 alpha 2 release fixes some minor issues (most notably, nicer serialization of the "xml" default namespace). You can get the ElementTree toolkit from: http://effbot.org/downloads Brief documentation and some code samples (including an XML-RPC unmarshaller in 16 lines) are available from: http://effbot.org/zone/element-index.htm If you want more sample code, my blog currently features a number of short articles on parsing stuff with element trees (the first four all deal with RSS and RSS-like formats): http://online.effbot.org/2003_07_01_archive.htm#element-tricks In a related release, the ElementTidy library provides an alternative tree builder that can read (almost) arbitrary HTML, and turn it into well-formed XHTML element trees. The ElementTidy library uses a library versions of Dave Raggett's HTML Tidy utility to do the clean- up (source code is included), and does not rely on external utilities. http://effbot.org/downloads http://effbot.org/zone/element-tidylib.htm Report bugs to this list, and/or (preferred) directly to me. enjoy /F From carroll at tjc.com Thu Jul 31 09:00:38 2003 From: carroll at tjc.com (Terry Carroll) Date: Thu Jul 31 11:00:47 2003 Subject: [XML-SIG] Re: [Tutor] XML documentation In-Reply-To: <359178A8-BB22-11D7-B454-000393B10A78@mac.com> Message-ID: On Sun, 20 Jul 2003 cybersamurai@mac.com wrote: > I need know here I can find documentation about XML and Python. I know > How read and write a new XML file but I don't know edit. I really liked the O'Reilly book: http://www.amazon.com/exec/obidos/tg/detail/-/0596001282 http://www.oreilly.com/catalog/pythonxml/ -- Terry Carroll | "I say to you that the VCR is to the American Santa Clara, CA | film producer and the American public as the carroll@tjc.com | Boston strangler is to the woman home alone." | Jack Valenti, MPAA President Modell delendus est | Testimony before Congress, 1982