From wqh-2@263.net Wed Aug 1 09:04:43 2001 From: wqh-2@263.net (sdf) Date: Wed, 1 Aug 2001 16:04:43 +0800 (CST) Subject: [XML-SIG] newbie to this:from xml.dom.ext import PrettyPrint Message-ID: <3B67B81B.28336@mta6> I want to use appendchild method,and I see many examples,but all of the need this sentence: from xml.dom.ext import PrettyPrint and my python do not have this module,whether should I get it. In addition,the python document tell the function of appendchild,I think this mean I can use it without other non-standard module,why the example need others please post an example which use appendchild __________________________________________ DVD´óƬ£¬Ò»ÂÉ10Ôª http://shopping.263.net/category02.htm ÃÀÈÝÑøÑÕ¡¢¼õ·ÊÊÝÉíÃؾ÷ http://shopping.263.net/category10.htm From fdrake@acm.org Wed Aug 1 13:50:15 2001 From: fdrake@acm.org (Fred L. Drake, Jr.) Date: Wed, 1 Aug 2001 08:50:15 -0400 (EDT) Subject: [XML-SIG] newbie to this:from xml.dom.ext import PrettyPrint In-Reply-To: <3B67B81B.28336@mta6> References: <3B67B81B.28336@mta6> Message-ID: <15207.64263.874193.272160@cj42289-a.reston1.va.home.com> sdf writes: > I want to use appendchild method,and I see many examples,but all of > the need this sentence: > from xml.dom.ext import PrettyPrint > and my python do not have this module,whether should I get it. xml.dom.ext.PrettyPrint is *not* part of the standard library for Python; it is available as part of PyXML. PyXML is a substantial extension to the code in the standard library, and can be very useful. It is available at: http://pyxml.sourceforge.net/ > In addition,the python document tell the function of appendchild,I > think this mean I can use it without other non-standard module,why > the example need others appendChild() is part of the Python DOM API, and can be used with the DOMs returned by the functions in xml.dom.minidom, which is part of the standard distribution. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From fredrik@pythonware.com Wed Aug 1 16:15:36 2001 From: fredrik@pythonware.com (Fredrik Lundh) Date: Wed, 1 Aug 2001 17:15:36 +0200 Subject: [XML-SIG] problems building pyXML for cygwin References: <003e01c119e3$85d69df0$e0061812@CREST> Message-ID: <026401c11a9c$f1cabaa0$4ffa42d5@hagrid> hi tim, > I tried installing pyXML under cygwin. Any ideas why it didn't? I haven't > looked into it in any detail. Python is: > Python 2.1 (#1, Apr 17 2001, 09:45:01) [GCC 2.95.3-2 (cygwin special)] on > cygwin_nt-4.01 > gcc -shared -Wl,--enable-auto-image-base > build/temp.cygwin_nt-5.0-1.3.2-i686-2.1/sgmlop.o -L/usr/lib > /python2.1/config -lpython2.1 -o > build/lib.cygwin_nt-5.0-1.3.2-i686-2.1/_xmlplus/parsers/sgmlop.dll > Cannot export _bss_end__: symbol not defined > Cannot export _bss_start__: symbol not defined > Cannot export _data_end__: symbol not defined > Cannot export _data_start__: symbol not defined > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 if I understand things correctly, cygwin's gcc gives you this error if a dynamic library doesn't export any symbols at all. somewhere in the middle of the sgmlop.c source file, try replacing void #ifdef WIN32 __declspec(dllexport) #endif initsgmlop() with DL_EXPORT(void) initsgmlop(void) hope this helps! regards /F From loewis@informatik.hu-berlin.de Wed Aug 1 16:30:17 2001 From: loewis@informatik.hu-berlin.de (Martin von Loewis) Date: Wed, 1 Aug 2001 17:30:17 +0200 Subject: [XML-SIG] Preparing 0.6.6 Message-ID: <200108011530.f71FUHv05835@artagnan.informatik.hu-berlin.de> I will release PyXML 0.6.6 at the end of this week. If you have any further changes to make, please let me know. Regards, Martin From Alexandre.Fayolle@logilab.fr Wed Aug 1 17:19:47 2001 From: Alexandre.Fayolle@logilab.fr (Alexandre Fayolle) Date: Wed, 1 Aug 2001 18:19:47 +0200 (CEST) Subject: [XML-SIG] Preparing 0.6.6 In-Reply-To: <200108011530.f71FUHv05835@artagnan.informatik.hu-berlin.de> Message-ID: On Wed, 1 Aug 2001, Martin von Loewis wrote: > I will release PyXML 0.6.6 at the end of this week. If you have any > further changes to make, please let me know. Could patch #442672 be considered for inclusion in 0.6.6 ? Alexandre Fayolle -- LOGILAB, Paris (France). http://www.logilab.com http://www.logilab.fr http://www.logilab.org Narval, the first software agent available as free software (GPL). From noreply@sourceforge.net Wed Aug 1 17:37:48 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 01 Aug 2001 09:37:48 -0700 Subject: [XML-SIG] [ pyxml-Patches-446834 ] sax2 drivers for sgmlop Message-ID: Patches item #446834, was opened at 2001-08-01 09:37 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=306473&aid=446834&group_id=6473 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Alexandre Fayolle (afayolle) Assigned to: Nobody/Anonymous (nobody) Summary: sax2 drivers for sgmlop Initial Comment: The attached tarball holds a sax2 driver for parsing XML files using sgmlop, and a sax2 driver for parsing html files using sgmlop. The latter will use the HTML 4.0 DTD to try to handle missing closing tags and missing elements in the source. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=306473&aid=446834&group_id=6473 From rsalz@zolera.com Wed Aug 1 17:47:58 2001 From: rsalz@zolera.com (Rich Salz) Date: Wed, 01 Aug 2001 12:47:58 -0400 Subject: [XML-SIG] Attribute value normalization Message-ID: <3B6832BE.DD00C4DD@zolera.com> This is a multi-part message in MIME format. --------------BBADBC984C75C67D206A3405 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I'm using PyExpat.Reader, but it's not clear to me who should be doing this -- pyexpat or the lower layers or xml.dom ? Attribute-value normalization ( http://www.w3.org/TR/REC-xml#AVNormalize ) isn't being done. Here's a test case. For more egregious problems, change the "which" assignment to eg3. Any ideas where to start looking? /r$ -- Zolera Systems, Your Key to Online Integrity Securing Web services: XML, SOAP, Dig-sig, Encryption http://www.zolera.com --------------BBADBC984C75C67D206A3405 Content-Type: text/plain; charset=us-ascii; name="avn-bug.py" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="avn-bug.py" #! /usr/bin/env python eg3 = """ """ eg4 = """ """ from xml.dom.ext import PrettyPrint, reader from xml.dom.ext.reader import PyExpat which = eg4 r = PyExpat.Reader() dom = r.fromString(which) PrettyPrint(dom) --------------BBADBC984C75C67D206A3405-- From walter@livinglogic.de Wed Aug 1 18:07:50 2001 From: walter@livinglogic.de (Walter =?ISO-8859-1?Q?D=F6rwald?=) Date: Wed, 01 Aug 2001 19:07:50 +0200 Subject: [XML-SIG] Preparing 0.6.6 References: Message-ID: <3B683766.6000801@livinglogic.de> Alexandre Fayolle wrote: > On Wed, 1 Aug 2001, Martin von Loewis wrote: >=20 >=20 >>I will release PyXML 0.6.6 at the end of this week. If you have any >>further changes to make, please let me know. >> >=20 > Could patch #442672 be considered for inclusion in 0.6.6 ? And patch #436698 too, please? Bye, Walter D=F6rwald From jeremy.kloth@fourthought.com Wed Aug 1 18:01:10 2001 From: jeremy.kloth@fourthought.com (Jeremy Kloth) Date: Wed, 1 Aug 2001 11:01:10 -0600 Subject: [XML-SIG] Attribute value normalization References: <3B6832BE.DD00C4DD@zolera.com> Message-ID: <00cf01c11aab$aeca2e20$993d64c0@den.xcare.net> > I'm using PyExpat.Reader, but it's not clear to me who should be doing > this -- pyexpat or the lower layers or xml.dom ? > > Attribute-value normalization ( http://www.w3.org/TR/REC-xml#AVNormalize > ) isn't being done. > I would think that, because the spec states it should be done by the XML processor, it should be happening in the parsers (i.e., pyexpat, sgmlop). This way the duplication of the normalization code would be minimized and anyone using the XML tools would benefit. That is using the SAX interface, the reader interfaces or the parsers directly. -- Jeremy Kloth Consultant jeremy.kloth@fourthought.com +1 303 583 9900 x 105 Fourthought, Inc. http://fourthought.com 4735 East Walnut St, Boulder, CO 80301, USA XML strategy, XML tools (http://4suite.org), knowledge management From martin@loewis.home.cs.tu-berlin.de Wed Aug 1 21:27:02 2001 From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis) Date: Wed, 1 Aug 2001 22:27:02 +0200 Subject: [XML-SIG] Attribute value normalization In-Reply-To: <3B6832BE.DD00C4DD@zolera.com> (message from Rich Salz on Wed, 01 Aug 2001 12:47:58 -0400) References: <3B6832BE.DD00C4DD@zolera.com> Message-ID: <200108012027.f71KR2v02083@mira.informatik.hu-berlin.de> > Attribute-value normalization ( http://www.w3.org/TR/REC-xml#AVNormalize > ) isn't being done. What do you mean, attribute normalization is not done? It works perfect for me. Regards, Martin From rsalz@zolera.com Wed Aug 1 21:36:01 2001 From: rsalz@zolera.com (Rich Salz) Date: Wed, 01 Aug 2001 16:36:01 -0400 Subject: [XML-SIG] Attribute value normalization References: <3B6832BE.DD00C4DD@zolera.com> <200108012027.f71KR2v02083@mira.informatik.hu-berlin.de> Message-ID: <3B686831.34C1CD1E@zolera.com> > What do you mean, attribute normalization is not done? It works > perfect for me. So, is the example I attached wrong? If so, how? -- Zolera Systems, Your Key to Online Integrity Securing Web services: XML, SOAP, Dig-sig, Encryption http://www.zolera.com From martin@loewis.home.cs.tu-berlin.de Wed Aug 1 22:00:10 2001 From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis) Date: Wed, 1 Aug 2001 23:00:10 +0200 Subject: [XML-SIG] Attribute value normalization In-Reply-To: <3B686831.34C1CD1E@zolera.com> (message from Rich Salz on Wed, 01 Aug 2001 16:36:01 -0400) References: <3B6832BE.DD00C4DD@zolera.com> <200108012027.f71KR2v02083@mira.informatik.hu-berlin.de> <3B686831.34C1CD1E@zolera.com> Message-ID: <200108012100.f71L0AQ02331@mira.informatik.hu-berlin.de> > > What do you mean, attribute normalization is not done? It works > > perfect for me. > > So, is the example I attached wrong? If so, how? It is not wrong, however I fail to see the problem. On my system, it produces What did you expect instead? Regards, Martin From noreply@sourceforge.net Wed Aug 1 23:33:41 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 01 Aug 2001 15:33:41 -0700 Subject: [XML-SIG] [ pyxml-Bugs-446975 ] Typo in XPath/__init__.py line 81 Message-ID: Bugs item #446975, was opened at 2001-08-01 15:33 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=106473&aid=446975&group_id=6473 Category: 4Suite Group: None Status: Open Resolution: None Priority: 5 Submitted By: Garth T Kidd (gtk) Assigned to: Nobody/Anonymous (nobody) Summary: Typo in XPath/__init__.py line 81 Initial Comment: In the 4Suite 2001-08-01 CVS snapshot, the test suite breaks as follows: $ ./test.py Traceback (most recent call last): File "./test.py", line 30, in ? t.run() File "/usr/lib/python2.1/site- packages/Ft/Lib/TestSuite/TestWalker.py", line 319, in run self._buildCommandTree(tester) File "/usr/lib/python2.1/site- packages/Ft/Lib/TestSuite/TestWalker.py", line 192, in _buildCommandTree newDir = TestDirectory(f,self) File "/usr/lib/python2.1/site- packages/Ft/Lib/TestSuite/TestWalker.py", line 156, in __init__ TestNode.__init__(self,file,parent) File "/usr/lib/python2.1/site- packages/Ft/Lib/TestSuite/TestWalker.py", line 54, in __init__ self.module = __import__(self.pyFile, {}, {}, '*') File "./Rdf/__init__.py", line 198, in ? module = __import__(tName,{},{},'*') File "./Rdf/test_serializer.py", line 3, in ? from Ft.Rdf.Serializers.Dom import Serializer File "/usr/lib/python2.1/site- packages/Ft/Rdf/Serializers/Dom.py", line 30, in ? RDF_CONTAINER_EXPR = Compile(".//rdf:RDF") File "/usr/lib/python2.1/site- packages/_xmlplus/xpath/__init__.py", line 81, in Compile traceback.printexc(None, stream) AttributeError: 'traceback' module has no attribute 'printexc' In Ft/XPath/__init__.py, s/printexc/print_exc/ in line 81 does the trick. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=106473&aid=446975&group_id=6473 From noreply@sourceforge.net Thu Aug 2 00:22:39 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 01 Aug 2001 16:22:39 -0700 Subject: [XML-SIG] [ pyxml-Patches-446988 ] Typo in XPath/__init__.py line 82 Message-ID: Patches item #446988, was opened at 2001-08-01 16:22 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=306473&aid=446988&group_id=6473 Category: 4Suite Group: None Status: Open Resolution: None Priority: 5 Submitted By: Garth T Kidd (gtk) Assigned to: Nobody/Anonymous (nobody) Summary: Typo in XPath/__init__.py line 82 Initial Comment: s/INTERNAL_ERROR/INTERNAL/ ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=306473&aid=446988&group_id=6473 From rsalz@zolera.com Thu Aug 2 02:06:00 2001 From: rsalz@zolera.com (Rich Salz) Date: Wed, 01 Aug 2001 21:06:00 -0400 Subject: [XML-SIG] Attribute value normalization References: <3B6832BE.DD00C4DD@zolera.com> <200108012027.f71KR2v02083@mira.informatik.hu-berlin.de> <3B686831.34C1CD1E@zolera.com> <200108012100.f71L0AQ02331@mira.informatik.hu-berlin.de> Message-ID: <3B68A778.6086AAD5@zolera.com> What does your system produce when trying "eg3" ? Anyhow, I expect multiple spaces collapsed into one. /r$ -- Zolera Systems, Securing web services (XML, SOAP, Signatures, Encryption) http://www.zolera.com From martin@loewis.home.cs.tu-berlin.de Thu Aug 2 07:44:43 2001 From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis) Date: Thu, 2 Aug 2001 08:44:43 +0200 Subject: [XML-SIG] Attribute value normalization In-Reply-To: <3B68A778.6086AAD5@zolera.com> (message from Rich Salz on Wed, 01 Aug 2001 21:06:00 -0400) References: <3B6832BE.DD00C4DD@zolera.com> <200108012027.f71KR2v02083@mira.informatik.hu-berlin.de> <3B686831.34C1CD1E@zolera.com> <200108012100.f71L0AQ02331@mira.informatik.hu-berlin.de> <3B68A778.6086AAD5@zolera.com> Message-ID: <200108020644.f726ihR10070@mira.informatik.hu-berlin.de> > What does your system produce when trying "eg3" ? The output looks like this on the screen: rm ' "/> rmN B '/>' A rmI ' "/> but it actually is this: 0000000 < ? x m l v e r s i o n = ' 1 0000020 . 0 ' e n c o d i n g = ' U T 0000040 F - 8 ' ? > \n < ! D O C T Y P E 0000060 d o c > \n < d o c > \n < n 0000100 o r m a t t r = " ' 0000120 \r & # 1 0 ; \t ' " / > \n 0000140 < n o r m N a m e s a t t 0000160 r = ' A \r & # 1 0 0000200 ; \t B ' / > \n < 0000220 n o r m I d i d = " ' 0000240 \r & # 1 0 ; \t ' " / > 0000260 \n < / d o c > \n 0000270 > Anyhow, I expect multiple spaces collapsed into one. What specific text in the XML recommendation makes you expect this? Perhaps this: # If the attribute type is not CDATA, then the XML processor must # further process the normalized attribute value ... by replacing # sequences of space (#x20) characters by a single space (#x20) # character. Then pyexpat behaves correctly, as far as I can tell: # All attributes for which no declaration has been read should be # treated by a non-validating processor as if declared CDATA. Since your documents contain no attribute declaration, all attributes are CDATA, and therefore spaces most *not* be collapsed. Regards, Martin From Mike.Olson@fourthought.com Thu Aug 2 08:01:25 2001 From: Mike.Olson@fourthought.com (Mike Olson) Date: Thu, 02 Aug 2001 01:01:25 -0600 Subject: [XML-SIG] 4suite build troubles References: <20010729114812-r01010700-9730901c-0910-010c@10.0.0.151> Message-ID: <3B68FAC5.2CBE0502@fourthought.com> Just van Rossum wrote: Just, Can you try building the 0.11.1b3? Its not an offical release yet, but is pretty close. We put a lot of work into the parsers (which is where you are seeing the compile errors). We do still use strdup though.... If you can't use the beta, then I can try to help you with this problems. though I'm not sure why these symols would only be multiply defined on the Mac. Mike > > I have some assorted troubles building 4suite for MacOS. First thing I noticed > that several C extensions use strdup(). Unfortunately the Metrowerks compiler > doesn't have strdup(). If I understand it correctly, strdup() is *not* ANSI C, > so for portability, using it is an error. I've worked around the problem for > now. > > Then, when I build XPathc, I get the following link errors: > > Link Error : multiply-defined 'g_errorTraceback' (data) > Defined in XPath_wrap.c > Defined in XPathSwig.c > > Link Error : multiply-defined 'g_errorValue' (data) > Defined in XPath_wrap.c > Defined in XPathSwig.c > > Link Error : multiply-defined 'g_errorType' (data) > Defined in XPath_wrap.c > Defined in XPathSwig.c > > Link Error : multiply-defined 'g_prodNum' (data) > Defined in XPath_wrap.c > Defined in XPathSwig.c > > Link Error : multiply-defined 'g_errorOccured' (data) > Defined in XPath_wrap.c > Defined in XPathSwig.c > > Link Error : multiply-defined 'g_errorLocation' (data) > Defined in XPath_wrap.c > Defined in XPathSwig.c > > Am I doing something wrong here? > > On another note, even PyXML doesn't build out of the box with distutils on the > Mac. Seems to have to do with path names that should get converted to Mac paths. > Whether this is a bug in the Mac backend of distutils or not I don't know yet -- > I'll look into it further. > > Just > > _______________________________________________ > 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 x 102 Fourthought, Inc. http://Fourthought.com 4735 East Walnut St, http://4Suite.org Boulder, CO 80301-2537, USA XML strategy, XML tools, knowledge management From just@letterror.com Thu Aug 2 08:24:35 2001 From: just@letterror.com (Just van Rossum) Date: Thu, 2 Aug 2001 09:24:35 +0200 Subject: [XML-SIG] 4suite build troubles In-Reply-To: <3B68FAC5.2CBE0502@fourthought.com> Message-ID: <20010802092444-r01010700-ef624842-0910-010c@10.0.0.5> Mike Olson wrote: Thanks for your reply. > Can you try building the 0.11.1b3? Its not an offical release yet, > but is pretty close. We put a lot of work into the parsers (which is > where you are seeing the compile errors). We do still use strdup > though.... Actually, I wasn't seeing compile errors... The problems currently are: 1. link errors I have no clue how to fix this or what I'm doing wrong. Has anyone else ever built 4Suite successfully on the Mac? 2. strdup() If strdup() is unavoidable, maybe it's an idea to offer a mystrdup.{ch}, and specify a macro in setup.py. 3. misc portability issues in setup.py - glob.glob("a/b/c/*.py") is not portable. Maybe you should look into glob.glob1(dir, pat). - The path '.' is not portable. You should use os.curdir instead. Just From Mike.Olson@fourthought.com Thu Aug 2 15:21:37 2001 From: Mike.Olson@fourthought.com (Mike Olson) Date: Thu, 02 Aug 2001 08:21:37 -0600 Subject: [XML-SIG] 4suite build troubles References: <20010802092444-r01010700-ef624842-0910-010c@10.0.0.5> Message-ID: <3B6961F1.2382AB0B@fourthought.com> Just van Rossum wrote: > > Actually, I wasn't seeing compile errors... The problems currently are: > > 1. link errors > I have no clue how to fix this or what I'm doing wrong. Has anyone > else ever built 4Suite successfully on the Mac? I miss spoke, these should go away if you use the beta version. > > 2. strdup() > If strdup() is unavoidable, maybe it's an idea to offer a mystrdup.{ch}, > and specify a macro in setup.py. > > 3. misc portability issues in setup.py > - glob.glob("a/b/c/*.py") is not portable. Maybe you should look > into glob.glob1(dir, pat). > - The path '.' is not portable. You should use os.curdir instead. We will try and fix two and three before the final release but I won't be able to get to it today. You had said you had work arounds for these though. Mike > > Just -- Mike Olson Principal Consultant mike.olson@fourthought.com +1 303 583 9900 x 102 Fourthought, Inc. http://Fourthought.com 4735 East Walnut St, http://4Suite.org Boulder, CO 80301-2537, USA XML strategy, XML tools, knowledge management From rsalz@zolera.com Thu Aug 2 18:43:17 2001 From: rsalz@zolera.com (Rich Salz) Date: Thu, 02 Aug 2001 13:43:17 -0400 Subject: [XML-SIG] Attribute value normalization References: <3B6832BE.DD00C4DD@zolera.com> <200108012027.f71KR2v02083@mira.informatik.hu-berlin.de> <3B686831.34C1CD1E@zolera.com> <200108012100.f71L0AQ02331@mira.informatik.hu-berlin.de> <3B68A778.6086AAD5@zolera.com> <200108020644.f726ihR10070@mira.informatik.hu-berlin.de> Message-ID: <3B699135.8783FA0E@zolera.com> > Since your documents contain no attribute declaration, all attributes > are CDATA, and therefore spaces most *not* be collapsed. AArrgh. Sorry. -- Zolera Systems, Your Key to Online Integrity Securing Web services: XML, SOAP, Dig-sig, Encryption http://www.zolera.com From George K. Thiruvathukal" I was using PyXML on MacOS X and ran into this problem of a duplicate _main entry point (that causes a problem with 'dyld'). I suspect this is a problem on all platforms but some of the shared object implemenations are pretty sloppy with duplicate symbols (and warning about them). The file that I traced the problem to is: ./extensions/expat/xmlwf/xmlwf.c:int tmain(int argc, XML_Char **argv) George From fdrake@acm.org Fri Aug 3 17:51:24 2001 From: fdrake@acm.org (Fred L. Drake, Jr.) Date: Fri, 3 Aug 2001 12:51:24 -0400 (EDT) Subject: [XML-SIG] Problem with duplicate _main In-Reply-To: References: Message-ID: <15210.54924.428390.569452@cj42289-a.reston1.va.home.com> George K. Thiruvathukal writes: > The file that I traced the problem to is: > ./extensions/expat/xmlwf/xmlwf.c:int tmain(int argc, XML_Char **argv) This is very strange; this file should not be linked into the pyexpat extension at all. There's no need even to include it in the PyXML distribution as far as I can tell. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From George K. Thiruvathukal" Message-ID: Hi Fred: Exactly, that is what I thought. It seems to be some test program or utility built into expat. Anyway, I have been able to get past it. There is a macro being defined to set 'tmain' to 'main', just to complete the report. -G On Fri, 3 Aug 2001, Fred L. Drake, Jr. wrote: > > George K. Thiruvathukal writes: > > The file that I traced the problem to is: > > ./extensions/expat/xmlwf/xmlwf.c:int tmain(int argc, XML_Char **argv) > > This is very strange; this file should not be linked into the > pyexpat extension at all. There's no need even to include it in the > PyXML distribution as far as I can tell. > > > -Fred > > From fdrake@acm.org Fri Aug 3 17:59:39 2001 From: fdrake@acm.org (Fred L. Drake, Jr.) Date: Fri, 3 Aug 2001 12:59:39 -0400 (EDT) Subject: [XML-SIG] Problem with duplicate _main In-Reply-To: References: <15210.54924.428390.569452@cj42289-a.reston1.va.home.com> Message-ID: <15210.55419.335296.159764@cj42289-a.reston1.va.home.com> George K. Thiruvathukal writes: > Exactly, that is what I thought. It seems to be some test program or > utility built into expat. It's a well-formedness checker, and quite handy. But it doesn't belong in the PyXML package. > Anyway, I have been able to get past it. There is a macro being defined to > set 'tmain' to 'main', just to complete the report. Thanks! -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From martin@loewis.home.cs.tu-berlin.de Fri Aug 3 18:26:58 2001 From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis) Date: Fri, 3 Aug 2001 19:26:58 +0200 Subject: [XML-SIG] Problem with duplicate _main In-Reply-To: <15210.54924.428390.569452@cj42289-a.reston1.va.home.com> (fdrake@acm.org) References: <15210.54924.428390.569452@cj42289-a.reston1.va.home.com> Message-ID: <200108031726.f73HQwn01098@mira.informatik.hu-berlin.de> > This is very strange; this file should not be linked into the > pyexpat extension at all. We link all of xmlfile.c, xmlwf.c, codepage.c, and unixfilemap.c into pyexpat.so, and use quite some code to figure out which filemap.c to use. It seems that they can all be removed from setup.py. > There's no need even to include it in the PyXML distribution as far > as I can tell. I would prefer to ship Expat as-is, as far as possible, even if that means that some unused files are distributed. I will remove them from setup.py, though. Regards, Martin From fdrake@acm.org Fri Aug 3 18:47:15 2001 From: fdrake@acm.org (Fred L. Drake, Jr.) Date: Fri, 3 Aug 2001 13:47:15 -0400 (EDT) Subject: [XML-SIG] Problem with duplicate _main In-Reply-To: <200108031726.f73HQwn01098@mira.informatik.hu-berlin.de> References: <15210.54924.428390.569452@cj42289-a.reston1.va.home.com> <200108031726.f73HQwn01098@mira.informatik.hu-berlin.de> Message-ID: <15210.58275.871789.68182@cj42289-a.reston1.va.home.com> Martin v. Loewis writes: > I would prefer to ship Expat as-is, as far as possible, even if that > means that some unused files are distributed. I will remove them from > setup.py, though. My inclination would be to only include the lib/ directory, at least for the 1.95.x (and I think 1.95.2 is a good update candidate! ;) versions. The directory structure has changed between 1.2 and 1.95.x, so that this is reasonable. Nothing from the xmlwf/ directory should be needed. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From bckfnn@worldonline.dk Sun Aug 5 12:10:00 2001 From: bckfnn@worldonline.dk (Finn Bock) Date: Sun, 05 Aug 2001 11:10:00 GMT Subject: [XML-SIG] PyXML for jython Message-ID: <3b6d1cd0.14678336@mail.wanadoo.dk> I'm trying to add some support for python-xml in jython but I'm unsure what I should include in the jython distribution. At the moment I am considering this set of files from the latest release of PyXML 0.6.5: /Lib/xml/__init__.py # to allow a _xmlplus replacement /xml/ns.py, /xml/sax/*.py, /xml/sax/**/drv_xmlproc.py, /xml/sax/**/__init__.py, /xml/utils/*.py, /xml/dom/*.py, /xml/dom/html/*.py, /xml/dom/ext/*.py, /xml/dom/ext/reader/__init__.py, /xml/dom/ext/reader/Sax*.py, /xml/parsers/__init__.py, /xml/parsers/xmlproc/*.py, Comments? And xpath, xslt and schema? Are they pure python without any C extensions? Are there any testsuites that covers these? regards, finn From noreply@sourceforge.net Sun Aug 5 12:17:47 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sun, 05 Aug 2001 04:17:47 -0700 Subject: [XML-SIG] [ pyxml-Patches-448132 ] Allow jython to complete tests Message-ID: Patches item #448132, was opened at 2001-08-05 04:17 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=306473&aid=448132&group_id=6473 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Finn Bock (bckfnn) Assigned to: Nobody/Anonymous (nobody) Summary: Allow jython to complete tests Initial Comment: The tests test_javadom.py and test_minidom.py imports some modules that isn't needed AFAICT. Removing the imports allow jython to complete these two tests. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=306473&aid=448132&group_id=6473 From martin@loewis.home.cs.tu-berlin.de Sun Aug 5 13:15:29 2001 From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis) Date: Sun, 5 Aug 2001 14:15:29 +0200 Subject: [XML-SIG] PyXML for jython In-Reply-To: <3b6d1cd0.14678336@mail.wanadoo.dk> (bckfnn@worldonline.dk) References: <3b6d1cd0.14678336@mail.wanadoo.dk> Message-ID: <200108051215.f75CFTR00929@mira.informatik.hu-berlin.de> > Comments? This list sounds good, except that you can probably safely drop sax/drivers, and all other SAX1 stuff that goes with it. > And xpath, xslt and schema? Are they pure python without any C > extensions? Are there any testsuites that covers these? =46rom the current PyXML CVS? The xslt and xpath packages currently don't work there. They also use a single extension module, namely boolean. That can be easily rewritten in pure Python, though. schema/trex is pure Python, but it uses xml.parsers.expat (as a few other modules do as well). So until PyTrex is on a more general basis, parser-wise, it is probably not of much use in Jython. Regards, Martin From bckfnn@worldonline.dk Sun Aug 5 17:33:58 2001 From: bckfnn@worldonline.dk (Finn Bock) Date: Sun, 05 Aug 2001 16:33:58 GMT Subject: [XML-SIG] PyXML for jython In-Reply-To: <200108051215.f75CFTR00929@mira.informatik.hu-berlin.de> References: <3b6d1cd0.14678336@mail.wanadoo.dk> <200108051215.f75CFTR00929@mira.informatik.hu-berlin.de> Message-ID: <3b6d716e.36339713@mail.wanadoo.dk> [Martin v. Loewis] >> Comments? > >This list sounds good, except that you can probably safely drop >sax/drivers, and all other SAX1 stuff that goes with it. Ok, I will not include sax/drivers. What is "all other SAX1 stuff"? It seems like __init__ import sax2ext which imports saxext and from there almost all of the sax package is imported. I really don't want to start hacking on the PyXML sources myself, so unless there exists a natural separation line between sax1 and sax2, I prefer to include it all (I think). >> And xpath, xslt and schema? Are they pure python without any C >> extensions? Are there any testsuites that covers these? > >=46rom the current PyXML CVS? Oh right. Yes I was looking in the CVS version when I wrote that. >The xslt and xpath packages currently >don't work there. They also use a single extension module, namely >boolean. That can be easily rewritten in pure Python, though. > >schema/trex is pure Python, but it uses xml.parsers.expat (as a few >other modules do as well). So until PyTrex is on a more general basis, >parser-wise, it is probably not of much use in Jython. Ok, I'll do a wait-and-see regarding all these additional packages. Thanks for your feedback. regards, finn From martin@loewis.home.cs.tu-berlin.de Sun Aug 5 18:41:10 2001 From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis) Date: Sun, 5 Aug 2001 19:41:10 +0200 Subject: [XML-SIG] PyXML 0.6.6 is released Message-ID: <200108051741.f75HfAp00936@mira.informatik.hu-berlin.de> Version 0.6.6 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.6.6.tar.gz http://prdownloads.sourceforge.net/pyxml/PyXML-0.6.6.win32-py1.5.exe http://prdownloads.sourceforge.net/pyxml/PyXML-0.6.6.win32-py2.0.exe http://prdownloads.sourceforge.net/pyxml/PyXML-0.6.6-1.5.2.i386.rpm http://prdownloads.sourceforge.net/pyxml/PyXML-0.6.6-2.0.i386.rpm This is a pure bugfix release only. 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. =20 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) * 4DOM from Fourthought (Uche Ogbuji, Mike Olson) * 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, questions, or bug reports to . For more information about Python and XML, see: http://www.python.org/topics/xml/ --=20 Martin v. L=F6wis http://www.informatik.hu-berlin.de/~loewis From martin@loewis.home.cs.tu-berlin.de Sun Aug 5 19:04:08 2001 From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis) Date: Sun, 5 Aug 2001 20:04:08 +0200 Subject: [XML-SIG] PyXML for jython In-Reply-To: <3b6d716e.36339713@mail.wanadoo.dk> (bckfnn@worldonline.dk) References: <3b6d1cd0.14678336@mail.wanadoo.dk> <200108051215.f75CFTR00929@mira.informatik.hu-berlin.de> <3b6d716e.36339713@mail.wanadoo.dk> Message-ID: <200108051804.f75I48G01096@mira.informatik.hu-berlin.de> > Ok, I will not include sax/drivers. > > What is "all other SAX1 stuff"? It seems like __init__ import sax2ext > which imports saxext and from there almost all of the sax package is > imported. I really don't want to start hacking on the PyXML sources > myself, so unless there exists a natural separation line between sax1 > and sax2, I prefer to include it all (I think). At the moment, hacking the sources would be the only way to get the SAX1 classes out of the sources. We probably kill them ourselves sometime after 0.7 (or perhaps even before that, if somebody takes the lead). Regards, Martin From martin@loewis.home.cs.tu-berlin.de Sun Aug 5 19:15:17 2001 From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis) Date: Sun, 5 Aug 2001 20:15:17 +0200 Subject: [XML-SIG] Preparing 0.6.6 In-Reply-To: <3B683766.6000801@livinglogic.de> (message from Walter =?ISO-8859-1?Q?D=F6rwald?= on Wed, 01 Aug 2001 19:07:50 +0200) References: <3B683766.6000801@livinglogic.de> Message-ID: <200108051815.f75IFHJ01192@mira.informatik.hu-berlin.de> > > Could patch #442672 be considered for inclusion in 0.6.6 ? > > And patch #436698 too, please? I've indeed added both of them to both PyXML 0.6.6, and to the CVS mainline. Thanks for contributing, Martin From teg@redhat.com Sun Aug 5 19:45:01 2001 From: teg@redhat.com (Trond Eivind =?iso-8859-1?q?Glomsr=F8d?=) Date: 05 Aug 2001 14:45:01 -0400 Subject: [XML-SIG] PyXML 0.6.6 is released In-Reply-To: <200108051741.f75HfAp00936@mira.informatik.hu-berlin.de> References: <200108051741.f75HfAp00936@mira.informatik.hu-berlin.de> Message-ID: "Martin v. Loewis" writes: > Version 0.6.6 of the Python/XML distribution is now available. It > should be considered a beta release, and can be downloaded from > the following URLs: >=20 > http://prdownloads.sourceforge.net/pyxml/PyXML-0.6.6.tar.gz > http://prdownloads.sourceforge.net/pyxml/PyXML-0.6.6.win32-py1.5.exe > http://prdownloads.sourceforge.net/pyxml/PyXML-0.6.6.win32-py2.0.exe > http://prdownloads.sourceforge.net/pyxml/PyXML-0.6.6-1.5.2.i386.rpm > http://prdownloads.sourceforge.net/pyxml/PyXML-0.6.6-2.0.i386.rpm >=20 > This is a pure bugfix release only. Which bugs does it fix?=20 --=20 Trond Eivind Glomsr=F8d Red Hat, Inc. From martin@loewis.home.cs.tu-berlin.de Sun Aug 5 20:32:21 2001 From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis) Date: Sun, 5 Aug 2001 21:32:21 +0200 Subject: [XML-SIG] PyXML 0.6.6 is released In-Reply-To: (teg@redhat.com) References: <200108051741.f75HfAp00936@mira.informatik.hu-berlin.de> Message-ID: <200108051932.f75JWLH01614@mira.informatik.hu-berlin.de> > Which bugs does it fix? That I had problems to establish, that's why I decided not to write a complete list. It essentially contains corrections to 4DOM and the boolean type. You'll find that a diff relative to 0.6.5 is quite short. Here are a few details, if you find that a specific change is not covered, please post it to the list. - do not compile xmlwf into pyexpat. - support floating point conversions in boolean.c better - remove dangling semicolons in boolean.c - expose BooleanType from boolean.c - properly process PI in sgmlop.c - fix isSameNode signature in FtNode - support __iter__ in NamedNodeMap - check for localName, not tagName, in minidom.getElementsByTagNameNS; actually return a result there - add a minidom.CDATASection class - fix typo in minitraversal - record namespace mappings using the DOM namespaces namespace in pulldom - fix encoding processing in dom.ext.Printer - in ext.PrettyPrint and ext.StripHTML, do not assume that the Document has an ownerDocument - in SeekNSS, deal with default namespaces - in HtmlLib, do not empty the document first - fix signature of ext.reader.Sax.unparsedEntityDecl, - Sax2: delay unparsed entitiy processing if there is no _ownerDoc. - Sax2Lib: add self parameter to startNamespaceDeclScope, endNamespaceDeclScope - ext.reader.Sgmlop: Do not create doctypes or PIs for HTML DOMs. - correct spelling of the pound entity. - marshal.generic: try to give more reproducable results across Python versions Hope this helps, Martin From rsalz@zolera.com Mon Aug 6 01:55:24 2001 From: rsalz@zolera.com (Rich Salz) Date: Sun, 05 Aug 2001 20:55:24 -0400 Subject: [XML-SIG] PyXML for jython References: <3b6d1cd0.14678336@mail.wanadoo.dk> <200108051215.f75CFTR00929@mira.informatik.hu-berlin.de> Message-ID: <3B6DEAFC.F9AD6F5D@zolera.com> > The xslt and xpath packages currently > don't work there. what exactly are the problems? i use pure-pyxml (no 4dom), and while there are probably some bugs -- i remember CDATA waasn't handled right, and my patch got overridden with a re-integration from 4dom -- but what's fundamentally wrong? -- Zolera Systems, Securing web services (XML, SOAP, Signatures, Encryption) http://www.zolera.com From martin@loewis.home.cs.tu-berlin.de Mon Aug 6 07:42:39 2001 From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis) Date: Mon, 6 Aug 2001 08:42:39 +0200 Subject: [XML-SIG] PyXML for jython In-Reply-To: <3B6DEAFC.F9AD6F5D@zolera.com> (message from Rich Salz on Sun, 05 Aug 2001 20:55:24 -0400) References: <3b6d1cd0.14678336@mail.wanadoo.dk> <200108051215.f75CFTR00929@mira.informatik.hu-berlin.de> <3B6DEAFC.F9AD6F5D@zolera.com> Message-ID: <200108060642.f766gdG01372@mira.informatik.hu-berlin.de> [xpath and xslt] > what exactly are the problems? i use pure-pyxml (no 4dom) and while > there are probably some bugs -- i remember CDATA waasn't handled right, > and my patch got overridden with a re-integration from 4dom -- but > what's fundamentally wrong? There are loads of test suite failures. Unfortunately, to run the test suite, you have to install 4Suite, which makes a few problems go away. To see some problems, try running the demos. On running merry_xmas.py, I get an error AttributeError: StylesheetReader instance has no attribute '_force8Bit' Essentially, I guess you get this error every time you try to read a style-sheet. Can you post an example that *does* work? Regards, Martin From Horst Eyermann Mon Aug 6 08:36:13 2001 From: Horst Eyermann (Horst Eyermann) Date: Mon, 06 Aug 2001 07:36:13 -0000 (/etc/localtime Subject: [XML-SIG] I am stuck: 4DOM / utf-8 In-Reply-To: <200108051741.f75HfAp00936@mira.informatik.hu-berlin.de> Message-ID: I am fairly new to python and XML, so I wish to apologise, if things should have been obvious. - if this is the wrong place to ask, please point me to the correct place. I converted a XML file encoded in utf-8 into a DOM structure (PyXML-0.6.5). Then I try to split the document into smaller subparts and store the parts into a database, and display them with tkinter. For extraction of XML from the DOM, the best function I found was PrettyPrint, which unfortunately does not support direct assining to a string. So I followed the examples utilizing the StringIO library. However, every time I try to access the stream, I get an error (see below). What should I do? Thank you, Horst here the code snippet: print 2 stream = StringIO() ext.PrettyPrint(value, stream=stream) stream.seek(0) text = load(stream) stream.close() and here the error message: 2 Traceback (most recent call last): File "Imexport.py", line 68, in ? result = test.getElement() File "Imexport.py", line 48, in getElement stream.seek(0) File "/usr/local/lib/python2.1/StringIO.py", line 62, in seek self.buf += ''.join(self.buflist) UnicodeError: ASCII decoding error: ordinal not in range(128) From rsalz@zolera.com Mon Aug 6 12:12:18 2001 From: rsalz@zolera.com (Rich Salz) Date: Mon, 06 Aug 2001 07:12:18 -0400 Subject: [XML-SIG] PyXML for jython References: <3b6d1cd0.14678336@mail.wanadoo.dk> <200108051215.f75CFTR00929@mira.informatik.hu-berlin.de> <3B6DEAFC.F9AD6F5D@zolera.com> <200108060642.f766gdG01372@mira.informatik.hu-berlin.de> Message-ID: <3B6E7B92.529ADFCB@zolera.com> Sorry I wasn't clear. I'm using XPATH (which seems to depend on some XSLT things), and haven't had problems. /r$ > Essentially, I guess you get this error every time you try to read a > style-sheet. Can you post an example that *does* work? -- Zolera Systems, Securing web services (XML, SOAP, Signatures, Encryption) http://www.zolera.com From martin@loewis.home.cs.tu-berlin.de Mon Aug 6 17:42:54 2001 From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis) Date: Mon, 6 Aug 2001 18:42:54 +0200 Subject: [XML-SIG] PyXML for jython In-Reply-To: <3B6E7B92.529ADFCB@zolera.com> (message from Rich Salz on Mon, 06 Aug 2001 07:12:18 -0400) References: <3b6d1cd0.14678336@mail.wanadoo.dk> <200108051215.f75CFTR00929@mira.informatik.hu-berlin.de> <3B6DEAFC.F9AD6F5D@zolera.com> <200108060642.f766gdG01372@mira.informatik.hu-berlin.de> <3B6E7B92.529ADFCB@zolera.com> Message-ID: <200108061642.f76GgsG00989@mira.informatik.hu-berlin.de> > Sorry I wasn't clear. I'm using XPATH (which seems to depend on some > XSLT things), and haven't had problems. Indeed, xml.xpath works quite fine. It is xml.xslt that has loads of Ft and pDomlette expectations in it. The relationship of xslt and xpath is the other way 'round: the XPath expression parser can also parse XSLT patterns. For that, it imports ParsedPattern etc; perhaps it should just ignore patterns if it cannot import the patterns classes. Regards, Martin From noreply@sourceforge.net Tue Aug 7 00:12:17 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 06 Aug 2001 16:12:17 -0700 Subject: [XML-SIG] [ pyxml-Bugs-448593 ] Runtime Error in 4xslt Message-ID: Bugs item #448593, was opened at 2001-08-06 16:12 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=106473&aid=448593&group_id=6473 Category: 4Suite Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Runtime Error in 4xslt Initial Comment: Gentoo Linux Documentation -- Gentoo Linux Documentation Guide ... Nevertheless, I get the following result: ...

 *

* *

*

, in HTML down-translates. Sean From larsga@garshol.priv.no Fri Aug 17 13:04:30 2001 From: larsga@garshol.priv.no (Lars Marius Garshol) Date: 17 Aug 2001 14:04:30 +0200 Subject: [XML-SIG] Re: Spec for marking book reviews on the Web (Andrew Kuchling) In-Reply-To: <5.0.2.1.0.20010817094839.01b00dc8@mail.digitome.com> References: <5.0.2.1.0.20010817094839.01b00dc8@mail.digitome.com> Message-ID: * Andrew M. Kuchling | | Another spec change: Danny Yee has privately suggested support for | multiple books in a review. That would be easy, resulting in a DTD | something like (title, author+)+. * Sean McGrath | | I'd suggest wrapping title,author+ in an element. e.g. | (review)+ | review (title,author+) I agree completely with this, and it also raises two new issues, one of which is whether the reviews Danny Yee has in mind really are reviews of multiple books, or actually multiple reviews. My guess is that if this becomes sufficiently widely used you'll have to support both. --Lars M. From noreply@sourceforge.net Fri Aug 17 16:14:21 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 17 Aug 2001 08:14:21 -0700 Subject: [XML-SIG] [ pyxml-Bugs-452113 ] 4XSLT: Pb with non blank spaces. Message-ID: Bugs item #452113, was opened at 2001-08-17 08:14 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=106473&aid=452113&group_id=6473 Category: 4Suite Group: None Status: Open Resolution: None Priority: 5 Submitted By: Logilab (ornicar) Assigned to: Nobody/Anonymous (nobody) Summary: 4XSLT: Pb with non blank spaces. Initial Comment: We are using here version 11.1beta3 of 4XSLT on RedHat 6.2 operating system and I've just found something that looks like a bug: Consider this very simple xml file: and this xslt file:

 

 

 

 *

* *

*

       * * * *
After transforming the XML file with this XSL Transformation, I should get something like: ...

 

 

 

...
     
 * * * *
... Thus the   character which should be always replaced with   is considered as a space character and is only displayed if the string contains another non-space character (e.g. *). This is quite annoying because   is widely use in HTML to have empty coloured cells in a table. Regards, O. CAYROL. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=106473&aid=452113&group_id=6473 From lists@lophty.com Fri Aug 17 22:31:03 2001 From: lists@lophty.com (lophty lists) Date: Fri, 17 Aug 2001 17:31:03 -0400 Subject: [XML-SIG] Installing PyXML locally on virtually-hosted web space References: Message-ID: <3B7D8D17.5050808@lophty.com> I would like to install PyXML and 4Suite along side of Python 2.1.1 in some virtually-hosted web space. I installed Py 2.1.1 on my account some time ago and have been running Python cgi scripts with shebang lines pointing to this interpreter with no problems, but I am fumbling the PyXML installation thus far and was hoping that I could get some advice. The (very brief) README says that the release has been tested with Py 1.5 and 2.0, but I didn't think that this would necessarily mean that it won't work with 2.1.1 and I'm sure that my problems have more to do with my own cluelessness than anything else. After ungzipping and tar -xvf'ing the PyXML-0.6.6 tar.gz, I tried placing it into Python-2.1.1/Modules, went into the PyXML-0.6.6 dir and did "python setup.py install". I got the following error message : Traceback (innermost last) : File "setup.py", line 9, in ? from distutils.core import setup, Extension ImportError: No module named distutils.core Needless to say, moving the PyXML-0.6.6 dir around my Python install and trying to install didn't work. Same error msg. I poked around in my Python install and, sure enough, found no distutils.core. I did find a folder "distutils" in Python-2.1.1/Lib that contained a file core.py, but that doesn't seem right. Has anyone else worked through a similar situation? I'd be grateful for any advice/help. Thanks, brian donovan (on digest) From lists@lophty.com Fri Aug 17 23:49:55 2001 From: lists@lophty.com (lophty lists) Date: Fri, 17 Aug 2001 18:49:55 -0400 Subject: [XML-SIG] PyXML-0.6.6 installation locally in virtually-hosted web space (resent, updated) References: Message-ID: <3B7D9F93.7040303@lophty.com> [Note: this is an updated version of an email that I tried to send to XML-SIG a while ago. I am resending because I got a "Returned mail: Service unavailable" in my inbox regarding my earlier attempt to send to the list. My apologies if you've already received this message.] I would like to install PyXML and 4Suite along side of Python 2.1.1 in some virtually-hosted web space. I installed Py 2.1.1 on my account some time ago and have been running Python cgi scripts with shebang lines pointing to this interpreter with no problems, but I am fumbling the PyXML installation thus far and was hoping that I could get some advice. The (very brief) README says that the release has been tested with Py 1.5 and 2.0, but I didn't think that this would necessarily mean that it won't work with 2.1.1 and I'm sure that my problems have more to do with my own cluelessness than anything else. After ungzipping and tar -xvf'ing the PyXML-0.6.6 tar.gz, I tried placing it into Python-2.1.1/Modules, went into the PyXML-0.6.6 dir and did "python setup.py install". I got the following error message : Traceback (innermost last) : File "setup.py", line 9, in ? from distutils.core import setup, Extension ImportError: No module named distutils.core Needless to say, moving the PyXML-0.6.6 dir around my Python install and trying to install didn't work. Same error msg. I poked around in my Python install and found a folder "distutils" in Python-2.1.1/Lib that contained a file core.py, but that doesn't seem right (shouldn't it be in the Modules folder?). Changing the shebang line in the PyXML-0.6.6 setup.py file to point to my locally-installed Python interpreter instead of the old 1.5.2 Python installed system-wide did not remedy the problem either. Has anyone else worked through a similar situation? I'd be grateful for any advice/help. Thanks, brian donovan (on digest) From martin@loewis.home.cs.tu-berlin.de Sat Aug 18 00:39:47 2001 From: martin@loewis.home.cs.tu-berlin.de (Martin v. Loewis) Date: Sat, 18 Aug 2001 01:39:47 +0200 Subject: [XML-SIG] PyXML-0.6.6 installation locally in virtually-hosted web space (resent, updated) In-Reply-To: <3B7D9F93.7040303@lophty.com> (message from lophty lists on Fri, 17 Aug 2001 18:49:55 -0400) References: <3B7D9F93.7040303@lophty.com> Message-ID: <200108172339.f7HNdlK11185@mira.informatik.hu-berlin.de> > I would like to install PyXML and 4Suite along side of Python 2.1.1 in > some virtually-hosted web space. I installed Py 2.1.1 on my account > some time ago When you say "I installed", what exactly do you mean? Did you all of "configure;make;make install"? If not, that is the problem. > After ungzipping and tar -xvf'ing the PyXML-0.6.6 tar.gz, I tried > placing it into Python-2.1.1/Modules, went into the PyXML-0.6.6 dir and > did "python setup.py install". It's irrelevant where you untar the distribution; it could have been in /tmp. However, when you invoked "python setup.py install", which copy of Python did you get? You can find out by saying "which python". If the answer is "/usr/bin/python", or "/usr/local/bin/python", then that is the problem - you should use the Python installation in your account. > I poked around in my Python install and found a folder "distutils" in > Python-2.1.1/Lib that contained a file core.py, but that doesn't seem > right (shouldn't it be in the Modules folder?). Lib/distutils is exactly right. However, this indicates that you did *not* install Python in your account: You merely unpacked it. Please read the README file in the Python distribution about installing Python. Regards, Martin From Horst Eyermann Sat Aug 18 17:20:51 2001 From: Horst Eyermann (Horst Eyermann) Date: Sat, 18 Aug 2001 18:20:51 +0200 (CEST) Subject: [XML-SIG] (DOM) Reading of large (huge) document Message-ID: Hello, I try to read in a dictionary, formatted in XML into a database. Each dictionary entry should be a database entry: self.reader = PyExpatReader() self.doc = self.reader.fromUri(fileName) Util.IndexDocument(self.doc) sefl.result = xpath.Evaluate('//entry', contextNode=self.doc) This does work well for small dictionaries, but for a large example (100000 words, 20MBytes), I do have problems doing this. After a while all my main memory (380MByte) and swap (400MByte) are used, and the system is busy paging. Could anyone give advice if there is a more efficient way to read in the document? Should I do the parsing for ... by hand, and just process the contense (validating, ...)? - It would appear, that this is by far less demanding, but is this the right way to go? Horst Horst@freedict.de Horst Eyermann Germany You need a dictionary? - visit http://www.freedict.de for free (GPL) dictionaries (unix; windows work in progress) For windows, visit http://www.freedict.de/wbuch A article (in German) about dictionary efforts on the net http://www.heise.de/tp/deutsch/inhalt/on/5927/1.html From Juergen Hermann" Message-ID: On Sat, 18 Aug 2001 18:20:51 +0200 (CEST), Horst Eyermann wrote: >I try to read in a dictionary, formatted in XML into a database. This is a typical situation where you would use SAX2, not DOM. The memory requirements of a SAX application are constant, as long as you do not remember data (and you dump them to a database). Ciao, J=FCrgen From Mike.Olson@fourthought.com Sun Aug 19 05:35:11 2001 From: Mike.Olson@fourthought.com (Mike Olson) Date: Sat, 18 Aug 2001 22:35:11 -0600 Subject: [XML-SIG] [ANN} 4Suite and 4SuiteServer Beta 4 Message-ID: <3B7F41FF.2371442F@fourthought.com> Much thanks to all who have submitted bug reports from the beta three release. Because of the number and how intrusive these where, we decided to have a quick beta 4 before we release 0.11.1 finial (sometime end of this week). As usual, it is available at: http://4Suite.org/download.html and ftp://ftp.4suite.org/pub/4Suite Also, for those interested, we have put up a web CVS front end at http://cvs.4suite.org Mike -- Mike Olson Principal Consultant mike.olson@fourthought.com +1 303 583 9900 x 102 Fourthought, Inc. http://Fourthought.com 4735 East Walnut St, http://4Suite.org Boulder, CO 80301-2537, USA XML strategy, XML tools, knowledge management From sales@now.net.cn Sun Aug 19 03:08:25 2001 From: sales@now.net.cn (sales@now.net.cn) Date: 19 Aug 2001 02:08:25 -0000 Subject: [XML-SIG] ¡îÑ°ÕÒJSPÐéÄâÖ÷»ú£¿¿´¿´ÎÒÃÇΪÄúÌṩʲôÑùµÄÓŻݰÉ.. Message-ID: <20010819020825.1626.qmail@new.now.nxt.cn> ¡îÑ°ÕÒJSPÐéÄâÖ÷»ú£¿¿´¿´ÎÒÃÇΪÄúÌṩʲôÑùµÄÓŻݰÉ.. ×𾴵Ŀͻ§£¬ÄúºÃ£¡ ÍøÂçʱ´ú×ÔÍƳö´øVDNSÓòÃû×¢²áºÍÐéÄâÖ÷»ú´óÓŻݺó£¬ÔÚÒµ½çÒýÆðÁËÇ¿ÁÒ·´Ó¦£¬ÏÖÔÙÒÔÌØ´óÓŻݡÖØÍƳöÈ«ÐÂÖ§³ÖJSPµÄÐéÄâÖ÷»ú£¬300Ôª¾Í¿ÉÓµÓиßËÙ¡¢°²È«µÄJSP¿Õ¼ä£º »ù±¾ÐÍA:¶ÀÁ¢ 50MÍøÕ¾¿Õ¼ä¡£ Ö§³Ö JSP¡£ 3¸öÉÌÓÃPOPÕ˺Š300Ôª/Äê ÔöÇ¿ÐÍA:¶ÀÁ¢100MÍøÕ¾¿Õ¼ä¡£ Ö§³ÖCGI PERL5.6£¬JSP¡£ (¶ÀÁ¢CGI-BIN) 10¸öÉÌÓÃPOPÕ˺Š֧³ÖMYSQL 500Ôª/Äê ÔöÇ¿ÐÍC:¶ÀÁ¢150MÍøÕ¾¿Õ¼ä¡£ Ö§³ÖCGI,PERL5.6£¬PHP4,JSPµÈ¡£ (¶ÀÁ¢CGI-BIN) 20¸öÉÌÓÃPOPÕ˺Š˫WEB CONTEXT 800Ôª/Äê »¹ÓжàÖÖÀàÐͿռ乩ÄúÑ¡Ôñ£¬ÏêϸÇë·ÃÎÊÎÒÃǵÄÍøÕ¾¡£ ¾­¼Ã¡¢ÊµÓá¢ÁìÏÈ£¡Òª´óÕ¹ºèͼ£¬²»±ØÆÌÕÅÀË·Ñ¡£ ¡îËùÓпռäËÍÈý¸ö´Î¼¶ÓòÃû£¬¼ÓËÍ5¸öPOPÉÌÓÃÓʼþÕʺţ¬²¢ÊµÊ±¿ªÍ¨Ãâ·ÑÊÔÓÃ15Ìì! ´Ë´ÎÓŻݽöÏÞÓÚ8ÔÂ15ÈÕÖÁ9ÔÂ15ÈÕ¡£ JSPÍøÂçʱ´ú³±Á÷ÒѾ­¿ªÊ¼ÁË£¬ÏÖÔÚºÍÎÒÃÇÒ»Æð´øÁìÕâÒ»ÁìÏȼ¼Êõ£¬¹²Í¬¿ªÍØÅµÄÉÌÒµºèͼ°É£¡ ¡î ¸ü¶àÓŻݡ£ ·²ÔÚ8ÔÂ1ÈÕµ½9ÔÂ1ÈÕ×¢²áÓòÃûͬʱÉêÇë¿Õ¼äËÍ6¸ö´Î¼¶ÓòÃû£¡µÈÓÚÒ»¸öÓòÃû¾ÍÄÜͬʱ½¨6¸öÍøÕ¾£¡Í¬Ê±¼ÓËÍ5¸öÉÌÓÃÓʼþÕ˺ţ¡ ¡î Ïà¹ØÒµÎñ£ºÓòÃû×¢²á¡¢¿Õ¼äÉêÇë¡¢Ö÷»úÍйܡ¢Óʼþϵͳ¡¢ÍøÕ¾½¨ÉèµÈ¡£ »¶Ó­Äú·ÃÎÊhttp://www.now.net.cn »¶Ó­ÄúÖÂÐÅsuppor@now.net.cn ÎÒÃÇÒ»Ö±ÒÔרҵ¡¢ÓÅÖÊ¡¢ÁìÏÈΪ×ÚÖ¼£¬ÈȳÏΪÄú·þÎñ£¡ Èç¹ûÕâ·â¹ã¸æÐÅÄú²»¸ÐÐËȤ£¬¶ÔÄúûÈκÎÐÅÏ¢¿ÉÑÔ£¬ÇëÔ­ÁÂÎÒÃǵĴò½Á£¬×£ÄúÍòÊÂÈçÒâ! From akuchlin@mems-exchange.org Mon Aug 20 15:21:02 2001 From: akuchlin@mems-exchange.org (Andrew Kuchling) Date: Mon, 20 Aug 2001 10:21:02 -0400 Subject: [XML-SIG] Spec for marking book reviews on the Web In-Reply-To: ; from larsga@garshol.priv.no on Fri, Aug 17, 2001 at 02:04:30PM +0200 References: <5.0.2.1.0.20010817094839.01b00dc8@mail.digitome.com> Message-ID: <20010820102102.B4661@ute.cnri.reston.va.us> On Fri, Aug 17, 2001 at 02:04:30PM +0200, Lars Marius Garshol wrote: >* Sean McGrath >| I'd suggest wrapping title,author+ in an element. e.g. >| (review)+ >| review (title,author+) > >I agree completely with this, and it also raises two new issues, one >of which is whether the reviews Danny Yee has in mind really are >reviews of multiple books, or actually multiple reviews. Reviews of multiple books, as when DDJ reviews 5 books in a column, or Yee reviews all the books in a trilogy or series. I'd wrap up (title,author+) in an 'item' element, a good generic name. Also, I'd like to have 'review' be the root element of the DTD, meaning one review = one document. However, because no one defines how validation works in the presence of namespaces, you can still have documents that contain multiple reviews. --amk From israel@lith.com Mon Aug 20 21:33:38 2001 From: israel@lith.com (Israel Evans) Date: Mon, 20 Aug 2001 13:33:38 -0700 Subject: [XML-SIG] Newbie requesting guidance, or directions to guidance..., a map, a hint, a sly wink of the eye... Message-ID: Hello all... I was wondering if there were a yellow brick road, as it were, to the lovely land of Python XML. I'd like to know the best course for learning how to set up an xml+database+Python based site. I'm assuming many of you have mounds experience in Web Development and have kind of "figured out" what you are doing and why. I've read up on the many reasons to use XML, but I'm still having trouble seeing the forest for the trees and all of the many specifications on how this tree should be like that tree but different and this tree helps this tree collect sunlight and eat loggers, but only when used with the tree that tells these other trees what hats the loggers are wearing on thursdays. So I'm asking for a couple words of wisdom, A fairy Godmother of sorts to come down and endow me with a pair of ruby sunglasses that when donned allow me to see what truly lies before me. ~israel~ ------------------------------------------><-------------------------------- ------------ Finnegan's paper began with the electrifying sentence, "The average Canadian has one testicle, just like Adolph Hitler -- or, more precisely, the average Canadian has 0.96 testicles, an even sadder plight than Hitler's, if the average Anything actually existed." He then went on to demonstrate that the normal or average human lives in substandard housing in Asia, has 1.04 vaginas, cannot read or write, suffers from malnutrition and never heard of Silken Thomas Fitzgerald or Brian Boru. "The normal," he concluded "consists of a null set which nobody and nothing really fits." Timothy F.X. Finnegan founder of CSICON ------------------------------------------><-------------------------------- ------------ From noreply@sourceforge.net Tue Aug 21 16:35:05 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 21 Aug 2001 08:35:05 -0700 Subject: [XML-SIG] [ pyxml-Bugs-453777 ] prepareParser in sax/drivers2/drv_sgmlop Message-ID: Bugs item #453777, was opened at 2001-08-21 08:35 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=106473&aid=453777&group_id=6473 Category: SAX Group: None Status: Open Resolution: None Priority: 5 Submitted By: Walter Dörwald (doerwalter) Assigned to: Nobody/Anonymous (nobody) Summary: prepareParser in sax/drivers2/drv_sgmlop Initial Comment: The following little script: --------- import cStringIO as StringIO from xml.sax import saxutils, xmlreader from xml.sax.drivers2 import drv_sgmlop class StringInputSource(xmlreader.InputSource): def __init__(self, text): xmlreader.InputSource.__init__(self) self.setByteStream(StringIO.StringIO (text)) parser = drv_sgmlop.create_parser() parser.parse(StringInputSource("")) --------- raises the following exception: --------- Traceback (most recent call last): File "test.py", line 25, in ? parser.parse(StringInputSource(code)) File "/usr/local/lib/python2.1/site- packages/_xmlplus/sax/drivers2/drv_sgmlop.py", line 49, in parse self.prepareParser(source) AttributeError: SaxParser instance has no attribute 'prepareParser' --------- ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=106473&aid=453777&group_id=6473 From sledge@warptec.com Wed Aug 22 14:58:47 2001 From: sledge@warptec.com (Christian Selig) Date: Wed, 22 Aug 2001 15:58:47 +0200 Subject: [XML-SIG] XSchema Parser Message-ID: <3B83BA97.2020802@warptec.com> Hello! I'm currently implementing a Web-based XML editor in Python using the Python XML package (mainly for the DOM stuff). Thanks a lot to its developers, it's a great package! Now, the editor needs to know at which node it may insert which other nodes, which nodes it has to insert because they are required etc. etc. So I need to parse the DTD. Or the Schema. I decided to go for the latter, because as soon as XSchema matures, DTDs will likely become obsolete step by step. BTW, XSchema allows more complex specification of XML structure and content grammar. I have browsed the web for a Python-based XSchema Parser, but so far, I have not found anything. So I started to work on an own parser and I'm coming along quite nicely (after all, it's Python! :-). It doesn't do that much, but it will soon. I do that work for the company I work in (warptec) and I do not know whether I'm allowed to 'Free' the XSchema parser, but I have given some strong arguments to my boss. It will be decided within a couple of days. I won't promise anything. But chances are good that I may put it under a free license and contribute it to the PyXML project. My question is: Do you want that code, after all? Do you think a schema parser makes sense for the project and be something which should be part of the PyXML project? Bye, Christian -- "Freedom is just another word for nothing left to loose. Nothing's worth nothing but it's free." (Kris Kristofferson) Christian Selig, http://www.warptec.com/ From Nicolas.Chauvat@logilab.fr Wed Aug 22 15:10:40 2001 From: Nicolas.Chauvat@logilab.fr (Nicolas Chauvat) Date: Wed, 22 Aug 2001 16:10:40 +0200 (CEST) Subject: [XML-SIG] XSchema Parser In-Reply-To: <3B83BA97.2020802@warptec.com> Message-ID: Hi, > So I need to parse the DTD. Or the Schema. I decided to go for the In case you'd be interested in a pygtk-based XML editor component that parses DTDs and all that, you may want to have a look at xmleditor, downloadable from http://www.logilab.org/xmltools Please note that the code was released under the GPL, so it will not fit your needs if you are looking for something to reuse for a proprietary/closed-source app. -- Nicolas Chauvat http://www.logilab.com - "Mais où est donc Ornicar ?" - LOGILAB, Paris (France) From larsga@garshol.priv.no Wed Aug 22 15:43:31 2001 From: larsga@garshol.priv.no (Lars Marius Garshol) Date: 22 Aug 2001 16:43:31 +0200 Subject: [XML-SIG] XSchema Parser In-Reply-To: <3B83BA97.2020802@warptec.com> References: <3B83BA97.2020802@warptec.com> Message-ID: * Christian Selig | | Now, the editor needs to know at which node it may insert which other | nodes, which nodes it has to insert because they are required etc. etc. | | So I need to parse the DTD. xmlproc already contains all you need to do this. It has a separate DTD parser you can use to load a DTD object, from which you can find all elements. You can step through the content models of all elements, and see what elements are legal at each step. xmleditor, mentioned by Nicolas Chauvat, uses xmlproc to provide context-sensitivity. | Or the Schema. I decided to go for the latter, because as soon as | XSchema matures, DTDs will likely become obsolete step by step. Maybe, maybe not. There are an awful lot of DTDs out there already, and many people are less than happy with XSchema. | I have browsed the web for a Python-based XSchema Parser, but so far, I | have not found anything. XSV is out there, but how useful it would be to you I don't know. | I won't promise anything. But chances are good that I may put it | under a free license and contribute it to the PyXML project. My | question is: Do you want that code, after all? Provided the code is of reasonable quality I would consider that a good idea. We accepted PyTREX, so I don't see how we could refuse something based on an equivalent W3C Recommendation. --Lars M. From dariusden@email.com Fri Aug 24 03:17:31 2001 From: dariusden@email.com (Darius Teo) Date: Fri, 24 Aug 2001 10:17:31 +0800 Subject: [XML-SIG] XML parsing and Deletion Of Files Message-ID: <20010824021731.2037.qmail@email.com> Hi, I am doing XML parsing with Python. I learnt my parsing codes from the XML parsing example from this website: http://py-howto.sourceforge.net/xml-howto/SAX.html >From that example, I could only send in XML as a file and not as a message. For my application, I find it still acceptable as I created XML files to overcome that problem. But after parsing through the XML file, I tried to delete it and was given a Permission Denied error. I have to delete the file because I am only using that file temporarily. That was after I closed the file. Anyone can help? I will be grateful. :-) Darius -- _______________________________________________ Talk More, Pay Less with Net2Phone Direct(R), up to 1500 minutes free! http://www.net2phone.com/cgi-bin/link.cgi?143 From hannu@tm.ee Fri Aug 24 03:32:55 2001 From: hannu@tm.ee (Hannu Krosing) Date: Fri, 24 Aug 2001 07:32:55 +0500 Subject: [XML-SIG] XML parsing and Deletion Of Files References: <20010824021731.2037.qmail@email.com> Message-ID: <3B85BCD7.8DC95110@tm.ee> Darius Teo wrote: > > Hi, > > I am doing XML parsing with Python. I learnt my parsing codes from the XML parsing example from > this website: > http://py-howto.sourceforge.net/xml-howto/SAX.html > > >From that example, I could only send in XML as a file and not as a message. You can try to use StringIO "files" import StringIO f = StringIO.StringIO('yourstring') > For my application, I find it still acceptable as I created XML files to overcome that problem. > > But after parsing through the XML file, I tried to delete it and was given a Permission Denied error. I have to delete the file because I am only using that file temporarily. > > That was after I closed the file. Anyone can help? I will be grateful. :-) Did you close both the writing and readin sides ? ------------- Hannu From Goran.Rolfsson@reachin.se Fri Aug 24 10:11:06 2001 From: Goran.Rolfsson@reachin.se (=?iso-8859-1?Q?G=F6ran_Rolfsson?=) Date: Fri, 24 Aug 2001 11:11:06 +0200 Subject: [XML-SIG] Problem installing PyXMLv0.6.6 Message-ID: <87DAC3BFA900D41199FF00E018A0042F2E7C82@HOBBES> Hi! I first tried the exe-version ( I have NT), but it wants me to select the Python installation to use, without showing me any to choose among, and without the possibility to specify a path. And yes, I have Python installed on my machine (actually in several versions). I then tried the tar.gz-version, but when trying to build it I got: C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:D:\Python\Python21\libs /EXPORT:initsgmlop build\temp.win32-2.1 \Release\sgmlop.obj /OUT:build\lib.win32-2.1\_xmlplus\parsers\sgmlop.pyd /IMPLIB :build\temp.win32-2.1\Release\sgmlop.lib LINK : fatal error LNK1104: cannot open file "stlport_vc6.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 Is there some way to trick the exe-version into finding a python installation (some environment variable)? Or how do I install this? Thanks! /Goran PS. I actually want to use it together with Zope From thomas.heller@ion-tof.com Fri Aug 24 17:23:49 2001 From: thomas.heller@ion-tof.com (Thomas Heller) Date: Fri, 24 Aug 2001 18:23:49 +0200 Subject: [XML-SIG] Problem installing PyXMLv0.6.6 References: <87DAC3BFA900D41199FF00E018A0042F2E7C82@HOBBES> Message-ID: <01d601c12cb9$2872ab20$e000a8c0@thomasnotebook> From: "G=F6ran Rolfsson" > Hi! I first tried the exe-version ( I have NT), but it wants me to sele= ct > the Python installation to use, without showing me any to choose among,= and > without the possibility to specify a path. And yes, I have Python insta= lled > on my machine (actually in several versions). G=F6ran, the exe-version is probably built with distutils bdist_wininst command. This looks in the registry under HKEY_LOCAL_MACHINE\Software\Python\PythonCore\x.y\InstallPath to find the location where Pythin is installed. (x.y is the required version 2.0, 2.1, whatever). This registry key is created by the installer when you install Python itself. If you compiled it from source, it will not be present. Could you look for this entry with the registry editor? Thomas From rsalz@zolera.com Sun Aug 26 06:15:07 2001 From: rsalz@zolera.com (Rich Salz) Date: Sun, 26 Aug 2001 01:15:07 -0400 Subject: [XML-SIG] XSchema Parser References: <3B83BA97.2020802@warptec.com> Message-ID: <3B8885DB.4C2EC7B5@zolera.com> I'd like to see a schema parser, but would like to know a bit more about what that means. Since a schema instance is an XML doc, pyxml already includes several schema parsers. :) I assume you mean building some intermediate form, however. My interest is because I want to do WSDL, web services descriptions, which uses schema to define message data types. I have an intermediate form, it's called Typecodes, and is used in ZSI, an open source SOAP implementation. (http://www.zolera.com/resources/opensrc) /r > I have browsed the web for a Python-based XSchema Parser, but so far, I > have not found anything. So I started to work on an own parser and I'm > coming along quite nicely (after all, it's Python! :-). It doesn't do > that much, but it will soon. -- Zolera Systems, Securing web services (XML, SOAP, Signatures, Encryption) http://www.zolera.com From Juergen Hermann" Hi! The top-level __init__.py is missing the "unicode" module in the __all__ list. Is this by error or by design? Ciao, J=FCrgen -- J=FCrgen Hermann, Developer (jhe@webde-ag.de) WEB.DE AG, http://webde-ag.de/ From Juergen Hermann" Hi! I think I reported the following for 0.6.5, and it's still in 0.6.6. Can someone test this against the CVS source? Given the following three files, I get a traceback that "HTTP_SSL" is not defined, which is because it comes AFTER including the external entity. Put it before the "env" entity, and alas, no traceback! xml.sax._exceptions.SAXParseException: file:///export/home/jhe/tmp/EntityTest/enttest.xml:19:44: Undeclared entity 'HTTP_SSL' Should work in both cases! ==> enttest.ent <== ==> enttest.py <== import os import xml.sax import xml.sax.saxutils import xml.sax.handler import xml.sax.sax2exts class TestLoader(xml.sax.saxutils.DefaultHandler): def __init__(self, filename): self.fileurl = 'file://' + os.path.abspath(filename) # create parser parser = xml.sax.sax2exts.XMLValParserFactory.make_parser() print '+++ parser is', parser parser.setFeature(xml.sax.handler.feature_namespaces, 1) parser.setFeature(xml.sax.handler.feature_validation, 1) parser.setFeature(xml.sax.handler.feature_external_ges, 1) parser.setFeature(xml.sax.handler.feature_external_pes, 1) # set handlers parser.setContentHandler(self) parser.setDTDHandler(self) parser.setErrorHandler(self) parser.setEntityResolver(self) # parse the XML into events parser.parse(self.fileurl) def startElementNS(self, name, qname, attrs): print name, qname, attrs.items() if __name__ == "__main__": print xml.version_info test = TestLoader('enttest.xml') ==> enttest.xml <== %env; ]> From larsga@garshol.priv.no Mon Aug 27 15:14:00 2001 From: larsga@garshol.priv.no (Lars Marius Garshol) Date: 27 Aug 2001 16:14:00 +0200 Subject: [XML-SIG] Bug in 0.6.6 In-Reply-To: References: Message-ID: Hi Jürgen, * Juergen Hermann | | I think I reported the following for 0.6.5, and it's still in 0.6.6. | Can someone test this against the CVS source? I tested it now and got no problems. I seem to recall seeing this bug report before, and testing it with no problems then as well. Could you test this against the CVS sources, or against PyXML 0.7.0? If you still get problems, could you then report it as a bug in SourceForge and attach _all_ the involved files (that is, enttest.ent as well)? --Lars M. From Nicolas.Chauvat@logilab.fr Mon Aug 27 16:25:55 2001 From: Nicolas.Chauvat@logilab.fr (Nicolas Chauvat) Date: Mon, 27 Aug 2001 17:25:55 +0200 (CEST) Subject: [XML-SIG] Expanding external entities Message-ID: Hi List, At the moment I'm using this piece of code : def parse_file(filepath) : from xml.sax.saxexts import make_parser p = make_parser() dh = MyParserHandler() p.setDocumentHandler(dh) p.parseFile(filepath) return dh.myObject which does not deal with entities defined like this : ]> &tobeincluded; I search the archives and found out about : http://mail.python.org/pipermail/xml-sig/2001-July/005827.html but I would rather keep a SAX interface instead of using ExpatReader... and reading ExpatReader I'm not quite sure what piece of code to reuse ! Any advice ? -- Nicolas Chauvat http://www.logilab.com - "Mais où est donc Ornicar ?" - LOGILAB, Paris (France) From Alexandre.Fayolle@logilab.fr Mon Aug 27 16:40:12 2001 From: Alexandre.Fayolle@logilab.fr (Alexandre Fayolle) Date: Mon, 27 Aug 2001 17:40:12 +0200 (CEST) Subject: [XML-SIG] Expanding external entities In-Reply-To: Message-ID: On Mon, 27 Aug 2001, Nicolas Chauvat wrote: > Hi List, > > At the moment I'm using this piece of code : > > def parse_file(filepath) : > from xml.sax.saxexts import make_parser > p = make_parser() > dh = MyParserHandler() > p.setDocumentHandler(dh) > p.parseFile(filepath) > return dh.myObject > > which does not deal with entities defined like this : > > > > ]> > &tobeincluded; First thing is, you're using SAX 1.0 interfaces which are deprecated. You should use from xml.sax.sax2exts import make_parser Maybe this alone will solve your problem, I'm not sure. If it doesn't work, you could try using a validating parser. I'm pretty sure xmlproc deals with external entities correctly. from xml.sax.sax2exts import XMLValParserFactory p = XMLValParserFactory.make_parser() Cheers, Alexandre Fayolle -- LOGILAB, Paris (France). http://www.logilab.com http://www.logilab.fr http://www.logilab.org Narval, the first software agent available as free software (GPL). From larsga@garshol.priv.no Mon Aug 27 16:54:15 2001 From: larsga@garshol.priv.no (Lars Marius Garshol) Date: 27 Aug 2001 17:54:15 +0200 Subject: [XML-SIG] Expanding external entities In-Reply-To: References: Message-ID: * Alexandre Fayolle | | First thing is, you're using SAX 1.0 interfaces which are deprecated. You | should use | | from xml.sax.sax2exts import make_parser Not so. He should use from xml.sax import make_parser | If it doesn't work, you could try using a validating parser. I'm | pretty sure xmlproc deals with external entities correctly. It does. If you want to use expat through SAX try setting the feature_external_ges feature to true to make it load external entities, like so: from xml.sax import make_parser from xml.sax.handler import feature_external_ges p = make_parser() p.setFeature(feature_external_ges, 1) p.parse(stuff) If this doesn't work for expat and/or xmlproc, please report that as a feature request (or bug, depending on what happens) in SourceForge. That way we won't forget about the problem. --Lars M. From marklists@mceahern.com Mon Aug 27 17:02:26 2001 From: marklists@mceahern.com (Mark McEahern) Date: Mon, 27 Aug 2001 09:02:26 -0700 Subject: [XML-SIG] really stupid question: why expat? In-Reply-To: Message-ID: Why is the expat parser called expat? Does it have something to do with expatriates? Thanks, // mark From Nicolas.Chauvat@logilab.fr Mon Aug 27 17:18:42 2001 From: Nicolas.Chauvat@logilab.fr (Nicolas Chauvat) Date: Mon, 27 Aug 2001 18:18:42 +0200 (CEST) Subject: [XML-SIG] Expanding external entities In-Reply-To: Message-ID: On 27 Aug 2001, Lars Marius Garshol wrote: > If this doesn't work for expat and/or xmlproc, please report that as a > feature request (or bug, depending on what happens) in SourceForge. I did that and reported a feature request http://sourceforge.net/tracker/?atid=356473&group_id=6473&func=browse -- Nicolas Chauvat http://www.logilab.com - "Mais où est donc Ornicar ?" - LOGILAB, Paris (France) From Juergen Hermann" Message-ID: On 27 Aug 2001 16:14:00 +0200, Lars Marius Garshol wrote: > >Hi J=FCrgen, > >* Juergen Hermann >| >| I think I reported the following for 0.6.5, and it's still in 0.6.6. = >| Can someone test this against the CVS source? > >I tested it now and got no problems. I seem to recall seeing this bug >report before, and testing it with no problems then as well. That's right. I guess we were already past 0.6.6 at that time, or at lea= st the HEAD revision was. >Could you test this against the CVS sources, or against PyXML 0.7.0? Testing against the CVS head resolved THIS problem, and revealed another= one. ;) Can you test the following, and if it fails for you, I'll open a bug. When I run "enttest", I get a traceback: xml.sax._exceptions.SAXParseException: file:///export/home/jhe/tmp/EntityTest/subdtd/enttest.xml:2:37: Multiple= text declarations in a single entity The problem is the nested parameter entity in the DTD. Xerces 1.4 parses= it w/o any problem. =3D=3D> enttest.xml <=3D=3D =3D=3D> enttest.dtd <=3D=3D %subEntity; =3D=3D> enttest-subdtd.ent <=3D=3D =3D=3D> enttest.py <=3D=3D import os import xml.sax import xml.sax.saxutils import xml.sax.handler import xml.sax.sax2exts class TestLoader(xml.sax.saxutils.DefaultHandler): def __init__(self, filename): self.fileurl =3D 'file://' + os.path.abspath(filename) # create parser parser =3D xml.sax.sax2exts.XMLValParserFactory.make_parser() print '+++ parser is', parser parser.setFeature(xml.sax.handler.feature_namespaces, 1) parser.setFeature(xml.sax.handler.feature_validation, 0) parser.setFeature(xml.sax.handler.feature_external_ges, 1) parser.setFeature(xml.sax.handler.feature_external_pes, 1) # set handlers parser.setContentHandler(self) parser.setDTDHandler(self) parser.setErrorHandler(self) parser.setEntityResolver(self) # parse the XML into events parser.parse(self.fileurl) def startElementNS(self, name, qname, attrs): print name, qname, attrs.items() if __name__ =3D=3D "__main__": print xml.version_info test =3D TestLoader('enttest.xml') From xml-dev@xhaus.com Mon Aug 27 23:00:45 2001 From: xml-dev@xhaus.com (Xhaus Main Account) Date: Mon, 27 Aug 2001 23:00:45 +0100 Subject: [XML-SIG] really stupid question: why expat? References: Message-ID: <3B8AC30D.131771FF@xhaus.com> Mark McEahern wrote: > Why is the expat parser called expat? Does it have something to do with > expatriates? Possibly. Expat was written by James Clark, an Englishman who now lives in Thailand....... More info from http://www.jclark.com/ Might James have had anything else in mind as well when he named the parser? Alan. From larsga@garshol.priv.no Tue Aug 28 07:37:53 2001 From: larsga@garshol.priv.no (Lars Marius Garshol) Date: 28 Aug 2001 08:37:53 +0200 Subject: [XML-SIG] really stupid question: why expat? In-Reply-To: References: Message-ID: * Mark McEahern | | Why is the expat parser called expat? Does it have something to do | with expatriates? The name is short for Xml PArsing Toolkit. Quite inventive for a James Clark project. :-) --Lars M. From larsga@garshol.priv.no Tue Aug 28 07:55:58 2001 From: larsga@garshol.priv.no (Lars Marius Garshol) Date: 28 Aug 2001 08:55:58 +0200 Subject: [XML-SIG] Bug in 0.6.6 In-Reply-To: References: Message-ID: * Juergen Hermann | | Can you test the following, and if it fails for you, I'll open a bug. | [...] | The problem is the nested parameter entity in the DTD. This is a bug. xmlproc thinks the two text declarations appear in the same entity, which they of course do not. I've fixed it and checked the fix into CVS. Thank you for finding this! --Lars M. From xinhui" ³ÏÕкÏ×÷â·°é ÎÒ¹«Ë¾ÊÇÖйú´ó½һ¼Ò¹ú¼Ê»õÔ˹«Ë¾£¬³ÖÓпɾ­Óª"¹ú¼Ê¹úÄÚ¿ÕÔË¿ìµÝµÈÎïÁ÷ÒµÎñ"µÄÅÆÕÕ£ ¬×¢²áµØÔڹ㶫ʡÖ麣ÊУ¬×¢²á×ʽð250ÍòÔªÈËÃñ±Ò¡£±¾¹«Ë¾ÓµÓÐÈýÍòƽ·½Ó¢³ßµÄ´óÐÍ»õ²Ö£ ¬¾à¾ÅÖÞ¸Û¹ú¼Ê»õ¹ñÂëÍ·½ö1.5¹«Àï¡£±¾¹«Ë¾ÏÖÓûÔÚÏã¸Û¡¢°ÄÃÅ¡¢Ì¨ÍåͬÐÐÖгÏÒâÑ°ÕÒÒ»¼Òº Ï×÷ⷰ飬»¶Ó­ÈκÎÐÎʽµÄºÏ×÷£¬¿É²ÎÓë¾­Óª¹ÜÀí¡£ ÓÐÒâ´ÓÊ´ó½¹ú¼Ê»õÔËÒµµÄ¸Û°Ą̈ͬÐÐÇëÓëÎÒ¹«Ë¾ÁªÏµ¡£ £¨E-mail:xinhui-zh@163.net£©¡£ Looking for Business Partners Located in Zhuhai city, Guangdong Province, with 2.5 million RMB Yuan of registered capital, the company is an international freight forwarder holding "International and Domestic Airfreight, Express Mail Distribution and Delivery Business"license. It has warehousing space of 30,000 square feet and only 1.5kms from Jiuzhou Harbour international container terminal. Due to the potential growing market, we now intend to expand our business. To achieve this, we sincerely invite people of the same trade from HongKong, Macau and Taiwan to hold talks with us. We welcome any forms of colaboration, jointly run ajoint venture can be one of the options. Those who share common interest with us please contact us as soon as possible. (E-mail: xinhui-zh@163.net) _______________________________________________________________________ Äú·¢²¼ÐÅÏ¢£¬ÎÒ°ïÄú´«²¥Íƹ㡣 »¶Ó­·ÃÎÊwww.BuySell-114.com£¨°Ùɸ114£©ÍøÕ¾¡£ ÄúµÄÒµÎñÄÚÈÝ¡¢ÁªÏµµç»°¡¢ÍøÖ·µÈ×ÊÁϾùÄÜ¿ìËÙÓÐЧµØËÍ´ïDZÔÚ¿Í»§¡£ ÁªÏµµç»°£º0756£­2525742 Öйú Ö麣 From Juergen Hermann" Hi! FYI, I finally started real work on http://sourceforge.net/projects/pirxx/, and I expect a working alpha parser binding at the end of the week. Together with Pyana, which concentrates on Xalan so far, we'll have Xerces/Xalan covered. Since the Xerces people started work on Schema validation, this is also = a way to get schemas "for free" into Python, unless someone comes up with a pure Python implementation before that. Ciao, J=FCrgen -- J=FCrgen Hermann, Developer (jhe@webde-ag.de) WEB.DE AG, http://webde-ag.de/ From larsga@garshol.priv.no Tue Aug 28 17:26:47 2001 From: larsga@garshol.priv.no (Lars Marius Garshol) Date: 28 Aug 2001 18:26:47 +0200 Subject: [XML-SIG] Started actual work on Xerces wrapper In-Reply-To: References: Message-ID: * Juergen Hermann | | FYI, I finally started real work on | http://sourceforge.net/projects/pirxx/, and I expect a working alpha | parser binding at the end of the week. This is really good news, Jürgen. I looked a little at the source code, and saw that you have a _pirxx.cpp and a drv_xerces.py. Does this mean that Pirxx will have a raw C API and a SAX API, or will the SAX API be the only way to use Pirxx? Do you think i would be possible to implement drv_xerces directly in C? --Lars M. From sam@webslingerZ.com Tue Aug 28 17:36:50 2001 From: sam@webslingerZ.com (Sam Brauer) Date: Tue, 28 Aug 2001 12:36:50 -0400 (EDT) Subject: [XML-SIG] ANN: maki 1.1.0 In-Reply-To: Message-ID: Last week I released a new version of "maki" (sufficiently different from the last version that I felt it was time to bump the version number up from 1.0.x to 1.1.0). maki is a dynamic webpage serving framework that runs as a mod_python module under Apache. It can be used to add dynamic content to an XML document and apply stylesheets. The steps to be applied to a given document are determined by rules that you can set up in a central configuration file. maki depends on Python, Apache, mod_python, 4Suite, and optionally Sablotron. For more info take a look at http://maki.sourceforge.net/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sam Brauer : sbrauer@users.sourceforge.net (i (love (parentheses))) ...i'm also rather fond of ellipses From Juergen Hermann" Hi! Is there a documented default for a reader's features & properties, namely validation & namespace processing? Ciao, J=FCrgen -- J=FCrgen Hermann, Developer (jhe@webde-ag.de) WEB.DE AG, http://webde-ag.de/ From larsga@garshol.priv.no Tue Aug 28 22:02:59 2001 From: larsga@garshol.priv.no (Lars Marius Garshol) Date: 28 Aug 2001 23:02:59 +0200 Subject: [XML-SIG] XMLReader features & properties In-Reply-To: References: Message-ID: * Juergen Hermann | | Is there a documented default for a reader's features & properties, | namely validation & namespace processing? They are documented here: The documentation has followed the Java SAX 2.0 API, but I think the default for feature_validation should be the opposite of what that page says. The default SAX parser you get in Python is the expat driver, and for this property it has the opposite value of that documented. That is bound to confuse people, and so I think we should change the documentation. There is also feature_external_pes which I don't know what expat does with. Does the expat version we have now read external parameter entities? If not, we should either change that or the documentation. The best is, I think, to change the implementation, but if that proves difficult we should change the documentation. The feature_namespaces feature is also troublesome. Part of the point behind splitting the startElement event into startElement and startElementNS was to make SAX easier to use for novices. If that is to have any point the default has to be that namespace processing is off. This is also what expatreader.py and drv_xmlproc.py implement at the moment. I think we should change the documentation to reflect this. Comments, anyone? --Lars M. From Mike.Olson@fourthought.com Wed Aug 29 01:21:13 2001 From: Mike.Olson@fourthought.com (Mike Olson) Date: Tue, 28 Aug 2001 18:21:13 -0600 Subject: [XML-SIG] [ANN] 4Suite and 4Suite Server 0.11.1-b5 Message-ID: <3B8C3579.B45D6C2C@fourthought.com> Thanks you all for pointing out the packaging mistakes in b4. b5 is a repackaged b4 with a few bug fixes. If all goes well with this Beta we plan on releasing on Friday. As usual, the packagea are available at: http://4Suite.org/download.html and ftp://ftp.4Suite.org/pub/4Suite Mike -- Mike Olson Principal Consultant mike.olson@fourthought.com +1 303 583 9900 x 102 Fourthought, Inc. http://Fourthought.com 4735 East Walnut St, http://4Suite.org Boulder, CO 80301-2537, USA XML strategy, XML tools, knowledge management From Alexandre.Fayolle@logilab.fr Tue Aug 28 11:51:34 2001 From: Alexandre.Fayolle@logilab.fr (Alexandre Fayolle) Date: Tue, 28 Aug 2001 12:51:34 +0200 (CEST) Subject: [XML-SIG] Small typo in xml.dom.Comment Message-ID: I came accross this tiny typo in xml.dom.Comment while working on XmlTree which showed bizarre nodes. I cannot access SourceFrog right now, so here's a patch. I'll put it online later so that this valuable contribution ^_^ does not get lost if noone has time to fix it. --- Comment.py~ Tue Feb 20 02:00:03 2001 +++ Comment.py Tue Aug 28 12:46:19 2001 @@ -19,4 +19,4 @@ def __init__(self,ownerDocument,data): CharacterData.__init__(self, ownerDocument, data) - self.__dict__['__nodename'] = '#comment' + self.__dict__['__nodeName'] = '#comment' Alexandre Fayolle -- LOGILAB, Paris (France). http://www.logilab.com http://www.logilab.fr http://www.logilab.org Narval, the first software agent available as free software (GPL). From Juergen Hermann" Hi! Input source mapping and the error handler work, so the only essential thing missing is the content handler, i.e. by tomorrow evening we should have a working Xerces parser. Ciao, J=FCrgen From brian@sweetapp.com Wed Aug 29 20:40:35 2001 From: brian@sweetapp.com (Brian Quinlan) Date: Wed, 29 Aug 2001 12:40:35 -0700 Subject: [XML-SIG] PIRXX status In-Reply-To: Message-ID: <001b01c130c2$79d5fbe0$b503a8c0@activestate.ca> > Input source mapping and the error handler work, so the only > essential thing missing is the content handler, i.e. by > tomorrow evening we should have a working Xerces parser. Which type of parsing will work e.g. parsing to DOM and proxying to Python, SAX? I'm wondering because I would love to special-case Xerces DOMs as an input type in Pyana (1). Also, Pyana, for DOM output, generates and proxies a Xerces DOM (2). It would be great if the user could hand that to PIRXX for further processing (e.g. for validation). The problem is that we can only do these kinds of things (with any degree of safety) if we merge the two extensions into one binary. Is that something that we should discuss? (1) Pyana is a Python interface to the Xalan XSLT processor. docs: http://pyana.sourceforge.net/docs/ sourceforge: http://sourceforge.net/projects/pyana (2) Not checked-in to CVS yet. Hopefully before the end of the week (fingers crossed). Cheers, Brian From fdrake@acm.org Wed Aug 29 20:36:54 2001 From: fdrake@acm.org (Fred L. Drake, Jr.) Date: Wed, 29 Aug 2001 15:36:54 -0400 Subject: [XML-SIG] PIRXX status In-Reply-To: References: Message-ID: <15245.17494.388686.803693@grendel.digicool.com> Juergen Hermann writes: > Input source mapping and the error handler work, so the only essential > thing missing is the content handler, i.e. by tomorrow evening we > should have a working Xerces parser. I've been pretty quiet lately, but I just wanted to say this is really cool stuff! I'm hoping to have time to really look at it soon. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From Juergen Hermann" Message-ID: On Wed, 29 Aug 2001 12:40:35 -0700, Brian Quinlan wrote: >Which type of parsing will work e.g. parsing to DOM and proxying to >Python, SAX? For starters, SAX parsing via a Python SAX2 driver. What will follow is SAX bridges (feeding C++ SAX into Python is part of = the SAX driver already, feeding Python SAX into a C++ handler will be possible too). A DOM wrapper is also planned. In a nutshell, the original goals still hold true (note the last point):= - Make Xerces available as a PyXML parser (make_parser interface) - Bridge between Python and C++ SAX streams - Wrap Xerces DOM in a way compatible to 4DOM - Wrap the XalanTransformer class, then adapt to common Python interfaces on that basis - Provide an interface to XSLT extension functions written in Python= (code for that is already existing at WEB.DE AG) - Coordinate efforts with Pyana >The problem is that we can only do these kinds of things (with any >degree of safety) if we merge the two extensions into one binary. Is >that something that we should discuss? There are solutions that do NOT require such a merge, but a merge might = be reasonable anyway. For now, I'll focus on getting the most important = stuff in regarding Xerces only, and then worry about integration. If you need something dearly, don't hesitate to yell though. Ciao, J=FCrgen From brian@sweetapp.com Wed Aug 29 22:08:28 2001 From: brian@sweetapp.com (Brian Quinlan) Date: Wed, 29 Aug 2001 14:08:28 -0700 Subject: [XML-SIG] PIRXX status In-Reply-To: Message-ID: <001c01c130ce$c06475d0$b503a8c0@activestate.ca> > >The problem is that we can only do these kinds of things (with any > >degree of safety) if we merge the two extensions into one binary. Is > >that something that we should discuss? > > There are solutions that do NOT require such a merge, but a > merge might be reasonable anyway. For now, I'll focus on > getting the most important stuff in regarding Xerces only, > and then worry about integration. Doing the merge avoids the necessity of going through Python for each node, which I'm sure will greatly hinder the performance. Cheers, Brian From paulp@ActiveState.com Wed Aug 29 23:36:56 2001 From: paulp@ActiveState.com (Paul Prescod) Date: Wed, 29 Aug 2001 15:36:56 -0700 Subject: [XML-SIG] SOAP in CGI-like environments Message-ID: <3B8D6E88.A644C97F@ActiveState.com> It seems that most of the Python SOAP server implementations (it seems as if there are around 28...) only support use as the "owner" of the port and not subsumed within Apache or IIS or something like that. Is that accurate? Are there any exceptions? -- Take a recipe. Leave a recipe. Python Cookbook! http://www.ActiveState.com/pythoncookbook From Juergen Hermann" Message-ID: On Wed, 29 Aug 2001 14:08:28 -0700, Brian Quinlan wrote: >Doing the merge avoids the necessity of going through Python for each >node, which I'm sure will greatly hinder the performance. You can export "raw" C interfaces from extension modules via a PyCObject. We sucessfully do this for some of our modules, it might work here, too. From Juergen Hermann" Message-ID: On Wed, 29 Aug 2001 15:36:56 -0700, Paul Prescod wrote: >It seems that most of the Python SOAP server implementations (it seems >as if there are around 28...) only support use as the "owner" of the >port and not subsumed within Apache or IIS or something like that. Is >that accurate? Are there any exceptions? ZSI explicitely avoids coupling to any transport mechanism. We currently look into using ZSI instead of SOAP.py, for that reason and because it's DOCUMENTED (surprise! ;). And I sucessfully integrated actzero's SOAP.py into Apache, at the expense of duplicating the "SOAPServer" class as "SOAPHandler" and then = adapting it. Ciao, J=FCrgen From m.favas@per.dem.csiro.au Thu Aug 30 00:00:24 2001 From: m.favas@per.dem.csiro.au (Mark Favas) Date: Thu, 30 Aug 2001 07:00:24 +0800 Subject: [XML-SIG] PyXML expat #includes instead of Message-ID: <3B8D7408.17C1EA6E@per.dem.csiro.au> The current CVS version of PyXML #inlcudes in its expat build. The current CVS version of Python now produces and installs pyconfig.h rather than config.h - the result being that XML doesn't build in a new Python install, and _appears_ to build and work in an older Python install where an old config.h is lying around. Any changes to pyconfig.h will not be picked up by XML. ./xml/extensions/expat/lib/xmlparse.c:7:# include "winconfig.h" ./xml/extensions/expat/lib/xmlparse.c:12:#include ./xml/extensions/expat/lib/xmlrole.c:10:# include "winconfig.h" ./xml/extensions/expat/lib/xmlrole.c:12:# include ./xml/extensions/expat/lib/xmltok.c:7:# include "winconfig.h" ./xml/extensions/expat/lib/xmltok.c:9:# include -- Mark Favas - m.favas@per.dem.csiro.au CSIRO, Private Bag No 5, Wembley, Western Australia 6913, AUSTRALIA From paulp@ActiveState.com Thu Aug 30 00:19:07 2001 From: paulp@ActiveState.com (Paul Prescod) Date: Wed, 29 Aug 2001 16:19:07 -0700 Subject: [XML-SIG] SOAP in CGI-like environments References: Message-ID: <3B8D786B.595D32B1@ActiveState.com> Juergen Hermann wrote: > >.... > > ZSI explicitely avoids coupling to any transport mechanism. We > currently look into using ZSI instead of SOAP.py, for that reason and > because it's DOCUMENTED (surprise! ;). That's fair but I'm trying to document it for people who would not want to be in the business of rolling their own transport... > And I sucessfully integrated actzero's SOAP.py into Apache, at the > expense of duplicating the "SOAPServer" class as "SOAPHandler" and then > adapting it. Rolling your own again. :-) Yes, it isn't that hard but I think a majority of programmers out there just want to point their server at their class and have it do all CGI wrapping for them. SOAP::Lite and the PHP equivalent have this feature. -- Take a recipe. Leave a recipe. Python Cookbook! http://www.ActiveState.com/pythoncookbook From rsalz@zolera.com Thu Aug 30 01:03:30 2001 From: rsalz@zolera.com (Rich Salz) Date: Wed, 29 Aug 2001 20:03:30 -0400 Subject: [XML-SIG] SOAP in CGI-like environments References: <3B8D786B.595D32B1@ActiveState.com> Message-ID: <3B8D82D2.52DA33E4@zolera.com> > > ZSI explicitely avoids coupling to any transport mechanism. We > > currently look into using ZSI instead of SOAP.py, for that reason and > > because it's DOCUMENTED (surprise! ;). > > That's fair but I'm trying to document it for people who would not want > to be in the business of rolling their own transport... I think you missed the point. ZSI was designed to work with *pre-existing* transports, such as Apache (such as through mod_python which is what we do), Python's HTTPServer (the release includes the server I use for SOAP interop testing), or sys.stdin, sys.stdout (which the docs show). Any object with a read method can be used for input, and anything with a write method can be used for output. Hope that's more clear. > jsut want to point their server at their class and have it do all CGI > wrapping for them. SOAP::Lite and the PHP equivalent have this feature. I know I can do at least as well as Paul K. :) (Just kidding; he's been very helpful in the interop testing.) Please take a look at the ZSI doc; if it doesn't do what you want, I'm probably quite willing to add what's missing. ZSI is at http://www.zolera.com/resources/opensrc, including PDF and HTML doc separate from the kit. I'll be release ZSI 1.1 in a day or two. /r$ -- Zolera Systems, Securing web services (XML, SOAP, Signatures, Encryption) http://www.zolera.com From paulp@ActiveState.com Thu Aug 30 02:00:56 2001 From: paulp@ActiveState.com (Paul Prescod) Date: Wed, 29 Aug 2001 18:00:56 -0700 Subject: [XML-SIG] SOAP in CGI-like environments References: <3B8D786B.595D32B1@ActiveState.com> <3B8D82D2.52DA33E4@zolera.com> Message-ID: <3B8D9048.14E62CCB@ActiveState.com> Rich Salz wrote: > >... > > Hope that's more clear. Yes. Now I understand. > > jsut want to point their server at their class and have it do all CGI > > wrapping for them. SOAP::Lite and the PHP equivalent have this feature. > > I know I can do at least as well as Paul K. :) (Just kidding; he's been > very helpful in the interop testing.) Please take a look at the ZSI > doc; if it doesn't do what you want, I'm probably quite willing to add > what's missing. I'm looking through it right now. Unfortunately every SOAP toolkit is different (often using conflicting terminology for the same stuff) so it takes me a while to figure each out. >From a pedagogic point of view, may I suggest you start your documentation with a SOAP "hello world." As in: use SOAP::Transport::HTTP; SOAP::Transport::HTTP::CGI -> dispatch_to('Demo') -> handle; package Demo; sub hi { return "hello, world"; } sub bye { return "goodbye, cruel world"; } I'm trying to work up a talk on how EASY it is to work with SOAP in scripting languages. I'll try to boil your example down to the barest essence and see how close it gets to SOAP::Lite. :-) -- Take a recipe. Leave a recipe. Python Cookbook! http://www.ActiveState.com/pythoncookbook From marklists@mceahern.com Thu Aug 30 02:19:19 2001 From: marklists@mceahern.com (Mark McEahern) Date: Wed, 29 Aug 2001 18:19:19 -0700 Subject: [XML-SIG] comparing xml documents In-Reply-To: Message-ID: Suppose I have two xml documents: >>> s1 = "" >>> s2 = "" and I want to make sure they are equal. This, clearly, won't do: >>> s1==s2 0 So I think, gee, lemme load 'em into a DOM: >>> from xml.dom.minidom import parseString >>> d1 = parseString(s1) >>> d2 = parseString(s2) Of course, I can't compare the two documents simply: >>> d1==d2 0 But I can do this: >>> d1.toxml()==d2.toxml() 1 Unfortunately, that's not all she wrote... For slightly more complicated cases, this simple approach doesn't work: >>> s1 = "" >>> s2 = "" >>> d1 = parseString(s1) >>> d2 = parseString(s2) >>> d1.toxml()==d2.toxml() 0 Of course, this example assumes that the order of siblings is irrelevant for comparison purposes--are there apps that are dependent on the order of sibling nodes? Yikes. It should be fairly easy to implement a helper comparison function for the DOM (you could even give it hints like ignore sibling order or strict sibling order), but since I'm eminently lazy, I figured I'd ask you folks if someone has already made that relatively modest effort unnecessary. Thanks, // mark p.s. Oh the philosophy classes I could have skipped if only I had known that truth was nonzero! (That's a lame joke, isn't it?) From paulp@ActiveState.com Thu Aug 30 02:25:13 2001 From: paulp@ActiveState.com (Paul Prescod) Date: Wed, 29 Aug 2001 18:25:13 -0700 Subject: [XML-SIG] comparing xml documents References: Message-ID: <3B8D95F9.51D5BD18@ActiveState.com> Mark McEahern wrote: > >... > > Of course, this example assumes that the order of siblings is irrelevant for > comparison purposes--are there apps that are dependent on the order of > sibling nodes? YES! A ton! ... ... ...</titel> ... </chapter> Every XHTML web page in the world depends on order. SOAP messages often use ordering to differentiate parameters. -- Take a recipe. Leave a recipe. Python Cookbook! http://www.ActiveState.com/pythoncookbook From marklists@mceahern.com Thu Aug 30 02:36:00 2001 From: marklists@mceahern.com (Mark McEahern) Date: Wed, 29 Aug 2001 18:36:00 -0700 Subject: [XML-SIG] comparing xml documents In-Reply-To: <3B8D95F9.51D5BD18@ActiveState.com> Message-ID: <NCBBLFCOHHDIKCAFGCFBCEOIJCAA.marklists@mceahern.com> > YES! A ton! > > <chapter><title>... > ... > > ...</titel> > ... > </chapter> > > Every XHTML web page in the world depends on order. Hmm, in that case, doc1.toxml()==doc2.toxml() is probably just right, then? What do folks generally do when they want to compare two xml documents? // m From rsalz@zolera.com Thu Aug 30 02:52:21 2001 From: rsalz@zolera.com (Rich Salz) Date: Wed, 29 Aug 2001 21:52:21 -0400 Subject: [XML-SIG] comparing xml documents References: <NCBBLFCOHHDIKCAFGCFBCEOIJCAA.marklists@mceahern.com> Message-ID: <3B8D9C55.F010EF58@zolera.com> > Hmm, in that case, doc1.toxml()==doc2.toxml() is probably just right, then? I'm not sure. The following are semantically equivalent: <a foo='fooval' bar='barval'/> <a bar='barval' foo='fooval'></a> <a xmlns='' bar='barval' foo='fooval'/> Should the compare the same? Probably. I'd be surprised if the toxml method worked. > What do folks generally do when they want to compare two xml documents? You have to do something like convert them to a canonical form and compare those. Luckily :), pyxml (the CVS version, not yet the released version) has XML C14N code. You can rip that out and use it stand-alone. (Shameless plug) you can also find it on the W3C web site, look for XML Digital Signature. Hope this helps. /r$ -- Zolera Systems, Securing web services (XML, SOAP, Signatures, Encryption) http://www.zolera.com From marklists@mceahern.com Thu Aug 30 03:00:04 2001 From: marklists@mceahern.com (Mark McEahern) Date: Wed, 29 Aug 2001 19:00:04 -0700 Subject: [XML-SIG] comparing xml documents In-Reply-To: <3B8D9C55.F010EF58@zolera.com> Message-ID: <NCBBLFCOHHDIKCAFGCFBAEOJJCAA.marklists@mceahern.com> > I'm not sure. The following are semantically equivalent: > <a foo='fooval' bar='barval'/> > <a bar='barval' foo='fooval'></a> > <a xmlns='' bar='barval' foo='fooval'/> > Should the compare the same? Probably. I'd be surprised if the toxml > method worked. Believe it or not, xml.dom.minidom squirts out identical xml for the first two. It pukes on the third one, though: >>> s3 = "<a xmlns='' bar='barval' foo='fooval'/>" >>> d3 = parseString(s3) >>> d3.toxml() Traceback (most recent call last): File "<interactive input>", line 1, in ? File "C:\Python21\_xmlplus\dom\minidom.py", line 86, in toxml self.writexml(writer) File "C:\Python21\_xmlplus\dom\minidom.py", line 891, in writexml node.writexml(writer, indent, addindent, newl) File "C:\Python21\_xmlplus\dom\minidom.py", line 571, in writexml _write_data(writer, attrs[a_name].value) File "C:\Python21\_xmlplus\dom\minidom.py", line 265, in _write_data data = replace(data, "&", "&") File "c:\python21\lib\string.py", line 369, in replace return s.replace(old, new, maxsplit) AttributeError: 'None' object has no attribute 'replace' Thanks for the tip about C14N--I'll have to check that out! // mark From rsalz@zolera.com Thu Aug 30 04:21:09 2001 From: rsalz@zolera.com (Rich Salz) Date: Wed, 29 Aug 2001 23:21:09 -0400 Subject: [XML-SIG] SOAP in CGI-like environments References: <m15cEIV-007oeFC@smtp.web.de> <3B8D786B.595D32B1@ActiveState.com> <3B8D82D2.52DA33E4@zolera.com> <3B8D9048.14E62CCB@ActiveState.com> Message-ID: <3B8DB125.37C4D6C1@zolera.com> This is a multi-part message in MIME format. --------------2ED5E5B62C8B18B8FA985AC0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Yes, one of the things missing from ZSI is a dispatch framework. There are a couple of reasons for that. First, I wanted to get some feedback on usage models before "blessing" one particular style. It's also a result of my transport-neutral approach; ZOPE's dispatch style is probably different from a dynamic application gateway, which is different from a dedicated apache-based web service, etc. > >From a pedagogic point of view, may I suggest you start your > documentation with a SOAP "hello world." As in: > > use SOAP::Transport::HTTP; > > SOAP::Transport::HTTP::CGI -> dispatch_to('Demo') -> handle; > > package Demo; > sub hi { return "hello, world"; } > sub bye { return "goodbye, cruel world"; } Does this mean that an incoming message like <S:Envelope xmlns:S="...."> <S:Body><hi/></S:Body> </S:Envelope> means that the &Demo::hi() is invoked and a return packet like <S:Envelope xmlns:S="...."> <S:Body> <hiResponse xsi:type="xsd:string">hello, world</hiResponse> </S:Body></S:Envelope> is sent back? Welll... I suppose I could do something like that. :) I do have a couple of questions, tho. What if there is data in the sent <hi> element? Is that parsed and passed as parameters to the hi() method? Which must then check for parameters, or ignore them? That is, can I do <S:Body><hi><p1>you stinking</p1><foo>mongrel</foo></hi></S:Body> ? It turns out, I believe, that SOAP::Lite won't actually be able to parse that message. It requires the SOAP message to be fully typed. But if it *could* parse it, I assume the p1 and foo parameters would somehow be made available (as a dictionary?) to Demo::hi. But suppose hi takes no parameters? Does Demo::hi have to error-check and be ready to generate faults? More on this below... I'm headed somewhere. > I'm trying to work up a talk on how EASY it is to work with SOAP in > scripting languages. It's easy to be loose and sloppy, but I think it's actually hard to do the right thing. SOAP in RPC mode is really strongly-typed, and that makes an interesting mix when you work with loosely-typed scripting languages. ZSI is different from other scripting SOAP implementations -- it seems to be the only Python one that can work with typed and -- if you have a "schema," in the form of ZSI "typecodes" -- completely untyped messages. ZSI enforces type-correctness at th SOAP message level. If you want the "hi" method <hi>...</hi> to take any kind of parameter, you must explicitly say "TC.Any()" and ZSI will try interpret the message (provided it contains type information) or raise an "Unparseable message" exception. "Python ZSI" is intended to evoke "Java RMI", on purpose. > I'll try to boil your example down to the barest > essence and see how close it gets to SOAP::Lite. :-) Attached is something that I could add to ZSI. I think it works like the SOAP::Lite dispatcher, or as close as it can without using 'eval' :) Not tested, but byte-compiled. /r$ -- Zolera Systems, Securing web services (XML, SOAP, Signatures, Encryption) http://www.zolera.com --------------2ED5E5B62C8B18B8FA985AC0 Content-Type: text/plain; charset=us-ascii; name="cgizsi.py" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="cgizsi.py" #! /usr/bin/env python '''Simple CGI dispatching for ZSI. Sample use: def hello(arg): "We accept (and ignore) any input arguments." return 'hello world' # Define any other functions that you wish to expose. from ZSI import CGI CGI.dispatch(__name__) ''' from ZSI import * import sys,types from os import environ as ENV def dispatch(parentmodulename): if ENV.get('REQUEST_METHOD', None) != 'POST': print """Status: 200 OK Content-Type: text/xml <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <SOAP-ENV:Fault> <faultcode>Client</faultcode> <faultstring>Must use POST</faultstring> <SOAP-ENV:Fault> </SOAP-ENV:Body> </SOAP-ENV:Envelope> """ return # XXX We could look at ENV['CONTENT_TYPE'] and if its multipart # XXX we could create a CIDResolver and do SOAP with Attachments. # XXX Another time, perhaps. try: ps = ParsedSoap(sys.stdin.read(int(ENV['CONTENT_LENGTH']))) what = ps.body_root.localName caller = sys.modules[parentmodulename] if not callable(handler): raise TypeError, "Uncallable method" arg = ps.Parse(TC.Any()) result = caller.what(arg) print """Status: 200 OK Content-Type: text/xml """ SoapWriter(sys.stdout).serialize(result, TC.Any()) except Exception, e: # Something went wrong, send a fault. print """Status: 200 OK Content-Type: text/xml """ FaultFromException(e).AsSoap(sys.stdout) --------------2ED5E5B62C8B18B8FA985AC0-- From Alexandre.Fayolle@logilab.fr Thu Aug 30 08:51:44 2001 From: Alexandre.Fayolle@logilab.fr (Alexandre Fayolle) Date: Thu, 30 Aug 2001 09:51:44 +0200 (CEST) Subject: [XML-SIG] comparing xml documents In-Reply-To: <NCBBLFCOHHDIKCAFGCFBCEOHJCAA.marklists@mceahern.com> Message-ID: <Pine.LNX.4.21.0108300946540.14390-100000@orion.logilab.fr> On Wed, 29 Aug 2001, Mark McEahern wrote: > Suppose I have two xml documents: > > >>> s1 = "<Foo id='1' type='bar'/>" > >>> s2 = "<Foo type='bar' id='1'/>" > > and I want to make sure they are equal. Then you may want to give a try to XMLdiff available at http://www.logilab.org/xmldiff/ The current version has a slight algorithm complexity problem which makes it unusable for medium to large documents, but we are working on another algorithm that we should be releasing by the end of the week which dramatically improves the performance on big documents (at the cost of having a slightly less optimal output). The new release will be announced on the xml-sig mailing list, so stay tuned. Cheers, Alexandre Fayolle -- LOGILAB, Paris (France). http://www.logilab.com http://www.logilab.fr http://www.logilab.org Narval, the first software agent available as free software (GPL). From Nicolas.Chauvat@logilab.fr Thu Aug 30 17:09:18 2001 From: Nicolas.Chauvat@logilab.fr (Nicolas Chauvat) Date: Thu, 30 Aug 2001 18:09:18 +0200 (CEST) Subject: [XML-SIG] [bug] Encoding troubles with attributes' CDATA, py1.5.2 + pyxml 0.6.6 Message-ID: <Pine.LNX.4.21.0108301803490.23754-100000@aries.logilab.fr> Hi List, With python 1.5.2 and PyXml 0.6.6, I get problems when executing the following piece of code : >>> s = '<?xml version="1.0" encoding="ISO-8859-1"?><d nom="Détails de la specialité" />' >>> d = Sax2.FromXml(s) >>> PrettyPrint(d,encoding='iso-8859-1') <?xml version='1.0' encoding='iso-8859-1'?> <!DOCTYPE d> <d nomTraceback (innermost last): File "<stdin>", line 1, in ? File "/usr/lib/python1.5/site-packages/xml/dom/ext/__init__.py", line 82, in PrettyPrint Printer.PrintWalker(visitor, root).run() File "/usr/lib/python1.5/site-packages/xml/dom/ext/Printer.py", line 384, in run return self.step() File "/usr/lib/python1.5/site-packages/xml/dom/ext/Printer.py", line 380, in step self.visitor.visit(self.start_node) File "/usr/lib/python1.5/site-packages/xml/dom/ext/Printer.py", line 186, in visit return self.visitDocument(node) File "/usr/lib/python1.5/site-packages/xml/dom/ext/Printer.py", line 232, in visitDocument self.visitNodeList(node.childNodes, exclude=node.doctype) File "/usr/lib/python1.5/site-packages/xml/dom/ext/Printer.py", line 202, in visitNodeList curr is not exclude and self.visit(curr) File "/usr/lib/python1.5/site-packages/xml/dom/ext/Printer.py", line 162, in visit return self.visitElement(node) File "/usr/lib/python1.5/site-packages/xml/dom/ext/Printer.py", line 266, in visitElement self.visitAttr(attr) File "/usr/lib/python1.5/site-packages/xml/dom/ext/Printer.py", line 219, in visitAttr self._write("=%s%s%s" % (delimiter, text, delimiter)) File "/usr/lib/python1.5/site-packages/xml/dom/ext/Printer.py", line 146, in _write obj = utf8_to_code(text, self.encoding) File "/usr/lib/python1.5/site-packages/xml/dom/ext/Printer.py", line 65, in utf8_to_code text = ws.encode(encoding) File "/usr/lib/python1.5/site-packages/xml/unicode/iso8859.py", line 81, in encode char, input = utf8_iso.utf8_to_code(codeset, input) File "/usr/lib/python1.5/site-packages/xml/unicode/utf8_iso.py", line 88, in utf8_to_code raise ConvertError("Unicode character %x not supported in ISO-8859-%d"\ xml.unicode.utf8_iso.ConvertError: Unicode character 9d21 not supported in ISO-8859-1 However, >>> s = '<?xml version="1.0" encoding="ISO-8859-1"?><d>Détails de la specialité</d>' >>> d = Sax2.FromXml(s) >>> PrettyPrint(d,encoding='iso-8859-1') works fine. Please don't tell me to drop python 1.5.2 in favor of python 2.2 (that's a leap!), for it has to run with Zope 2.3 and Python 1.5.2... for now. I'll look into it, but any help will be appreciated :-) -- Nicolas Chauvat http://www.logilab.com - "Mais où est donc Ornicar ?" - LOGILAB, Paris (France) From Alexandre.Fayolle@logilab.fr Thu Aug 30 17:26:32 2001 From: Alexandre.Fayolle@logilab.fr (Alexandre Fayolle) Date: Thu, 30 Aug 2001 18:26:32 +0200 (CEST) Subject: [XML-SIG] Re: [bug] Encoding troubles with attributes' CDATA, py1.5.2 + pyxml 0.6.6 In-Reply-To: <Pine.LNX.4.21.0108301803490.23754-100000@aries.logilab.fr> Message-ID: <Pine.LNX.4.21.0108301820120.15747-100000@orion.logilab.fr> On Thu, 30 Aug 2001, Nicolas Chauvat wrote: > Hi List, > > With python 1.5.2 and PyXml 0.6.6, I get problems when executing the > following piece of code : > > >>> s = '<?xml version="1.0" encoding="ISO-8859-1"?><d nom="Détails de la > specialité" />' > >>> d = Sax2.FromXml(s) > >>> PrettyPrint(d,encoding='iso-8859-1') <snip> Well actually this code will break with python 2.1 and pyxml 0.6.6 too. The problem is that the Printer class will convert the data from utf-8 to latin-1 twice for attributes : if you give a look at the visitAttr method, it first calls TranslateCdata (which does the first conversion), and then _write which attempts to convert the code again, resulting in the exception being raised. Alexandre Fayolle -- LOGILAB, Paris (France). http://www.logilab.com http://www.logilab.fr http://www.logilab.org Narval, the first software agent available as free software (GPL). From noreply@sourceforge.net Thu Aug 30 18:45:02 2001 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 30 Aug 2001 10:45:02 -0700 Subject: [XML-SIG] [ pyxml-Bugs-456925 ] Encoding troubles with attributes' CDATA Message-ID: <E15cVsE-00005C-00@usw-sf-web1.sourceforge.net> Bugs item #456925, was opened at 2001-08-30 10:45 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=106473&aid=456925&group_id=6473 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Logilab (ornicar) Assigned to: Nobody/Anonymous (nobody) Summary: Encoding troubles with attributes' CDATA Initial Comment: Encoding troubles with attributes' CDATA with pyxml 0.6.6 See http://mail.python.org/pipermail/xml-sig/2001-August/005994.html and http://mail.python.org/pipermail/xml-sig/2001-August/005995.html for details. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=106473&aid=456925&group_id=6473 From Juergen Hermann" <jh@web.de Thu Aug 30 23:15:13 2001 From: Juergen Hermann" <jh@web.de (Juergen Hermann) Date: Fri, 31 Aug 2001 00:15:13 +0200 Subject: [XML-SIG] Default namespace Message-ID: <m15ca5g-007onTC@smtp.web.de> Hi! What should the default namespace URI be bound to? u'' or None? Ciao, J=FCrgen From Juergen Hermann" <jh@web.de Thu Aug 30 23:29:35 2001 From: Juergen Hermann" <jh@web.de (Juergen Hermann) Date: Fri, 31 Aug 2001 00:29:35 +0200 Subject: [XML-SIG] Working Xerces SAX2 parser Message-ID: <m15caJa-007ouYC@smtp.web.de> Hi! Ignore my last msg regarding namespaces (had to map u"" to None). The SAX2 binding now works, except for attributes (a few hours work) What's also missing is locators, and DTD and entity handlers. Ciao, J=FCrgen From news@quixer.com Fri Aug 31 05:36:15 2001 From: news@quixer.com (Quixer) Date: Fri, 31 Aug 2001 00:36:15 -0400 Subject: [XML-SIG] Quixer's Ultimate Fake ID's Message-ID: <419.437134.02231088news@quixer.com> Want to learn how to make a fake id? Visit http://www.quixer.com to learn the secrets. We explain how to make holograms, where to buy supplies, how to build magnetic encoders and more. Informational purposes only :] Come check us out at http://www.quixer.com ! From larsga@garshol.priv.no Fri Aug 31 08:23:34 2001 From: larsga@garshol.priv.no (Lars Marius Garshol) Date: 31 Aug 2001 09:23:34 +0200 Subject: [XML-SIG] Default namespace In-Reply-To: <m15ca5g-007onTC@smtp.web.de> References: <m15ca5g-007onTC@smtp.web.de> Message-ID: <m31yls7kw9.fsf@lambda.garshol.priv.no> * Juergen Hermann | | What should the default namespace URI be bound to? u'' or None? Do you mean what the namespace URI of elements with no namespace is? It is None. Java SAX uses "" to avoid awkwardness in applications which would have had to do a != null && a.equals("foo") had the default URI been None. We decided to use None in Python, since Python has no such problems, and since felt more natural. I put in a mention of this in the documentation string for ContentHandler now. --Lars M. From Juergen Hermann" <jhe@webde-ag.de Fri Aug 31 13:05:33 2001 From: Juergen Hermann" <jhe@webde-ag.de (Juergen Hermann) Date: Fri, 31 Aug 2001 14:05:33 +0200 Subject: [XML-SIG] Handling of attribute namespaces Message-ID: <m15cn3F-007ocnC@smtp.web.de> Hi! Can someone explain why we have, in the following code, the handling for NS==None in tag names, but not in attribute names? Smells like a bug. def startElementNS(self, name, qname, attrs): if name[0] is None: name = name[1] elif self._current_context[name[0]] is None: # default namespace name = name[1] else: name = self._current_context[name[0]] + ":" + name[1] self._out.write('<' + name) for k,v in self._undeclared_ns_maps: if k is None: self._out.write(' xmlns="%s"' % v) else: self._out.write(' xmlns:%s="%s"' % (k,v)) self._undeclared_ns_maps = [] for (name, value) in attrs.items(): name = self._current_context[name[0]] + ":" + name[1] self._out.write(' %s=%s' % (name, quoteattr(value))) self._out.write('>') What I get is this: <?xml version="1.0" encoding="iso-8859-1"?> <bibliography> !!!! The following are the args to the __init__ of AttributeNSImpl! *** Attrs = {(None, u'id'): u'prescod:1999'} *** Qnames = {(None, u'id'): u'id'} <bookTraceback (most recent call last): File "tests/test.py", line 38, in ? parser.parse(os.path.join(os.path.dirname(sys.argv[0]), "books.xml")) File "/netsite/lib/python2.0/_xmlplus/sax/saxutils.py", line 208, in startElementNS name = self._current_context[name[0]] + ":" + name[1] KeyError When parsing this file: <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE bibliography SYSTEM "books.dtd"> <bibliography> <book id="prescod:1999"> <author>Paul Prescod, Charles F. Goldfarb</author> <title>The XML Handbook Prentice Hall 1999 0130147141 paperback, 2nd edition, 1074 pages David M. Beazley, Guido Van Rossum Python Essential Reference New Riders Publishing 1999 0735709017 paperback, 319 p. Semmy Stumpp Projektmanagement mit MS-Project Markt & Technik 1999 3-82725603-8 gebundene Ausgabe, 523 S., mit CD-ROM From Juergen Hermann" Hi! This fixes the bug I found, can I commit it? Index: saxutils.py =================================================================== RCS file: /cvsroot/pyxml/xml/xml/sax/saxutils.py,v retrieving revision 1.20 diff -u -r1.20 saxutils.py --- saxutils.py 2001/07/19 16:15:44 1.20 +++ saxutils.py 2001/08/31 18:40:09 @@ -205,7 +205,13 @@ self._undeclared_ns_maps = [] for (name, value) in attrs.items(): - name = self._current_context[name[0]] + ":" + name[1] + if name[0] is None: + name = name[1] + elif self._current_context[name[0]] is None: + # default namespace + name = name[1] + else: + name = self._current_context[name[0]] + ":" + name[1] self._out.write(' %s="%s"' % (name, escape(value))) self._out.write('>') From Juergen Hermann" e:\Programme\DevStudio\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX -DHAVE_EXPAT_H - DVERSION="1.95.2" -DXML_NS=1 -DXML_DTD=1 -DXML_BYTE_ORDER=12 -DXML_CONTEXT_BYTES =1024 -Iextensions/expat/lib -IE:\PROGRAMME\PYTHON21\Include /Tcextensions/expat /lib/xmlparse.c /Fobuild\temp.win32-2.1\Release\xmlparse.obj xmlparse.c extensions/expat/lib/xmlparse.c(109) : error C2059: Syntaxfehler : 'string' extensions/expat/lib/xmlparse.c(168) : error C2059: Syntaxfehler : 'string' extensions/expat/lib/xmlparse.c(171) : error C2059: Syntaxfehler : '}' extensions/expat/lib/xmlparse.c(174) : error C2143: Syntaxfehler : Fehlendes ';' vor '*' Any change that could cause that? From Juergen Hermann" Hi! When you checkout "test" on win32, you run into problems because someone checked this in without -kb, though all the text files have windows (CRLF) line endings. This also means that e.g. "a_oasis-logo.gif" is totally broken. I propose an "cvs admin -kb" on that tree. BTW, someone should put a README into the root of "test", describing what those directories contain. Ciao, J=FCrgen From brian@sweetapp.com Wed Aug 15 19:24:39 2001 From: brian@sweetapp.com (Brian Quinlan) Date: Wed, 15 Aug 2001 11:24:39 -0700 Subject: [XML-SIG] 4XSLT Performance Problems with Large Files In-Reply-To: <000301c13da4$4a211ee0$7cac1218@reston1.va.home.com> Message-ID: <002e01c125b7$8c053940$445d4540@Dell2> Thomas wrote: > At the start of the tests, I had from 194 to 210 MB free. I ran Saxon > 5.5.1, msxsl (the Microsoft command line wrapper around msxml3), a python > script 4xslt.py that I wrote some time ago, and the 4xslt.bat file as > supplied with 4Suite. My script uses cDomlette; I don't know what > 4xslt.bat uses, though I suspect it's not cDomlette for reasons that will > be apparent. Are there any features of 4xslt that you need that aren't available in other XSLT processors? Or is it just the convenience of doing XSLT transformations directly in Python that leads you to want to use 4xslt? If it is the later, Python buildings for Xalan, the Apache groups XSLT processor, are available (the Windows release has the most convenient installation process, if you have a choice of platforms to experiment with): http://sourceforge.net/project/showfiles.php?group_id=28142&release_id=4 7388 Documentation: http://pyana.sourceforge.net/docs/ If you are willing to send me your XML and XSLT files then I can do the transformation with Xalan and tell you how long it takes. Cheers, Brian From brian@sweetapp.com Wed Aug 15 22:09:23 2001 From: brian@sweetapp.com (Brian Quinlan) Date: Wed, 15 Aug 2001 14:09:23 -0700 Subject: [XML-SIG] 4XSLT Performance Problems with Large Files In-Reply-To: <001c01c13e22$3baba780$7cac1218@reston1.va.home.com> Message-ID: <002f01c125ce$914a7070$445d4540@Dell2> > Mainly, I don't want to start a separate process each time a user runs a > transform. Yep. Most transformation engines have pretty bad startup times. Though if your transformations are taking >10 seconds it probably doesn't matter. Xalan has a bit slower transformation speed than Saxon but has a horrible startup time (probably because it is so huge). Running it in-process solves that problem, of course. > I haven't used Xalan for a while and have been meaning to get the latest > versoin to try on this. The Python binding might be good to try. Thanks. The Python bindings are for Xalan 1.1. The CVS version works correctly with Xalan 1.2 but hasn't been extensively tested. I can send you a binary if you are interested. Cheers, Brian