From faassen@vet.uu.nl Sat Mar 1 01:40:57 2003 From: faassen@vet.uu.nl (Martijn Faassen) Date: Sat, 1 Mar 2003 02:40:57 +0100 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: <20030228155221.A14986@cutter.rexx.com> References: <20030228155221.A14986@cutter.rexx.com> Message-ID: <20030301014057.GA11922@vet.uu.nl> Dave Kuhlman wrote: > I recently installed Python 2.3a2. The check for PyXML version in > xml.__init__.py requires PyXML 8.2. > > So this message is just a heads up to those who install > Python 2.3a2 that they will need the newest PyXML. > > I'm just hoping to save someone the time that it takes to track > this down. > > Or, am I the only one who didn't know? Ugh. More evidence the whole system of having _xmlplus magically plug into the 'xml' package should go away, in my opinion! It'd be really much easier to understand things like this if PyXML had its own top level package and left Python's 'xml' package alone.. Regards, Martijn From uche.ogbuji@fourthought.com Sat Mar 1 23:18:17 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Sat, 01 Mar 2003 16:18:17 -0700 Subject: [XML-SIG] soapy hacking -- getAttributeNS In-Reply-To: Message from Mark Bucciarelli of "Wed, 26 Feb 2003 22:48:23 GMT." <200302262248.23589.mark@easymailings.com> Message-ID: > Stupid question ... what's the proper way to retrieve the value of the name > attribute using pnode.getAttributeNS()? > > >>> pnode = pnodes[0] > >>> xml.dom.ext.PrettyPrint(pnode) > > xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:typens='urn:BarCodes' > xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/' > xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/' > xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' > binding='typens:BarCodesBinding' name='BarCodesPort'> > > > >>> pnode.getAttributeNS('', 'name') > '' > >>> pnode.getAttribute('name') > u'BarCodesPort' > >>> pnode.getAttributeNS('http://schemas.xmlsoap.org/wsdl/', 'name') > '' > >>> pnode.getAttributeNS('urn:BarCodes', 'name') > '' None represents the empty namespace, not ''. You should use xml.dom.EMPTY_NAMESPACE -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com The open office file format - http://www-106.ibm.com/developerworks/xml/library/x-think15/ 4Suite Repository Features - https://www6.software.ibm.com/reg/devworks/dw-x4suite5-i/ XML class warfare - http://www.adtmag.com/article.asp?id=6965 See you at XML Web Services One - http://www.xmlconference.com/santaclara/ From uche.ogbuji@fourthought.com Sat Mar 1 23:42:48 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Sat, 01 Mar 2003 16:42:48 -0700 Subject: [XML-SIG] [SOLVED] soapy hacking -- getAttributeNS In-Reply-To: Message from Mark Bucciarelli of "Thu, 27 Feb 2003 02:58:22 GMT." <200302270258.22807.mark@easymailings.com> Message-ID: > On Wednesday 26 February 2003 10:48 pm, Mark Bucciarelli wrote: > > > Stupid question ... what's the proper way to retrieve the value of the name > > attribute using pnode.getAttributeNS()? > > Nope. To get at an attribute without a namespace prefix, you must use > getAttribute, not getAttributeNS. Noooooooooo! :-) Please do not mix up getAttribute and getAttributeNS. If you use namespaces, stick to the latter. Your problem, as I mentioned, was that you should have been using xml.dom.EMPTY_NAMESPACE, which is None, not ''. > Another interesting thing I found is if an attribute does have a prefix, then > the xmlns declaration must be in a parent tag--it cannot be in the same tag > as the attribute. Hmm? Not true at all. > So, there is no way to get the value of the name attribute from the following > xml: > > s = "" > > Maybe this isn't legal xml. Course it is, and works just fine for me. If you insist on using 4DOM: >>> from xml.dom.ext.reader import Sax2 >>> reader = Sax2.Reader() >>> doc = reader.fromString(" ") >>> test_node = doc.documentElement.firstChild >>> test_node.getAttributeNS(u'http://123', u'name') u'abc' BTW, using 4Suite's Domlette, which is *much* faster than 4DOM you would use: >>> from Ft.Xml.Domlette import NonvalidatingReader >>> doc = NonvalidatingReader.parseString("","file:bogus.xml") >>> test_node = doc.documentElement.firstChild >>> test_node.attributes[(u'http://123', u'name')].value u'abc' May I suggest my Python/XML articles? They cover some of the issues you've run into: http://www.xml.com/pub/au/84 There is also a lot of relevant stuff on my Akara site: http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/pyxml-akara -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com The open office file format - http://www-106.ibm.com/developerworks/xml/library/x-think15/ 4Suite Repository Features - https://www6.software.ibm.com/reg/devworks/dw-x4suite5-i/ XML class warfare - http://www.adtmag.com/article.asp?id=6965 See you at XML Web Services One - http://www.xmlconference.com/santaclara/ From uche.ogbuji@fourthought.com Sun Mar 2 00:52:06 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Sat, 01 Mar 2003 17:52:06 -0700 Subject: [XML-SIG] Different results on Windows and Linux In-Reply-To: Message from Christian Zagrodnick of "Thu, 27 Feb 2003 17:31:15 +0100." <20030227163115.GB4395@gocept.com> Message-ID: > Hi there > > running the following little script on both windows (active state python > 2.2.2 with pyxml 0.8.2) and linux (python 2.2.2 with same pyxml) > > from xml.dom.minidom import parseString > doc = parseString('12345') > from xml import xpath > from xml.xpath.Context import Context > context = Context(doc, 0, 0) > print xpath.Evaluate('/alpha/beta[attribute::no = 1]', context=context) > > results in [] (correct) on windows and [, > ] (wrong) on Linux. > > This probably has todo with Python's broken NaN implementation. > Nevertheless it should work on all platforms. Ouch. This is still a bug in the latest 4Suite (which I recommend over the XPath bundled in PyXML for now). I filed: http://sourceforge.net/tracker/index.php?func=detail&aid=695819&group_id=39954& atid=428292 -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com The open office file format - http://www-106.ibm.com/developerworks/xml/librar y/x-think15/ 4Suite Repository Features - https://www6.software.ibm.com/reg/devworks/dw-x4su ite5-i/ XML class warfare - http://www.adtmag.com/article.asp?id=6965 See you at XML Web Services One - http://www.xmlconference.com/santaclara/ From uche.ogbuji@fourthought.com Sun Mar 2 01:15:43 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Sat, 01 Mar 2003 18:15:43 -0700 Subject: [XML-SIG] WSDL Test Suite? In-Reply-To: Message from Mark Bucciarelli of "Thu, 27 Feb 2003 16:46:10 EST." <200302271646.10610.mark@easymailings.com> Message-ID: > On Thursday 27 February 2003 11:53 am, M.-A. Lemburg wrote: > > Mark Bucciarelli wrote: > > > Looks like I've got soapy parsing WSDL using only native Python 2 > > > libraries. > [...] > > Did you have to make any changes to soapy to get it up and > > running ? > > A few minor ones. > > - element.getAttributeNS('', 'name') had to be replaced by > getAttribute('name'). Did the Python API change? See my other messages on this. > - namespaces had to be added > > - use xml.dom.minidom instead of a PyExpat.Reader() > > - a couple for loops needed to be changed. soap.py had stuff like this: > > for attrns, attrkey in node.attributes.keys(): > > that I couldn't get to work. Did the python API change? You couldn't get that to work with minidom? >>> from xml.dom.minidom import parseString >>> doc = parseString('') >>> e = doc.documentElement >>> e.attributes.items() [(u'eggs', u'a')] >>> e.attributes.keys() [u'eggs'] > When I test it a bit more, I'll post the updated version and try to contact > Adam Elman, the author. > > I'd like to better understand how to deal with all the various namespace > URI's; for example, it looks like xsd has had at least three different URI's: > > www.w3.org/1999/XMLSchema > www.w3.org/2000/10/XMLSchema > www.w3.org/2001/XMLSchema These were all intermediate drafts of XSD. No one should be using the older namespaces. I think SOAPy should eliminate the older ones. > There are similar multiples for the soap, enc, xsi prefixes. Ditto xsi. SOAP and SOAP-ENC, however, are different matters. The Web services folks shot themselves in the foot by callign several releases "ready", and so there are generally 2 sets of namespaces, both of which realy need to be honored in practice. > From my > reading, I would assume that a properly formed WSDL doc (and SOAP doc) will > specify what URI to associate with each prefix. No no no. This URI specified in the interface def is fo the app-specific nmespace, not for the SOAP and XSD namespaces, which come from standardization. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com The open office file format - http://www-106.ibm.com/developerworks/xml/librar y/x-think15/ 4Suite Repository Features - https://www6.software.ibm.com/reg/devworks/dw-x4su ite5-i/ XML class warfare - http://www.adtmag.com/article.asp?id=6965 See you at XML Web Services One - http://www.xmlconference.com/santaclara/ From uche.ogbuji@fourthought.com Sun Mar 2 01:27:53 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Sat, 01 Mar 2003 18:27:53 -0700 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: Message from Martijn Faassen of "Sat, 01 Mar 2003 02:40:57 +0100." <20030301014057.GA11922@vet.uu.nl> Message-ID: I've stayed out of the _xmlplus thread because I really don't feel strongly enough about the issue one way or another (nor did I when the initial discussions took place). I understand that _xmlplus can be confusing when problems come abut, but on the other hand, it would seem to me the best approach is to just try to avoid those problems in the first place. I also wonder that the proposed change is too disruptive, given all the extant code that might depend on the ld arrnagement. On the flip side of that, I'm usually less of a stickler for backwar compat than most if it involves a chaneg that does the right thing. So does ditching _xmlplus even do the right thing? Is there so little discssion about this here because so few care? > Dave Kuhlman wrote: > > I recently installed Python 2.3a2. The check for PyXML version in > > xml.__init__.py requires PyXML 8.2. > > > > So this message is just a heads up to those who install > > Python 2.3a2 that they will need the newest PyXML. > > > > I'm just hoping to save someone the time that it takes to track > > this down. > > > > Or, am I the only one who didn't know? > > Ugh. More evidence the whole system of having _xmlplus magically plug > into the 'xml' package should go away, in my opinion! It'd be really > much easier to understand things like this if PyXML had its own top level > package and left Python's 'xml' package alone.. I'm not really sure I understand this comment. PyXML 0.8.1 had serious problems with the bundled expat, so I think it's a good idea to try to compel people to upgrade in this manner. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com The open office file format - http://www-106.ibm.com/developerworks/xml/librar y/x-think15/ 4Suite Repository Features - https://www6.software.ibm.com/reg/devworks/dw-x4su ite5-i/ XML class warfare - http://www.adtmag.com/article.asp?id=6965 See you at XML Web Services One - http://www.xmlconference.com/santaclara/ From uche.ogbuji@fourthought.com Sun Mar 2 01:30:49 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Sat, 01 Mar 2003 18:30:49 -0700 Subject: [XML-SIG] Different results on Windows and Linux In-Reply-To: Message from Uche Ogbuji of "Sat, 01 Mar 2003 17:52:06 MST." Message-ID: > > Hi there > > > > running the following little script on both windows (active state python > > 2.2.2 with pyxml 0.8.2) and linux (python 2.2.2 with same pyxml) > > > > from xml.dom.minidom import parseString > > doc = parseString('12345') > > from xml import xpath > > from xml.xpath.Context import Context > > context = Context(doc, 0, 0) > > print xpath.Evaluate('/alpha/beta[attribute::no = 1]', context=context) > > > > results in [] (correct) on windows and [, > > ] (wrong) on Linux. > > > > This probably has todo with Python's broken NaN implementation. > > Nevertheless it should work on all platforms. > > Ouch. This is still a bug in the latest 4Suite (which I recommend over the > XPath bundled in PyXML for now). I filed: > > http://sourceforge.net/tracker/index.php?func=detail&aid=695819&group_id=39954& > atid=428292 I see you filed a PyXML bug on this. OK. If the fix comes in 4Suite first, it can be ported over to PyXML, and vice versa. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com The open office file format - http://www-106.ibm.com/developerworks/xml/librar y/x-think15/ 4Suite Repository Features - https://www6.software.ibm.com/reg/devworks/dw-x4su ite5-i/ XML class warfare - http://www.adtmag.com/article.asp?id=6965 See you at XML Web Services One - http://www.xmlconference.com/santaclara/ From james.kew@btinternet.com Sun Mar 2 09:58:50 2003 From: james.kew@btinternet.com (James Kew) Date: Sun, 2 Mar 2003 09:58:50 -0000 Subject: [XML-SIG] Re: Finding _xmlplus in Python 2.3a2 References: Message-ID: Uche Ogbuji wrote: > So does ditching _xmlplus even do the right thing? Is there so little > discssion about this here because so few care? As a PyXML user, I'm +0 on leaving it as-is: it works for me. Forcing me to import from somewhere else breaks my code. I can't, as a developer, completely ignore _xmlplus, though: if I want to sniff for presence and/or version of PyXML I have to explicitly look for _xmplus.__version__: xml.__version__ in a base Python distribution exists, and is higher, than xml.__version__ in a base distribution + PyXML. At the moment, though, I only do this in my email-me-the-traceback exception handler -- generally it's easier and better to simply attempt to import what I need from xml and raise the user an "install PyXML" if the import fails. Finally, I'd always assumed that the xml-aliases-to-_xmlplus business was a trick to allow PyXML to eventually _become_ the standard Python xml library with minimal impact on early adopters. Am I way off base here? -- James Kew james.kew@btinternet.com From noreply@sourceforge.net Sun Mar 2 16:53:33 2003 From: noreply@sourceforge.net (SourceForge.net) Date: Sun, 02 Mar 2003 08:53:33 -0800 Subject: [XML-SIG] [ pyxml-Bugs-696087 ] DocumentType: systemId/publicId swapped Message-ID: Bugs item #696087, was opened at 2003-03-02 17:53 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=106473&aid=696087&group_id=6473 Category: SAX Group: None Status: Open Resolution: None Priority: 5 Submitted By: Jens Quade (snejsource) Assigned to: Nobody/Anonymous (nobody) Summary: DocumentType: systemId/publicId swapped Initial Comment: Using the non-validating DOM reader, the Public/System Identifier in the DocType element got swapped. ================== Demo (uses DOM, because I encountered the problem using xml.dom.ext.reader.Sax2): >>> x=""" ... ...

foo

... """ >>> from xml.dom.ext.reader.Sax2 import FromXml >>> dom=FromXml(x) >>> dom.doctype.publicId >>> u'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd' >>> dom.doctype.systemId u'-//W3C//DTD XHTML 1.0 Transitional//EN' >>> dom=FromXml(x,validate=1) >>> dom.doctype.publicId u'-//W3C//DTD XHTML 1.0 Transitional//EN' >>> dom.doctype.systemId u'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd' ==================== Bug hunting: The pyexpat reader implements start_doctype_decl with wrong parameter order: def start_doctype_decl(self, name, pubid, sysid, has_internal_subset): self._lex_handler_prop.startDTD(name, pubid, sysid) in expatreader.py vs. /* This is called for the start of the DOCTYPE declaration, before any DTD or internal subset is parsed. */ typedef void (*XML_StartDoctypeDeclHandler)(void *userData, const XML_Char *doctypeName, const XML_Char *sysid, const XML_Char *pubid, int has_internal_subset); ==================== After swapping pubid/sysid in the start_doctype_decl parameter list of _xmlplus/sax/expatreader.py , the problem was gone. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=106473&aid=696087&group_id=6473 From faassen@vet.uu.nl Sun Mar 2 16:51:43 2003 From: faassen@vet.uu.nl (Martijn Faassen) Date: Sun, 2 Mar 2003 17:51:43 +0100 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: References: <20030301014057.GA11922@vet.uu.nl> Message-ID: <20030302165143.GA17610@vet.uu.nl> Uche Ogbuji wrote: > I've stayed out of the _xmlplus thread because I really don't feel strongly > enough about the issue one way or another (nor did I when the initial > discussions took place). > > I understand that _xmlplus can be confusing when problems come abut, but on > the other hand, it would seem to me the best approach is to just try to avoid > those problems in the first place. I also wonder that the proposed change is > too disruptive, given all the extant code that might depend on the ld > arrnagement. On the flip side of that, I'm usually less of a stickler for > backwar compat than most if it involves a chaneg that does the right thing. > > So does ditching _xmlplus even do the right thing? Is there so little > discssion about this here because so few care? I don't know why there is so little discussion about this; perhaps because everybody who could care isn't aware of the situation -- it's not like it's very obvious to people, even to people who use the XML facilities. I think ditching _xmlplus is the right thing, as it *causes* problems, it's not only confusing when problems come about from some other source. It's rather difficult right now; your application might be working with core Python, and if you install PyXML, it breaks. Or if you upgrade it. Oddly enough, you might not even be aware that an application you build depends on PyXML at all (you happened to had it installed, that's all, but were reading the standard library reference and a dependency on some bug/undisclosed API crept in). And then you find out later. This isn't just theoretical, I've seen this happen to several developers. These developers use PyXML but have no clue about the mysteries of _xmlplus, and who can blame them.. Anyway, there's a cost for migrating to a saner solution, but changing around a few imports isn't a big deal after all. PyXML has had far more damaging problems (as more subtle) during upgrade than that in the past. :) Regards, Martijn From faassen@vet.uu.nl Sun Mar 2 16:59:29 2003 From: faassen@vet.uu.nl (Martijn Faassen) Date: Sun, 2 Mar 2003 17:59:29 +0100 Subject: [XML-SIG] Re: Finding _xmlplus in Python 2.3a2 In-Reply-To: References: Message-ID: <20030302165929.GB17610@vet.uu.nl> James Kew wrote: > Finally, I'd always assumed that the xml-aliases-to-_xmlplus business was a > trick to allow PyXML to eventually _become_ the standard Python xml library > with minimal impact on early adopters. Am I way off base here? I think that this was/is indeed the motivation. I think we're having more than enough negative impact on adopters right now though. Anyway, in the new scheme any adopter who wants to move to using the stuff in the core can explicitly decide as such if they change their import.. I believe this is commonly the case when a library gets accepted in the core anyway -- I'm not sure why PyXML wanted a special status there. I guess I should go look through some mailing list archives; I vaguely recall this discussion from some years ago, but at the time I did not have the benefit of hindsight and don't recall participating. :) Regards, Martijn From jeremy.kloth@fourthought.com Sun Mar 2 18:14:59 2003 From: jeremy.kloth@fourthought.com (Jeremy Kloth) Date: Sun, 2 Mar 2003 11:14:59 -0700 Subject: [XML-SIG] Re: Finding _xmlplus in Python 2.3a2 In-Reply-To: <20030302165929.GB17610@vet.uu.nl> References: <20030302165929.GB17610@vet.uu.nl> Message-ID: <200303021114.59524.jeremy.kloth@fourthought.com> On Sunday 02 March 2003 09:59 am, Martijn Faassen wrote: > James Kew wrote: > > Finally, I'd always assumed that the xml-aliases-to-_xmlplus business was > > a trick to allow PyXML to eventually _become_ the standard Python xml > > library with minimal impact on early adopters. Am I way off base here? > > I think that this was/is indeed the motivation. I think we're having > more than enough negative impact on adopters right now though. > > Anyway, in the new scheme any adopter who wants to move to using the stuff > in the core can explicitly decide as such if they change their import.. > I believe this is commonly the case when a library gets accepted in the > core anyway -- I'm not sure why PyXML wanted a special status there. I > guess I should go look through some mailing list archives; I vaguely > recall this discussion from some years ago, but at the time I did not > have the benefit of hindsight and don't recall participating. :) Most libraries that get moved into the core are not as large as PyXML and to top it off only part of PyXML was moved into the core. This is probably the root of most of the problems. However, PyXML had dibs on the top-level "xml" before Python core did, so this deal was struck to keep developers for both sides happy. There would have been *much* code to change if PyXML was forced to change the package to something else, and I believe this is still the case, at least with PyXML. Another issue that is solved by the current arrangement is support for multiple Python versions with the same code base. For example, if you develop an application for 2.3 that uses the "core" xml library, you can easily support Python 2.0, 2.1 and 2.2 by telling those users to simply install PyXML 0.8.2 and it will work the same (given you use only those features of Python available in the lowest version you wish to support). This is a big plus for end users. Now as I understand it, you (or users you are speaking for) are having problems with PyXML installations or lack thereof. If so, please file bug reports! We cannot fix what we don't know is broke. Jeremy Kloth From mmclay@comcast.net Sun Mar 2 19:12:38 2003 From: mmclay@comcast.net (Michael McLay) Date: Sun, 02 Mar 2003 14:12:38 -0500 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: <20030302165143.GA17610@vet.uu.nl> References: <20030301014057.GA11922@vet.uu.nl> <20030302165143.GA17610@vet.uu.nl> Message-ID: <200303021412.38780.mmclay@comcast.net> On Sunday 02 March 2003 11:51 am, Martijn Faassen wrote: > Uche Ogbuji wrote: > > I've stayed out of the _xmlplus thread because I really don't feel > > strongly enough about the issue one way or another (nor did I when the > > initial discussions took place). > > > > I understand that _xmlplus can be confusing when problems come abut, but > > on the other hand, it would seem to me the best approach is to just try > > to avoid those problems in the first place. I also wonder that the > > proposed change is too disruptive, given all the extant code that might > > depend on the ld arrnagement. On the flip side of that, I'm usually less > > of a stickler for backwar compat than most if it involves a chaneg that > > does the right thing. > > > > So does ditching _xmlplus even do the right thing? Is there so little > > discssion about this here because so few care? > > I don't know why there is so little discussion about this; perhaps because > everybody who could care isn't aware of the situation -- it's not like > it's very obvious to people, even to people who use the XML facilities. > > I think ditching _xmlplus is the right thing, as it *causes* problems, it's > not only confusing when problems come about from some other source. It's > rather difficult right now; your application might be working with core > Python, and if you install PyXML, it breaks. Or if you upgrade it. Oddly > enough, you might not even be aware that an application you build depends > on PyXML at all (you happened to had it installed, that's all, but were > reading the standard library reference and a dependency on some > bug/undisclosed API crept in). And then you find out later. > > This isn't just theoretical, I've seen this happen to several developers. > These developers use PyXML but have no clue about the mysteries of > _xmlplus, and who can blame them.. When a system admin installs PyXML over the standard xml package, it can break previously working applications on a system. On systems where Python is shared by many developers, such as starship.python.net, this type of change can happen with the other developers not even being aware that a change has taken place. This should be fixed, and a note should be added to the Python programming style guide to advise other developers about the problems that can be caused by this idiom. Perhaps it would make sense to add it to PEP 5. From jeremy.kloth@fourthought.com Sun Mar 2 19:23:35 2003 From: jeremy.kloth@fourthought.com (Jeremy Kloth) Date: Sun, 2 Mar 2003 12:23:35 -0700 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: <200303021412.38780.mmclay@comcast.net> References: <20030301014057.GA11922@vet.uu.nl> <20030302165143.GA17610@vet.uu.nl> <200303021412.38780.mmclay@comcast.net> Message-ID: <200303021223.35364.jeremy.kloth@fourthought.com> On Sunday 02 March 2003 12:12 pm, Michael McLay wrote: > On Sunday 02 March 2003 11:51 am, Martijn Faassen wrote: > > Uche Ogbuji wrote: > > > I've stayed out of the _xmlplus thread because I really don't feel > > > strongly enough about the issue one way or another (nor did I when the > > > initial discussions took place). > > > > > > I understand that _xmlplus can be confusing when problems come abut, > > > but on the other hand, it would seem to me the best approach is to just > > > try to avoid those problems in the first place. I also wonder that the > > > proposed change is too disruptive, given all the extant code that might > > > depend on the ld arrnagement. On the flip side of that, I'm usually > > > less of a stickler for backwar compat than most if it involves a chaneg > > > that does the right thing. > > > > > > So does ditching _xmlplus even do the right thing? Is there so little > > > discssion about this here because so few care? > > > > I don't know why there is so little discussion about this; perhaps > > because everybody who could care isn't aware of the situation -- it's not > > like it's very obvious to people, even to people who use the XML > > facilities. > > > > I think ditching _xmlplus is the right thing, as it *causes* problems, > > it's not only confusing when problems come about from some other source. > > It's rather difficult right now; your application might be working with > > core Python, and if you install PyXML, it breaks. Or if you upgrade it. > > Oddly enough, you might not even be aware that an application you build > > depends on PyXML at all (you happened to had it installed, that's all, > > but were reading the standard library reference and a dependency on some > > bug/undisclosed API crept in). And then you find out later. > > > > This isn't just theoretical, I've seen this happen to several developers. > > These developers use PyXML but have no clue about the mysteries of > > _xmlplus, and who can blame them.. > > When a system admin installs PyXML over the standard xml package, it can > break previously working applications on a system. On systems where Python > is shared by many developers, such as starship.python.net, this type of > change can happen with the other developers not even being aware that a > change has taken place. This should be fixed, and a note should be added to > the Python programming style guide to advise other developers about the > problems that can be caused by this idiom. Perhaps it would make sense to > add it to PEP 5. How does PyXML break things? Please submit bug reports when this happens so we can make changes accordingly. Without them, we cannot improve PyXML. Jeremy Kloth From jeremy.kloth@fourthought.com Sun Mar 2 20:59:01 2003 From: jeremy.kloth@fourthought.com (Jeremy Kloth) Date: Sun, 2 Mar 2003 13:59:01 -0700 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: <20030302165143.GA17610@vet.uu.nl> References: <20030301014057.GA11922@vet.uu.nl> <20030302165143.GA17610@vet.uu.nl> Message-ID: <200303021359.01243.jeremy.kloth@fourthought.com> On Sunday 02 March 2003 09:51 am, Martijn Faassen wrote: > I don't know why there is so little discussion about this; perhaps because > everybody who could care isn't aware of the situation -- it's not like > it's very obvious to people, even to people who use the XML facilities. I would think that this would mean that the situation is working quite well if people aren't even aware of it. > I think ditching _xmlplus is the right thing, as it *causes* problems, it's > not only confusing when problems come about from some other source. It's > rather difficult right now; your application might be working with core > Python, and if you install PyXML, it breaks. Or if you upgrade it. Oddly > enough, you might not even be aware that an application you build depends > on PyXML at all (you happened to had it installed, that's all, but were > reading the standard library reference and a dependency on some > bug/undisclosed API crept in). And then you find out later. Using undocumented APIs are, in general, prone to just such problems. It is always "use at your own risk" if an API isn't documented, don't expect it to stay the same between releases. If a developer sticks with the documented APIs from the Python documentation for the xml package, I don't think that PyXML has ever broken them (going from memory here, so I may be wrong). The one issue that comes to mind however was the change to the Text node constructor. This, though, should have been only used internal to minidom as was never documented in the Python docs. Actually, the Python docs (from "minidom and the DOM standard") state applications should not instaniate the classes themselves but use the interfaces on the Document object. Jeremy Kloth From faassen@vet.uu.nl Sun Mar 2 21:55:14 2003 From: faassen@vet.uu.nl (Martijn Faassen) Date: Sun, 2 Mar 2003 22:55:14 +0100 Subject: [XML-SIG] Re: Finding _xmlplus in Python 2.3a2 In-Reply-To: <200303021114.59524.jeremy.kloth@fourthought.com> References: <20030302165929.GB17610@vet.uu.nl> <200303021114.59524.jeremy.kloth@fourthought.com> Message-ID: <20030302215513.GA18402@vet.uu.nl> Jeremy Kloth wrote: [snip] > Most libraries that get moved into the core are not as large as PyXML and to > top it off only part of PyXML was moved into the core. That is true. I don't quite see how it therefore follows we should use this scheme however. > This is probably the > root of most of the problems. However, PyXML had dibs on the top-level "xml" > before Python core did, so this deal was struck to keep developers for both > sides happy. Okay, if that is how it happened, but I'm not happy. :) > There would have been *much* code to change if PyXML was forced > to change the package to something else, and I believe this is still the > case, at least with PyXML. These changes are mostly very superficial, however. Though easier if we had a comprehensive suite of unit tests.. > Another issue that is solved by the current arrangement is support for > multiple Python versions with the same code base. For example, if you > develop an application for 2.3 that uses the "core" xml library, you can > easily support Python 2.0, 2.1 and 2.2 by telling those users to simply > install PyXML 0.8.2 and it will work the same (given you use only those > features of Python available in the lowest version you wish to support). > This is a big plus for end users. No, I don't think the current arrangement helps here at all; in fact it contributes to the confusion. If PyXML had its own top level namespace I could *still* easily support multiple Python versions by telling users to install PyXML. In fact, it'll be far more obvious to developers and users what's going on, as their Python core library isn't magically upgraded out from under them. Or even weirder, you upgrade your Python but you also have PyXML installed for it (or install it later), and now it may be magically *degraded*. One has to look hard to determine whether should install anything at all in the current situation. If I develop for Python 2.3 which has more features in its XML core libraries, I have to somehow find out that some version of PyXML has versions of the code that if installed may make my code work with older versions.. > Now as I understand it, you (or users you are speaking for) are having > problems with PyXML installations or lack thereof. If so, please file bug > reports! We cannot fix what we don't know is broke. No, I have witnessed several developers using this software not understanding the arrangment, which is obscure and confusing. In addition there are indeed users who get confused as well. Dependency management would be a lot more straightforward for everyone if PyXML had its own top level namespace. Regards, Martijn From faassen@vet.uu.nl Sun Mar 2 22:02:05 2003 From: faassen@vet.uu.nl (Martijn Faassen) Date: Sun, 2 Mar 2003 23:02:05 +0100 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: <200303021223.35364.jeremy.kloth@fourthought.com> References: <20030301014057.GA11922@vet.uu.nl> <20030302165143.GA17610@vet.uu.nl> <200303021412.38780.mmclay@comcast.net> <200303021223.35364.jeremy.kloth@fourthought.com> Message-ID: <20030302220205.GB18402@vet.uu.nl> Jeremy Kloth wrote: > How does PyXML break things? Please submit bug reports when this happens so > we can make changes accordingly. Without them, we cannot improve PyXML. As I pointed out in an earlier mail, you cannot actually solve the problem by fixing bugs in PyXML. Code may actually be relying on bugs or misfeatures or undisclosed APIs in the core XML code, and a bugfix can therefore cause application breakage. In addition, this type of backwards compatibility is really hard to manage. Mistakes in PyXML will and have been made. That's only natural, but it'd be far easier to manage with a clearer separation between core library and PyXML. So by all means fix bugs in PyXML, the main point is that if you're upgrading PyXML you don't expect code that depends on the core Python library to be affected at all *even by bugfixes*, if you don't know the details of the setup. Of course depending on bugs or undisclosed APIs is wrong, but it happens, especially in the light of incomplete documentation, and breaking the code in what seems to be an unrelated upgrade is wrong too. Regards, Martijn From faassen@vet.uu.nl Sun Mar 2 22:11:07 2003 From: faassen@vet.uu.nl (Martijn Faassen) Date: Sun, 2 Mar 2003 23:11:07 +0100 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: <200303021359.01243.jeremy.kloth@fourthought.com> References: <20030301014057.GA11922@vet.uu.nl> <20030302165143.GA17610@vet.uu.nl> <200303021359.01243.jeremy.kloth@fourthought.com> Message-ID: <20030302221107.GC18402@vet.uu.nl> Jeremy Kloth wrote: > On Sunday 02 March 2003 09:51 am, Martijn Faassen wrote: > > I don't know why there is so little discussion about this; perhaps because > > everybody who could care isn't aware of the situation -- it's not like > > it's very obvious to people, even to people who use the XML facilities. > > I would think that this would mean that the situation is working quite well if > people aren't even aware of it. No, they aren't aware of it and then scratch their head in surprise when they experience problems. That's not a good situation. They are aware of problems but are not aware of the way _xmlplus works. > > I think ditching _xmlplus is the right thing, as it *causes* problems, it's > > not only confusing when problems come about from some other source. It's > > rather difficult right now; your application might be working with core > > Python, and if you install PyXML, it breaks. Or if you upgrade it. Oddly > > enough, you might not even be aware that an application you build depends > > on PyXML at all (you happened to had it installed, that's all, but were > > reading the standard library reference and a dependency on some > > bug/undisclosed API crept in). And then you find out later. > > Using undocumented APIs are, in general, prone to just such problems. The documentation for the PyXML APIs has historically not been complete. If I upgrade I have to test my code, but if I upgrade a seemingly unrelated package I do not expect things to change at all. > It is > always "use at your own risk" if an API isn't documented, don't expect it to > stay the same between releases. If a developer sticks with the documented > APIs from the Python documentation for the xml package, I don't think that > PyXML has ever broken them (going from memory here, so I may be wrong). Expect when plain bugs are introduced in PyXML, which has happened, and this *will* break code that worked just fine with the core libraries. Now people will say, oh, this code doesn't work, and you say, that's odd, what Python version do you have installed? And they say 2.2, and you say, that's really bizarre, until it turned out they have a version of PyXML installed as well. That is not a good situation. > The one issue that comes to mind however was the change to the Text node > constructor. Right, I helped a developer with that (figuring out they were using the constructor explicitly) just recently. > This, though, should have been only used internal to minidom as > was never documented in the Python docs. Actually, the Python docs (from > "minidom and the DOM standard") state applications should not instaniate the > classes themselves but use the interfaces on the Document object. Yes, it was a mistake to use it, but it's pretty hard to diagnose "I installed PyXML and now my code broke" as well. Anyway, to each and every case I mention you can say "Oh, that's a bug in PyXML, please report it so we can fix it" or "Oh, the developer made a mistake". My problem is that both are hard to diagnose and happen at unexpected times for a developer who doesn't know this implementation detail interaction between the Python core library and PyXML, because of the way things are set up now. So we should educate the developers and fix the bugs, but both would be easier if we were less confused. :) Regards, Martijn From jeremy.kloth@fourthought.com Sun Mar 2 22:46:46 2003 From: jeremy.kloth@fourthought.com (Jeremy Kloth) Date: Sun, 2 Mar 2003 15:46:46 -0700 Subject: [XML-SIG] Re: Finding _xmlplus in Python 2.3a2 In-Reply-To: <20030302215513.GA18402@vet.uu.nl> References: <200303021114.59524.jeremy.kloth@fourthought.com> <20030302215513.GA18402@vet.uu.nl> Message-ID: <200303021546.46638.jeremy.kloth@fourthought.com> On Sunday 02 March 2003 02:55 pm, Martijn Faassen wrote: > Jeremy Kloth wrote: > > There would have been *much* code to change if PyXML was forced > > to change the package to something else, and I believe this is still the > > case, at least with PyXML. > > These changes are mostly very superficial, however. Though easier if > we had a comprehensive suite of unit tests.. Changing import statements is superficial, yes, however there are lots of them, PyXML has 678 alone. Jeremy Kloth From jeremy.kloth@fourthought.com Sun Mar 2 23:09:03 2003 From: jeremy.kloth@fourthought.com (Jeremy Kloth) Date: Sun, 2 Mar 2003 16:09:03 -0700 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: <20030302221107.GC18402@vet.uu.nl> References: <20030301014057.GA11922@vet.uu.nl> <200303021359.01243.jeremy.kloth@fourthought.com> <20030302221107.GC18402@vet.uu.nl> Message-ID: <200303021609.03607.jeremy.kloth@fourthought.com> On Sunday 02 March 2003 03:11 pm, Martijn Faassen wrote: > Jeremy Kloth wrote: > > On Sunday 02 March 2003 09:51 am, Martijn Faassen wrote: > > > I don't know why there is so little discussion about this; perhaps > > > because everybody who could care isn't aware of the situation -- it's > > > not like it's very obvious to people, even to people who use the XML > > > facilities. > > > > I would think that this would mean that the situation is working quite > > well if people aren't even aware of it. > > No, they aren't aware of it and then scratch their head in surprise when > they experience problems. That's not a good situation. They are aware > of problems but are not aware of the way _xmlplus works. > > > > I think ditching _xmlplus is the right thing, as it *causes* problems, > > > it's not only confusing when problems come about from some other > > > source. It's rather difficult right now; your application might be > > > working with core Python, and if you install PyXML, it breaks. Or if > > > you upgrade it. Oddly enough, you might not even be aware that an > > > application you build depends on PyXML at all (you happened to had it > > > installed, that's all, but were reading the standard library reference > > > and a dependency on some bug/undisclosed API crept in). And then you > > > find out later. > > > > Using undocumented APIs are, in general, prone to just such problems. > > The documentation for the PyXML APIs has historically not been complete. > If I upgrade I have to test my code, but if I upgrade a seemingly unrelated > package I do not expect things to change at all. Funny, I thought this was referring to PyXML breaking Python APIs. The Python APIs are well documented. > > It is > > always "use at your own risk" if an API isn't documented, don't expect it > > to stay the same between releases. If a developer sticks with the > > documented APIs from the Python documentation for the xml package, I > > don't think that PyXML has ever broken them (going from memory here, so I > > may be wrong). > > Expect when plain bugs are introduced in PyXML, which has happened, and > this *will* break code that worked just fine with the core libraries. Now > people will say, oh, this code doesn't work, and you say, that's odd, > what Python version do you have installed? And they say 2.2, and you say, > that's really bizarre, until it turned out they have a version of PyXML > installed as well. > > That is not a good situation. I guess I'm a little hardened from this. We develop and test for Python versions 2.1, 2.2 and 2.3 plus with and without PyXML, so it has become second nature to always ask for Python version and PyXML version when bugs are reported. > Anyway, to each and every case I mention you can say "Oh, that's a bug in > PyXML, please report it so we can fix it" or "Oh, the developer made > a mistake". My problem is that both are hard to diagnose and happen at > unexpected times for a developer who doesn't know this implementation > detail interaction between the Python core library and PyXML, because of > the way things are set up now. So we should educate the developers and fix > the bugs, but both would be easier if we were less confused. :) I bring up the bug reporting simply because I don't recall anyone reporting that PyXML broke their Python installation until now. The cases you mention are abstract, but without concrete details, I cannot reply otherwise. I don't mean to sound uncaring, I am simply trying to improve PyXML. Jeremy Kloth From martin@v.loewis.de Sun Mar 2 23:27:38 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 03 Mar 2003 00:27:38 +0100 Subject: [XML-SIG] Re: Finding _xmlplus in Python 2.3a2 In-Reply-To: <20030302215513.GA18402@vet.uu.nl> References: <20030302165929.GB17610@vet.uu.nl> <200303021114.59524.jeremy.kloth@fourthought.com> <20030302215513.GA18402@vet.uu.nl> Message-ID: Martijn Faassen writes: > Or even weirder, you upgrade your Python but you > also have PyXML installed for it (or install it later), and now it may be > magically *degraded*. I'll write a separate response, but: This cannot happen. If you install a new Python release, it won't take over an existing PyXML installation - you will have to explicitly install PyXML again for that Python installation. Installing PyXML won't downgrade you XML libraries: The _xmlplus version check is designed to prevent that. > No, I have witnessed several developers using this software not understanding > the arrangment, which is obscure and confusing. In addition there are indeed > users who get confused as well. Dependency management would be a lot more > straightforward for everyone if PyXML had its own top level namespace. That would break a lot of existing code. Regards, Martin From mark@easymailings.com Mon Mar 3 00:55:59 2003 From: mark@easymailings.com (Mark Bucciarelli) Date: Sun, 2 Mar 2003 19:55:59 -0500 Subject: [XML-SIG] [SOLVED] soapy hacking -- getAttributeNS In-Reply-To: References: Message-ID: <200303021955.59595.mark@easymailings.com> On Saturday 01 March 2003 6:42 pm, Uche Ogbuji wrote: [...] > Your problem, as I mentioned, was that you should have been using > xml.dom.EMPTY_NAMESPACE, which is None, not ''. Yes, thank you for your tip. > > Another interesting thing I found is if an attribute does have a prefix, > > then the xmlns declaration must be in a parent tag--it cannot be in the > > same tag as the attribute. > > Hmm? Not true at all. [...] > >>> from xml.dom.ext.reader import Sax2 > >>> reader = Sax2.Reader() > >>> doc = reader.fromString(" >>> mb:name='abc' /> > > ") > > >>> test_node = doc.documentElement.firstChild > >>> test_node.getAttributeNS(u'http://123', u'name') > > u'abc' Shouldn't it work with minidom? >>> import xml.dom.minidom >>> doc = xml.dom.minidom.parseString("
") >>> doc.childNodes[0].getAttributeNS(u'http://123', u'name') '' > BTW, using 4Suite's Domlette, which is *much* faster than 4DOM you would use: > >>> from Ft.Xml.Domlette import NonvalidatingReader > >>> doc = NonvalidatingReader.parseString(" >>> xmlns:mb='http://123' > > mb:name='abc' />","file:bogus.xml") > > >>> test_node = doc.documentElement.firstChild > >>> test_node.attributes[(u'http://123', u'name')].value > > u'abc' I was developing using Python 2.1 and 4Suite and the wsdllib.py library (which requires Ft.Lib.pDomlette). When I downloaded the 2.2 4Suite Windows installer, there was no pDomlette.py. I suppose I could have used the 0.11 version with Python 2.2 on Windows, but it wasn't clear and (at the time) it seemed like a good idea to create a small file that reads wsdl and makes soap calls and works with native python libraries. > May I suggest my Python/XML articles? They cover some of the issues you've > run into: > > http://www.xml.com/pub/au/84 I've seen many of these before, thank you for all your work! > There is also a lot of relevant stuff on my Akara site: > > http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/pyxml-akara Hmmm, "Waiting for a reply" ... Mark From martin@v.loewis.de Mon Mar 3 01:14:20 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 03 Mar 2003 02:14:20 +0100 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: <20030302220205.GB18402@vet.uu.nl> References: <20030301014057.GA11922@vet.uu.nl> <20030302165143.GA17610@vet.uu.nl> <200303021412.38780.mmclay@comcast.net> <200303021223.35364.jeremy.kloth@fourthought.com> <20030302220205.GB18402@vet.uu.nl> Message-ID: Martijn Faassen writes: > As I pointed out in an earlier mail, you cannot actually solve the > problem by fixing bugs in PyXML. Code may actually be relying on > bugs or misfeatures or undisclosed APIs in the core XML code, and a > bugfix can therefore cause application breakage. The same is true for any other software package. Any change in a package can cause applications to stop working. So if you don't want to risk a breakage, don't upgrade any software. I cannot see how this is relevant to the _xmlplus technique, though. > So by all means fix bugs in PyXML, the main point is that if you're upgrading > PyXML you don't expect code that depends on the core Python library to be > affected at all *even by bugfixes*, if you don't know the details of the > setup. The same is true for any other setup. If you upgrade the system's C library, you don't expect Apache to stop working, if you don't know the details of the setup. If you upgrade Perl, you don't expect spamassassin to stop working, if you don't know the details of the setup. > Of course depending on bugs or undisclosed APIs is wrong, but it happens, > especially in the light of incomplete documentation, and breaking the code in > what seems to be an unrelated upgrade is wrong too. How is that unrelated? Both provide essentially the same software (XML libraries for Python, in the package "xml"). Regards, Martin From brian@sweetapp.com Sun Mar 2 04:27:24 2003 From: brian@sweetapp.com (Brian Quinlan) Date: Sat, 01 Mar 2003 20:27:24 -0800 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: Message-ID: <004901c2e074$061ae810$21795418@dell1700> > The same is true for any other software package. Any change in a > package can cause applications to stop working. So if you don't want > to risk a breakage, don't upgrade any software. > I cannot see how this is relevant to the _xmlplus technique, though. A script author can't necessarily control the runtime environment of their software. If I have a script beginning with: #!/usr/bin/env python2.1 import string I can be reasonably sure that the string library that I am getting is the one that I have tested with (perhaps with some bug fixes). This is not the case if I import from the xml package. This actually caused some confusion when I worked at ActiveState: every developer had the same version of ActivePython installed but some Web Services code would exhibit different behavior on different machines. Eventually the problem was tracked done to some developers having PyXML installed. > The same is true for any other setup. If you upgrade the system's C > library, you don't expect Apache to stop working, if you don't know > the details of the setup. If you upgrade Perl, you don't expect > spamassassin to stop working, if you don't know the details of the > setup. I think that popular C libraries tend to achieve a higher level of compatibility than Python's XML libraries do. Cheers, Brian From uche.ogbuji@fourthought.com Mon Mar 3 05:35:19 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Sun, 02 Mar 2003 22:35:19 -0700 Subject: [XML-SIG] [SOLVED] soapy hacking -- getAttributeNS In-Reply-To: Message from Mark Bucciarelli of "Sun, 02 Mar 2003 19:55:59 EST." <200303021955.59595.mark@easymailings.com> Message-ID: > On Saturday 01 March 2003 6:42 pm, Uche Ogbuji wrote: > > Hmm? Not true at all. > > [...] > > > >>> from xml.dom.ext.reader import Sax2 > > >>> reader = Sax2.Reader() > > >>> doc = reader.fromString(" > >>> mb:name='abc' /> > > > > ") > > > > >>> test_node = doc.documentElement.firstChild > > >>> test_node.getAttributeNS(u'http://123', u'name') > > > > u'abc' > > Shouldn't it work with minidom? > > >>> import xml.dom.minidom > >>> doc = xml.dom.minidom.parseString("
mb:name='abc'/>") > >>> doc.childNodes[0].getAttributeNS(u'http://123', u'name') > '' Ah, it does work on minidom when you spell "xmlns" correctly :-) >>> import xml.dom.minidom >>> doc = xml.dom.minidom.parseString("
") >>> doc.childNodes[0].attributes.items() [(u'mb:name', u'abc'), (u'xmlns:mb', u'http://123')] >>> doc.childNodes[0].getAttributeNS(u'http://123', u'name') u'abc' > > BTW, using 4Suite's Domlette, which is *much* faster than 4DOM you would > use: > > >>> from Ft.Xml.Domlette import NonvalidatingReader > > >>> doc = NonvalidatingReader.parseString(" > >>> xmlns:mb='http://123' > > > > mb:name='abc' />","file:bogus.xml") > > > > >>> test_node = doc.documentElement.firstChild > > >>> test_node.attributes[(u'http://123', u'name')].value > > > > u'abc' > > I was developing using Python 2.1 and 4Suite and the wsdllib.py library (which > requires Ft.Lib.pDomlette). When I downloaded the 2.2 4Suite Windows > installer, there was no pDomlette.py. pDomlette is no gone. The 4Suite Domlettes have been unified. Is there any chance you could put together a patch to update wsdllib.py to the API as detailed in http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/domlettes ? Mike and I'd be very grateful, and update the code to help others. > I suppose I could have used the 0.11 version with Python 2.2 on Windows, but > it wasn't clear and (at the time) it seemed like a good idea to create a > small file that reads wsdl and makes soap calls and works with native python > libraries. > > > May I suggest my Python/XML articles? They cover some of the issues you've > > run into: > > > > http://www.xml.com/pub/au/84 > > I've seen many of these before, thank you for all your work! > > > There is also a lot of relevant stuff on my Akara site: > > > > http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/pyxml-akara > > Hmmm, "Waiting for a reply" ... Site went psycho for a bit, according to the logs. I've been playing with it hard latey, trying to generalize Akara into a full-blown (and IMHO very compelling) app, and stability hs suffered accordingly. Sorry. Anyway, it's back running now. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com The open office file format - http://www-106.ibm.com/developerworks/xml/librar y/x-think15/ 4Suite Repository Features - https://www6.software.ibm.com/reg/devworks/dw-x4su ite5-i/ XML class warfare - http://www.adtmag.com/article.asp?id=6965 See you at XML Web Services One - http://www.xmlconference.com/santaclara/ From uche.ogbuji@fourthought.com Mon Mar 3 05:40:57 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Sun, 02 Mar 2003 22:40:57 -0700 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: Message from Brian Quinlan of "Sat, 01 Mar 2003 20:27:24 PST." <004901c2e074$061ae810$21795418@dell1700> Message-ID: > I think that popular C libraries tend to achieve a higher level of > compatibility than Python's XML libraries do. Hmm. This is a judgment call that I cannot agree with. Just look at the API level updates in the RPM repository for any popular C library in RedHat, say. You'll see that thre is a lot of churn in those waters. Debian is no exception, as I found in my sojourn in Debian waters. Remember where the phrase "DLL hell" comes from: version skew in C libraries on Windows. Reflect that popular UNIX systems from Solaris to Linux are just as notorious for ".so dependency hell". So can we do a better job with PyXML? Perhaps. But do we compare unfavorably with many C libraries? I find it very hard to credit that. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com The open office file format - http://www-106.ibm.com/developerworks/xml/librar y/x-think15/ 4Suite Repository Features - https://www6.software.ibm.com/reg/devworks/dw-x4su ite5-i/ XML class warfare - http://www.adtmag.com/article.asp?id=6965 See you at XML Web Services One - http://www.xmlconference.com/santaclara/ From uche.ogbuji@fourthought.com Mon Mar 3 05:53:19 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Sun, 02 Mar 2003 22:53:19 -0700 Subject: [XML-SIG] Preventing DLL hell is very expensive In-Reply-To: Message from Uche Ogbuji of "Sun, 02 Mar 2003 22:40:57 MST." Message-ID: > Remember where the phrase "DLL hell" comes from: version skew in C libraries > on Windows. Reflect that popular UNIX systems from Solaris to Linux are just > as notorious for ".so dependency hell". I just wanted to add a note. of all the OSen I've used, the one most renowned for freeing the user of "DLL hell" effects is AIX. I gather this is in part because SMIT (the package manager) is such a draconian beast, and in part because the binary compatability management for libraries is extremely thorouh. No small coincidence that this comes from this little company, IBM, with pots of cash to pay developers to maintain ridiculous number of library dependency and vesioning branches throughout IBM's very generous support cycle. Look at the APAR/FIX log for any AIX C package, and you will be left in mesmerized awe. The problem is that so few OSS projects have such manpower. Of course, I don't know what Microsoft's excuse is ;-). Anyway, I believe that you can only ever get 2 of the following: 1) A package in active development 2) Freedom from DLL hell 3) Nice modularity for integration with other subsystems (i.e. APIs of broadly useful granularity) Unless you have IBM-type bucks. Pick two, if you're lucky. You're not going to get all 3. I think PyXML offers 1 & 3. Anyone who is not satisfied with that should submit IBM-type bucks to .... Well, once we know there are any takers, we'll figure out an address, to be sure ;-) -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com The open office file format - http://www-106.ibm.com/developerworks/xml/librar y/x-think15/ 4Suite Repository Features - https://www6.software.ibm.com/reg/devworks/dw-x4su ite5-i/ XML class warfare - http://www.adtmag.com/article.asp?id=6965 See you at XML Web Services One - http://www.xmlconference.com/santaclara/ From brian@sweetapp.com Sun Mar 2 06:06:22 2003 From: brian@sweetapp.com (Brian Quinlan) Date: Sat, 01 Mar 2003 22:06:22 -0800 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: Message-ID: <004e01c2e081$d9d89cd0$21795418@dell1700> Uche Ogbuji wrote: > Hmm. This is a judgment call that I cannot agree with. Just look at > the API level updates in the RPM repository for any popular C library > in RedHat, say. You'll see that thre is a lot of churn in those > waters. Debian is no exception, as I found in my sojourn in > Debian waters. I would say that these problems are "common" with C libraries because: 1. there is a lot more deployed C code than Python code 2. Python code is most frequently used for projects with a very limited deployment (e.g. one server, one group of workstations, etc.) But, as you say, this is a judgment call and I concede that I might be wrong. Cheers, Brian From mal@lemburg.com Mon Mar 3 08:36:11 2003 From: mal@lemburg.com (M.-A. Lemburg) Date: Mon, 03 Mar 2003 09:36:11 +0100 Subject: [XML-SIG] Preventing DLL hell is very expensive In-Reply-To: References: Message-ID: <3E6313FB.9040908@lemburg.com> Uche Ogbuji wrote: >>Remember where the phrase "DLL hell" comes from: version skew in C libraries >>on Windows. Reflect that popular UNIX systems from Solaris to Linux are just >>as notorious for ".so dependency hell". > > I just wanted to add a note. > > of all the OSen I've used, the one most renowned for freeing the user of "DLL > hell" effects is AIX. I gather this is in part because SMIT (the package > manager) is such a draconian beast, and in part because the binary > compatability management for libraries is extremely thorouh. Very true: they use core dumps to free the user from DLL hell :-) -- Marc-Andre Lemburg eGenix.com Professional Python Software directly from the Source (#1, Mar 03 2003) >>> Python/Zope Products & Consulting ... http://www.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ Python UK 2003, Oxford: 29 days left EuroPython 2003, Charleroi, Belgium: 113 days left From noreply@sourceforge.net Mon Mar 3 10:12:44 2003 From: noreply@sourceforge.net (SourceForge.net) Date: Mon, 03 Mar 2003 02:12:44 -0800 Subject: [XML-SIG] [ pyxml-Bugs-696457 ] public/system ID swapped Message-ID: Bugs item #696457, was opened at 2003-03-03 11:12 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=106473&aid=696457&group_id=6473 Category: DOM Group: None Status: Open Resolution: None Priority: 6 Submitted By: Alexandre Fayolle (afayolle) Assigned to: Nobody/Anonymous (nobody) Summary: public/system ID swapped Initial Comment: I received this on the Debian bug tracker: -------------------------------------------8<------------------------------ Hello, I found a really annoying bug in the Sax2 reader from xml.dom.ext.reader. It exchanges the public identifier and system identifier of the Document Type Declaration. The problem can be reproduced with the following Python script. == "saxerror.py" starts at following line =============== #! /usr/bin/env python import xml.dom from xml.dom.ext.reader import Sax2 reader = Sax2.Reader() doc=reader.fromString(""" """) for c in doc.childNodes: if c.nodeType==xml.dom.Node.DOCUMENT_TYPE_NODE: print "public ID: "+c.publicId print "system ID: "+c.systemId == "saxerror.py" ends at previous line ============================= When I run this script I get the following output: voss@tatonka [~/src/app/zettel] ./saxerror.py public ID: zettel.dtd system ID: -//Jochen Voss//DTD Zettel 1.0//EN note that the public and system ID are exchanged. The same effect occurs while parsing file contents instead of a string. This is especially annoying because reading and then writing a XML file will damage it by exchanging the IDs. I hope this helps, Jochen ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=106473&aid=696457&group_id=6473 From Alexandre.Fayolle@logilab.fr Mon Mar 3 10:21:45 2003 From: Alexandre.Fayolle@logilab.fr (Alexandre) Date: Mon, 3 Mar 2003 11:21:45 +0100 Subject: [XML-SIG] http://docs.4suite.org/ in xml.dom modules Message-ID: <20030303102145.GC9968@calvin.fayauffre.org> Hello everyone, I have a bug report on the pyxml debian package about some comments in various xml.dom files looking like: # Documentation: http://docs.4suite.org/4DOM/Comment.py.html The problem is that nothing's available at that url (docs.4suite.org doesn't even exist). Is there any objection to my removing these lines from the source files? -- Alexandre Fayolle LOGILAB, Paris (France). http://www.logilab.com http://www.logilab.fr http://www.logilab.org Développement logiciel avancé - Intelligence Artificielle - Formations From faassen@vet.uu.nl Mon Mar 3 10:24:07 2003 From: faassen@vet.uu.nl (Martijn Faassen) Date: Mon, 3 Mar 2003 11:24:07 +0100 Subject: [XML-SIG] Re: Finding _xmlplus in Python 2.3a2 In-Reply-To: <200303021546.46638.jeremy.kloth@fourthought.com> References: <200303021114.59524.jeremy.kloth@fourthought.com> <20030302215513.GA18402@vet.uu.nl> <200303021546.46638.jeremy.kloth@fourthought.com> Message-ID: <20030303102407.GA20110@vet.uu.nl> Jeremy Kloth wrote: > On Sunday 02 March 2003 02:55 pm, Martijn Faassen wrote: > > Jeremy Kloth wrote: > > > There would have been *much* code to change if PyXML was forced > > > to change the package to something else, and I believe this is still the > > > case, at least with PyXML. > > > > These changes are mostly very superficial, however. Though easier if > > we had a comprehensive suite of unit tests.. > > Changing import statements is superficial, yes, however there are lots of > them, PyXML has 678 alone. Yup, but this is still doable. Zope 3 went to a complete renaming and restructuring in a short period last december. Of course it has the benefit of a very comprehensive unit test suite. Regards, Martijn From faassen@vet.uu.nl Mon Mar 3 10:38:47 2003 From: faassen@vet.uu.nl (Martijn Faassen) Date: Mon, 3 Mar 2003 11:38:47 +0100 Subject: [XML-SIG] Re: Finding _xmlplus in Python 2.3a2 In-Reply-To: References: <20030302165929.GB17610@vet.uu.nl> <200303021114.59524.jeremy.kloth@fourthought.com> <20030302215513.GA18402@vet.uu.nl> Message-ID: <20030303103847.GB20110@vet.uu.nl> Martin v. L=F6wis wrote: > Martijn Faassen writes: >=20 > > Or even weirder, you upgrade your Python but you > > also have PyXML installed for it (or install it later), and now it ma= y be > > magically *degraded*. >=20 > I'll write a separate response, but: This cannot happen. If you > install a new Python release, it won't take over an existing PyXML > installation - you will have to explicitly install PyXML again for > that Python installation. >=20 > Installing PyXML won't downgrade you XML libraries: The _xmlplus > version check is designed to prevent that. Ah right, I hadn't thought about that. (which is evidence the interaction is actually more complicated; now I need to somehow magically know what XML version my core Python version has and how this interacts with PyXML versions). > > No, I have witnessed several developers using this software not under= standing > > the arrangment, which is obscure and confusing. In addition there are= indeed > > users who get confused as well. Dependency management would be a lot = more > > straightforward for everyone if PyXML had its own top level namespace. >=20 > That would break a lot of existing code. Of course, but it would also simplify matters in development and deployment. And I hope there can be some discussion of migration=20 strategies. You could for instance abandon the scheme in the next PyXML release, keep _xmlplus of the previous one installed if it's there, and point out to people that in order to use PyXML from now on they have to explicitly refer to the pyxml namespace. You could even provide a migration hack where people can explicitly enable pyxml to be picked up in the traditional way. Regards, Martijn From faassen@vet.uu.nl Mon Mar 3 10:51:48 2003 From: faassen@vet.uu.nl (Martijn Faassen) Date: Mon, 3 Mar 2003 11:51:48 +0100 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: References: <20030301014057.GA11922@vet.uu.nl> <20030302165143.GA17610@vet.uu.nl> <200303021412.38780.mmclay@comcast.net> <200303021223.35364.jeremy.kloth@fourthought.com> <20030302220205.GB18402@vet.uu.nl> Message-ID: <20030303105148.GC20110@vet.uu.nl> Martin v. L=F6wis wrote: > Martijn Faassen writes: >=20 > > As I pointed out in an earlier mail, you cannot actually solve the > > problem by fixing bugs in PyXML. Code may actually be relying on > > bugs or misfeatures or undisclosed APIs in the core XML code, and a > > bugfix can therefore cause application breakage. >=20 > The same is true for any other software package. Any change in a > package can cause applications to stop working. So if you don't want > to risk a breakage, don't upgrade any software. >=20 > I cannot see how this is relevant to the _xmlplus technique, though. You don't know you're upgrading 'the software'. Again, developers=20 are not aware of the _xmlplus technique, and software may happily depend on the Python core's xml support, and then you install=20 PyXML and the code breaks. Confusion ensues, and since _xmlplus is supposed to be an implementation detail, it's hard to figure out what's going on. This is not true for software packages that don't use this technique, i.e. the rest of the core Python library (at least I hope not!). If I use= =20 urllib2, it's not magically going to be upgraded as soon as I install som= e other library. > > So by all means fix bugs in PyXML, the main point is that if you're u= pgrading > > PyXML you don't expect code that depends on the core Python library t= o be=20 > > affected at all *even by bugfixes*, if you don't know the details of = the > > setup. >=20 > The same is true for any other setup. If you upgrade the system's C > library, you don't expect Apache to stop working, if you don't know > the details of the setup. If you upgrade Perl, you don't expect > spamassassin to stop working, if you don't know the details of the > setup. If I upgrade a Python library, or install one, I don't expect the Python core libraries to stop working. Python is quite regular in this respect, except for PyXML. In fact, the original code is actually still there, it's just 'turned off'. This caused developer confusion in at three of my co-developers here at independent instances, and since I only have three co-developers here this indicates to me something unexpected is going on. The _xmlplus hack is not pythonic -- imports appear from different places based on version checks, and the core library is unexpectedly overridden completely. > > Of course depending on bugs or undisclosed APIs is wrong, but it happ= ens, > > especially in the light of incomplete documentation, and breaking the= code in > > what seems to be an unrelated upgrade is wrong too. >=20 > How is that unrelated? Both provide essentially the same software (XML > libraries for Python, in the package "xml"). It seems to be an unrelated upgrade. People don't expect their core library imports to be rerouted if they install a Python package, so peopl= e may not be aware of the fine details of what happens when you upgrade PyX= ML. Perhaps they think that only the extra functionality gets installed and that core functionality is still used, instead of all that inert code sitting there all of a sudden. People build up erroneous mental models of this. And this is *supposed* to be an implementation detail, but it's not as it keeps hitting people in the head. For instance, I made a mistak= e in a previous post on the exact behavior, and I'd even seen the version checking code in there.. Regards, Martijn From faassen@vet.uu.nl Mon Mar 3 11:04:15 2003 From: faassen@vet.uu.nl (Martijn Faassen) Date: Mon, 3 Mar 2003 12:04:15 +0100 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: <200303021609.03607.jeremy.kloth@fourthought.com> References: <20030301014057.GA11922@vet.uu.nl> <200303021359.01243.jeremy.kloth@fourthought.com> <20030302221107.GC18402@vet.uu.nl> <200303021609.03607.jeremy.kloth@fourthought.com> Message-ID: <20030303110415.GD20110@vet.uu.nl> Jeremy Kloth wrote: [snip] > I guess I'm a little hardened from this. We develop and test for Python > versions 2.1, 2.2 and 2.3 plus with and without PyXML, so it has become > second nature to always ask for Python version and PyXML version when bugs > are reported. I do too, but I wish I could just ask for Python version (if I'd coded against that), or PyXML version (if I'd coded against that). Now a far more complicated set of rules needs to be applied, and I don't think this set of rules is documented anywhere outside the code either.. (though perhaps I'm missing something?) [snip] > I bring up the bug reporting simply because I don't recall anyone reporting > that PyXML broke their Python installation until now. The cases you mention > are abstract, but without concrete details, I cannot reply otherwise. > I don't mean to sound uncaring, I am simply trying to improve PyXML. All right, I'm sorry about that. The misunderstanding most recently was the one when code used explicit text node constructors in minidom; misuse of the API. Before that a month or two ago I recall a significant amount of confusion concerning which sax parser was in use (core or PyXML's). I don't think actual bugs were involved, though there may have been behaviorial changes due to bugfixes. (or perhaps new features were supported?). But it did cost time. The famous "expat" chaos could be considered part of it. Too many expat parsers were maintained by too many different packages, and expat was included on different platforms with binary distributions of Python, or not, etc. But that should be resolved by Python 2.3 as I understand it will be distributed along with the core everywhere. Anyway, doesn't strictly have to do with _xmlplus, I *think*. :) Then I have perpetual issues with users who installed PyXML or did not install PyXML on a variety of platforms. While some of these problems would not have been avoided with a repackaging of PyXML, some definitely would've been far more clearly diagnosed by the users if it were clear that _xmlplus was coming from PyXML and that the core is taken over by it. But since this is supposed to be hidden from the users they aren't aware of it. If it were explicit (oh, it's trying to import from pyxml but there's nothing there) it'd have been far easier. I recall various random hacks causing more trouble than they were worth by users to get the expat parser going, for instance. That's all I can recall for now; perhaps others have different examples as well. As you can see it's not so much direct breakage (though that happened as well) as lost time due to developer confusion and user confusion. Regards, Martijn From subscribed@red56.co.uk Mon Mar 3 11:37:57 2003 From: subscribed@red56.co.uk (Tim Diggins) Date: Monday, 03 March 2003 11:37:57 +0000 Subject: [XML-SIG] Preventing DLL hell is very expensive Message-ID: <200303031139.h23Bd5t00862@myserverworld.com> >... > The problem is that so few OSS projects have such manpower. > Of course, I > don't know what Microsoft's excuse is ;-). Anyway, I believe > that you can > only ever get 2 of the following: > > 1) A package in active development > 2) Freedom from DLL hell > 3) Nice modularity for integration with other subsystems > (i.e. APIs of broadly > useful granularity) > > Unless you have IBM-type bucks. Pick two, if you're lucky. > You're not going > to get all 3. I think PyXML offers 1 & 3. As a PyXML user, I found this a very useful observation, giving a lot of insight on the tradeoffs. While up to now I've been leaning towards a change top-level namespace, maybe the issues with _xmlplus that have been discussed would be solved by some explicit explanation of the "special relationship" between the external PyXML package and the xml core package. This documentation addition should be in 2 places: 1) the install documentation with PyXml (to solve the kind of misunderstandings and hard to diagnose errors I've had about the problems I've had as a user "moving" code from xml core to PyXML - as Martijn has laid out) maybe this could point out where PyXML is installed and why (apologies if this is already in the documentation and I never read it carefully enough) and also some of these "typical errors" that people have 2) the xml core documentation with Python (to point out the relationship with PyXML which is special enough to warrant upfront advice). If xml core/PyXML users were aware of the relationship then they are more likely to be able to diagnose problems and report them correctly. (Also, having never contributed to an active OSS project before, but used lots of them, and then suggesting some work to do, I feel a responsibility to volunteer to write some of these documentation additions myself - but I'm not sure if that's appropriate - maybe someone can contact me offlist ito give me a suggestion of how to start if it's appropriate). Side thought: ------------- I presume there's no (performance-efficient) way to have both packages (xml core and PyXML) installed side by side (e.g. pyxml.dom... and xmlcore.dom...) and then have the toplevel xml.dom... be an "alias" to those real packages (a bit like os.path). If this WAS possible, then this would be seem like a solution... (it would certainly make tracing problems in upgrading from core->pyXML easier) best Tim > -----Original Message----- > From: xml-sig-admin@python.org > [mailto:xml-sig-admin@python.org] On Behalf Of Uche Ogbuji > Sent: 03 March 2003 05:53 > To: Brian Quinlan; xml-sig@python.org > Subject: [XML-SIG] Preventing DLL hell is very expensive From martin@v.loewis.de Mon Mar 3 12:31:15 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 03 Mar 2003 13:31:15 +0100 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: <20030303110415.GD20110@vet.uu.nl> References: <20030301014057.GA11922@vet.uu.nl> <200303021359.01243.jeremy.kloth@fourthought.com> <20030302221107.GC18402@vet.uu.nl> <200303021609.03607.jeremy.kloth@fourthought.com> <20030303110415.GD20110@vet.uu.nl> Message-ID: Martijn Faassen writes: > That's all I can recall for now; perhaps others have different examples > as well. As you can see it's not so much direct breakage (though that > happened as well) as lost time due to developer confusion and user > confusion. But wouldn't a renaming of the _xmlplus package cause even more developer confusion? Regards, Martin From martin@v.loewis.de Mon Mar 3 12:42:26 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 03 Mar 2003 13:42:26 +0100 Subject: [XML-SIG] Re: Finding _xmlplus in Python 2.3a2 In-Reply-To: <20030303103847.GB20110@vet.uu.nl> References: <20030302165929.GB17610@vet.uu.nl> <200303021114.59524.jeremy.kloth@fourthought.com> <20030302215513.GA18402@vet.uu.nl> <20030303103847.GB20110@vet.uu.nl> Message-ID: Martijn Faassen writes: > Of course, but it would also simplify matters in development and > deployment. It wouldn't simplify maintenance, though: Files that are now shared identically between Python and PyXML now must be "nearly" shared: Every reference to the package should then read "_xmlplus" for the copy of the file in PyXML, and should read "xml" for the copy of the file in Python. It would also be an ongoing source of user confusion: Should I use xml.dom.minidom, or _xmlplus.dom.minidom? etc. > And I hope there can be some discussion of migration > strategies. You could for instance abandon the scheme in the next > PyXML release, keep _xmlplus of the previous one installed if it's > there, and point out to people that in order to use PyXML from now on > they have to explicitly refer to the pyxml namespace. You could even > provide a migration hack where people can explicitly enable pyxml to > be picked up in the traditional way. Please be aware that there is *a lot* of code out there that is still in use but unmaintained. We still get questions from people using code written for PyXML 0.5, with API that went away in PyXML 0.6. Somebody has to port this code, but nobody can, as the original author lost interest. Regards, Martin From martin@v.loewis.de Mon Mar 3 12:45:44 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 03 Mar 2003 13:45:44 +0100 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: <20030303105148.GC20110@vet.uu.nl> References: <20030301014057.GA11922@vet.uu.nl> <20030302165143.GA17610@vet.uu.nl> <200303021412.38780.mmclay@comcast.net> <200303021223.35364.jeremy.kloth@fourthought.com> <20030302220205.GB18402@vet.uu.nl> <20030303105148.GC20110@vet.uu.nl> Message-ID: Martijn Faassen writes: > This caused developer confusion in at three of my co-developers here > at independent instances, and since I only have three co-developers > here this indicates to me something unexpected is going on. The > _xmlplus hack is not pythonic -- imports appear from different > places based on version checks, and the core library is unexpectedly > overridden completely. While I can sympathize with these concerns, I don't think anything can be done to change the situation that isn't very painful, and requires more resources than I can offer. Regards, Martin From marc@informatik.uni-bremen.de Mon Mar 3 13:30:40 2003 From: marc@informatik.uni-bremen.de (Marc Recht) Date: Mon, 03 Mar 2003 14:30:40 +0100 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: References: <20030301014057.GA11922@vet.uu.nl> <200303021359.01243.jeremy.kloth@fourthought.com> <20030302221107.GC18402@vet.uu.nl> <200303021609.03607.jeremy.kloth@fourthought.com> <20030303110415.GD20110@vet.uu.nl> Message-ID: <291540000.1046698240@leeloo.intern.geht.de> --==========1642040028========== Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline > But wouldn't a renaming of the _xmlplus package cause even more > developer confusion? I don't think so. And with a package (eg. "pyxml") I (as developer) would=20 know exactly what I get/import. Explicit is better than implicit. :-) Marc -- omnis mundi creatura quasi liber et pictura nobis est in speculum -- Alanus de Insulis --==========1642040028========== Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (NetBSD) iD8DBQE+Y1kA7YQCetAaG3MRAlHbAJ0cm66be/h+di5Iqh37trJHGNLOowCfWIGU 9F1jv3iz0vvUhCOYKkq5GUk= =xE5Z -----END PGP SIGNATURE----- --==========1642040028==========-- From jjl@pobox.com Mon Mar 3 13:39:02 2003 From: jjl@pobox.com (John J Lee) Date: Mon, 3 Mar 2003 13:39:02 +0000 (GMT) Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: <200303021359.01243.jeremy.kloth@fourthought.com> Message-ID: On Sun, 2 Mar 2003, Jeremy Kloth wrote: [...] > Using undocumented APIs are, in general, prone to just such problems. It is No, they are not. When I use a Python core module, and then install a related third-party module (no matter if it's written by the same people, and/or covers very similar ground), I don't expect it to clobber the first module unless I explicitly ask for that (by using try / except, or manipulating sys.path and the module system myself). I expect it not to even touch the first module, actually. And I would be correct, for all cases EXCEPT PyXML. People DO think of Python core's xml and PyXML as distinct in this sense, because that's the way ALL other Python software works, AFAIK. John From jjl@pobox.com Mon Mar 3 13:51:34 2003 From: jjl@pobox.com (John J Lee) Date: Mon, 3 Mar 2003 13:51:34 +0000 (GMT) Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: Message-ID: On 3 Mar 2003, Martin v. [iso-8859-15] L=F6wis wrote: [...] > But wouldn't a renaming of the _xmlplus package cause even more > developer confusion? No. :-) Slightly longer answer: Replacing a complicated, implicit, non-standard system with a simple, explicit, utterly standard one simplifies things in the medium term at the cost of some people having to use the usual: try: from pyxml.blah import spam except ImportError: from xml.rhubarb import eggs # weird old-version PyXML module system The only hard-to-understand bit about that is the second import, because the *old* behaviour is hard to understand! Of course, for people who can upgrade (which is almost everyone, eventually), it would be simply: from pyxml.blah import spam But you know all this, so I wonder why you ask? :-P John From jjl@pobox.com Mon Mar 3 13:59:57 2003 From: jjl@pobox.com (John J Lee) Date: Mon, 3 Mar 2003 13:59:57 +0000 (GMT) Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: <200303021609.03607.jeremy.kloth@fourthought.com> Message-ID: On Sun, 2 Mar 2003, Jeremy Kloth wrote: [...] > I bring up the bug reporting simply because I don't recall anyone reporting > that PyXML broke their Python installation until now. The cases you mention > are abstract, but without concrete details, I cannot reply otherwise. [...] That argument makes sense only when applied to a feature to be introduced in the future, in which case we can't know what effect it will have without considering concrete details. This discussion is about a feature already introduced (the _xmlplus hack), which we *know* causes problems (unless you don't believe your users). And we're suggesting replacing it with another system that is known to work: the normal Python namespace / import system. Hmm, I'm sounding a bit whiny here... maybe I should add that I appreciate all the work the XML sig has done, and that this import thing is of course a relatively tiny (though important) detail! John From jjl@pobox.com Mon Mar 3 14:02:34 2003 From: jjl@pobox.com (John J Lee) Date: Mon, 3 Mar 2003 14:02:34 +0000 (GMT) Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: Message-ID: On Sun, 2 Mar 2003, Uche Ogbuji wrote: > > I think that popular C libraries tend to achieve a higher level of > > compatibility than Python's XML libraries do. > > Hmm. This is a judgment call that I cannot agree with. Just look at the API Fine, but this is an irrelevant discussion, IMO: the problem is that ordinary users regard PyXML and Python's xml package as distinct. John From uche.ogbuji@fourthought.com Mon Mar 3 14:23:17 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Mon, 03 Mar 2003 07:23:17 -0700 Subject: [XML-SIG] http://docs.4suite.org/ in xml.dom modules In-Reply-To: Message from Alexandre of "Mon, 03 Mar 2003 11:21:45 +0100." <20030303102145.GC9968@calvin.fayauffre.org> Message-ID: > Hello everyone, > = > I have a bug report on the pyxml debian package about some comments in > various xml.dom files looking like: > = > # Documentation: http://docs.4suite.org/4DOM/Comment.py.html > = > The problem is that nothing's available at that url (docs.4suite.org > doesn't even exist). = > = > Is there any objection to my removing these lines from the source files= ? No objection from here. Those links will probably never work, and we've = been = removing them from 4Suite as we update heades. -- = Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com The open office file format - http://www-106.ibm.com/developerworks/xml/= librar y/x-think15/ 4Suite Repository Features - https://www6.software.ibm.com/reg/devworks/d= w-x4su ite5-i/ XML class warfare - http://www.adtmag.com/article.asp?id=3D6965 See you at XML Web Services One - http://www.xmlconference.com/santaclara= / From jjl@pobox.com Mon Mar 3 14:17:56 2003 From: jjl@pobox.com (John J Lee) Date: Mon, 3 Mar 2003 14:17:56 +0000 (GMT) Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: <20030303105148.GC20110@vet.uu.nl> Message-ID: On Mon, 3 Mar 2003, Martijn Faassen wrote: [somebody wrote, not sure who] > > The same is true for any other software package. Any change in a > > package can cause applications to stop working. So if you don't want > > to risk a breakage, don't upgrade any software. > > > > I cannot see how this is relevant to the _xmlplus technique, though. > > You don't know you're upgrading 'the software'. Again, developers > [...] > This is not true for software packages that don't use this technique, > i.e. the rest of the core Python library (at least I hope not!). If I use > urllib2, it's not magically going to be upgraded as soon as I install some > other library. Concrete, precisely analogous (to PyXML) example: I actually maintain a package that adds features to, and fixes bugs in, urllib2. I fixed a bug in the redirect behavior of that module. In theory, if I made my package clobber urllib2 on installation, old code would work better, because of the bug fixes. In actual fact, that bug fix would break old code. Much worse, nobody would be expecting this to happen, and people would have to dig into my code and / or docs to understand what had gone wrong and how to fix it (if they even figured out that it *was* my code that caused the problem, which is far from certain). All of this surprises none of us, of course, so *why* are we discussing the *merit* of Martin's proposal (which is clear), rather than the *practicality* (which is debatable)?? John From jjl@pobox.com Mon Mar 3 14:20:40 2003 From: jjl@pobox.com (John J Lee) Date: Mon, 3 Mar 2003 14:20:40 +0000 (GMT) Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: Message-ID: On 3 Mar 2003, Martin v. [iso-8859-15] L=F6wis wrote: > Martijn Faassen writes: > > > This caused developer confusion in at three of my co-developers here [...] > While I can sympathize with these concerns, I don't think anything can > be done to change the situation that isn't very painful, and requires > more resources than I can offer. Fair enough! I disagree with your judgement of the pain involved, but your argument is, of course, valid. John From tpassin@comcast.net Mon Mar 3 14:37:48 2003 From: tpassin@comcast.net (Thomas B. Passin) Date: Mon, 03 Mar 2003 09:37:48 -0500 Subject: [XML-SIG] Re: Finding _xmlplus in Python 2.3a2 References: <20030302165929.GB17610@vet.uu.nl> <200303021114.59524.jeremy.kloth@fourthought.com> <20030302215513.GA18402@vet.uu.nl> <20030303103847.GB20110@vet.uu.nl> Message-ID: <002e01c2e192$769ef940$6401a8c0@tbp1> [Martin v. L=F6wis] > > It would also be an ongoing source of user confusion: Should I use > xml.dom.minidom, or _xmlplus.dom.minidom? etc. > I think that this, right here, is the crux of the matter. Should not= one always know which code is being used - at least, if there is a real possibility of different behavior? If there might be some difference= in behavior, one should be able to choose which one to use, or at least = detect which one so it can be compensated for. In scripting for browsers, there are a lot of hacks in use to figure = out which code to compensate for. I deduce that I need - 1) An easy, definitive way to determine whether I am using the _xmlpl= us stuff or the standard stuff, and 2) A convenient way to force the use of the library code that I want,= in case the automatic machinery should disagree. I realize that we do not want to mix-and-match parts of the standard = library with parts of PyXML, and perhaps that is one of the main concerns tha= t Martin is expressing (Martin, is that right?). But if we override, s= ay, expat with our own version and it does not behave the same way as the standard library, not only will we cause confusion but Python itself = will get a bad name very quickly - users will not care that only PyXML cau= ses these troubles, they will blame Python generally. I do not think that any of the alternative proposals so far have disc= ussed the mix-and-match issue sufficiently. The current approach handles = it well except for breakages caused by bugs or API changes. Martijn, would y= ou care to talk about this issue some more from your point of view? Cheers, Tom P From uche.ogbuji@fourthought.com Mon Mar 3 14:34:35 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Mon, 03 Mar 2003 07:34:35 -0700 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: Message from John J Lee of "Mon, 03 Mar 2003 13:39:02 GMT." Message-ID: To be frank, I'm still not very moved to the "ditch _xmlplus" camp this far in the thread. I tend to agree with Martin and Jeremy that the additional confusion that would be cause by doing so exceeds the current confusion that is not related to plain old bugs in PyXML (rather than "misfeatures"). And I wouldn't want to change this feature based only on bugs that can be fixed. Perhaps I'm having trouble finding specifics in the anti-_xmlplus arguments. The followng did strike me: > On Sun, 2 Mar 2003, Jeremy Kloth wrote: > [...] > > Using undocumented APIs are, in general, prone to just such problems. It is > > No, they are not. > > When I use a Python core module, and then install a related third-party > module (no matter if it's written by the same people, and/or covers very > similar ground), I don't expect it to clobber the first module unless I > explicitly ask for that (by using try / except, or manipulating sys.path > and the module system myself). I expect it not to even touch the first > module, actually. And I would be correct, for all cases EXCEPT PyXML. > People DO think of Python core's xml and PyXML as distinct in this sense, > because that's the way ALL other Python software works, AFAIK. PyXML is indeed a special case, because it was subsetted into Python with the explicit understanding on both sides (PyXML and Python/core), that the bundled subset is a mere convenience, and that if PyXML is available, it's the real deal. Even then, I don't think it's all that special. Python acts differently whether or not it has been compiled with, say, zlib installed, or whether it is compiled with UCS-4 (differences are bugs, to be fair). I think that whether or not PyXML is installed is a configuration management variable that needs to be controlled in coherent projects, just like any other needs to be. All configuration vriables have the potenial to change a package's behavior. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com The open office file format - http://www-106.ibm.com/developerworks/xml/librar y/x-think15/ 4Suite Repository Features - https://www6.software.ibm.com/reg/devworks/dw-x4su ite5-i/ XML class warfare - http://www.adtmag.com/article.asp?id=6965 See you at XML Web Services One - http://www.xmlconference.com/santaclara/ From rsalz@datapower.com Mon Mar 3 14:43:16 2003 From: rsalz@datapower.com (Rich Salz) Date: Mon, 3 Mar 2003 09:43:16 -0500 (EST) Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: Message-ID: >PyXML is indeed a special case, because it was subsetted into Python with the >explicit understanding on both sides (PyXML and Python/core), that the bundled >subset is a mere convenience, and that if PyXML is available, it's the real >deal. Perhaps the follow fixes are sufficient then: Document this in big bold letters at the start of the XML section of the Python manual. Document this in big bold letters in the README, HOWTO, etc., of PyXML. Ensure that Python *always* ships with PyXML, latest-stable version. Make it a file whose installation can be controlled separately. This would perhaps set expectations properly. /r$ From uche.ogbuji@fourthought.com Mon Mar 3 14:58:06 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Mon, 03 Mar 2003 07:58:06 -0700 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: Message from Rich Salz of "Mon, 03 Mar 2003 09:43:16 EST." Message-ID: > >PyXML is indeed a special case, because it was subsetted into Python with the > >explicit understanding on both sides (PyXML and Python/core), that the bundled > >subset is a mere convenience, and that if PyXML is available, it's the real > >deal. > > Perhaps the follow fixes are sufficient then: > Document this in big bold letters at the start of the XML > section of the Python manual. > > Document this in big bold letters in the README, HOWTO, etc., > of PyXML. > > Ensure that Python *always* ships with PyXML, latest-stable > version. Make it a file whose installation can be controlled > separately. > > This would perhaps set expectations properly. I think this is the best proposal I've heard so far in this thread. Unfortunately, I sense that bundling PyXML would be a hard sell on python-dev :-( I do think that Python's pace of change has picked up since the original _xmlplus decision, so I could also get behind a proposal that *eliminates* the separate subset of PyXML in Python. Specifically: * break PyXML in two packages such that there is no overlap at all between the two * The base package (i.e. sax, and dom minus 4DOM, I think) *becomes* the part that is directly bundled with Python, i.e. disappears from the PyXML CVS and moves into Python CVS, with all that implies * The python-xml-extras package (i.e. 4DOM, marshal, etc.) does indeed move to a separate top-level package name as a separate package Having said that, the practicality is again in question: not just the workload, but the process of agreeing on exactly how to slice and dice PyXML. But I do think this is a *much* better solution than ditching the _xmlplus method without merging PyXML-in-Python with PyXML-from-XML-SIG, and if a change did somehow become prctical, I would mive strongly for either Rich's proposal above, or, better yet, mine. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com The open office file format - http://www-106.ibm.com/developerworks/xml/library/x-think15/ 4Suite Repository Features - https://www6.software.ibm.com/reg/devworks/dw-x4suite5-i/ XML class warfare - http://www.adtmag.com/article.asp?id=6965 See you at XML Web Services One - http://www.xmlconference.com/santaclara/ From uche.ogbuji@fourthought.com Mon Mar 3 14:48:14 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Mon, 03 Mar 2003 07:48:14 -0700 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: Message from John J Lee of "Mon, 03 Mar 2003 14:17:56 GMT." Message-ID: > All of this surprises none of us, of > course, so *why* are we discussing the *merit* of Martin's proposal (which > is clear), rather than the *practicality* (which is debatable)?? Clear to you, perhaps. I have said that I'm not quite convinced of the merits. Of course, I'm not dissuaded of the merits, either. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com The open office file format - http://www-106.ibm.com/developerworks/xml/library/x-think15/ 4Suite Repository Features - https://www6.software.ibm.com/reg/devworks/dw-x4suite5-i/ XML class warfare - http://www.adtmag.com/article.asp?id=6965 See you at XML Web Services One - http://www.xmlconference.com/santaclara/ From rsalz@datapower.com Mon Mar 3 16:05:03 2003 From: rsalz@datapower.com (Rich Salz) Date: Mon, 03 Mar 2003 11:05:03 -0500 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: References: Message-ID: <3E637D2F.7030802@datapower.com> > Having said that, the practicality is again in question: not just the > workload, but the process of agreeing on exactly how to slice and dice PyXML. I think we try to force-feed the Python core as much as they'll take. Like making pate' :) > But I do think this is a *much* better solution than ditching the _xmlplus > method without merging PyXML-in-Python with PyXML-from-XML-SIG, and if a > change did somehow become prctical, I would mive strongly for either Rich's > proposal above, or, better yet, mine. I'd prefer your solution if it can be done. /r$ From mclay@nist.gov Mon Mar 3 17:20:56 2003 From: mclay@nist.gov (Michael McLay) Date: Mon, 3 Mar 2003 12:20:56 -0500 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: <3E637D2F.7030802@datapower.com> References: <3E637D2F.7030802@datapower.com> Message-ID: <200303031220.56667.mclay@nist.gov> On Monday 03 March 2003 11:05 am, Rich Salz wrote: > > Having said that, the practicality is again in question: not just the > > workload, but the process of agreeing on exactly how to slice and dice > > PyXML. > > I think we try to force-feed the Python core as much as they'll take. > Like making pate' :) I was about to write to suggest that as much of PyXML as is practical be moved into the Python distribution. I was happy to see someone proposed it first. Would it be possible to get some of the useful stuff from 4suite added to the Python distribution as well? It's getting down to the wire on the 2.3 release. Perhaps it would be a good idea to raise the subject on python-dev. > > But I do think this is a *much* better solution than ditching the > > _xmlplus method without merging PyXML-in-Python with PyXML-from-XML-SIG, > > and if a change did somehow become prctical, I would mive strongly for > > either Rich's proposal above, or, better yet, mine. > > I'd prefer your solution if it can be done. > /r$ > > > _______________________________________________ > XML-SIG maillist - XML-SIG@python.org > http://mail.python.org/mailman/listinfo/xml-sig From mark@easymailings.com Mon Mar 3 18:30:45 2003 From: mark@easymailings.com (Mark Bucciarelli) Date: Mon, 3 Mar 2003 13:30:45 -0500 Subject: [XML-SIG] [PATCH] wsdllib.py In-Reply-To: References: Message-ID: <200303031330.48377.mark@easymailings.com> On Monday 03 March 2003 12:35 am, Uche Ogbuji wrote: > Is there any chance you could put together a patch to update wsdllib.py Patch enclosed below (output of diff -u -b). Please review and comment. Mark --- /home/mark/downloads/wsdllib.py 2003-01-06 15:26:37.000000000 -0500 +++ wsdllib.py 2003-03-03 13:19:18.000000000 -0500 @@ -24,10 +24,28 @@ """ import urllib, UserDict, cStringIO -from Ft.Lib import pDomlette -from xml import xpath -from xml.xpath import Conversions -from xml.dom.ext import PrettyPrint, SplitQName +import os + +# Release 0.12 of 4Suite unified the domelettes and removed pDomlette +DOMLETTE_UNIFICATION = False +try: + import Ft.Xml.Domlette + DOMLETTE_UNIFICATION = True +except ImportError: + from Ft.Lib import pDomlette + +if DOMLETTE_UNIFICATION: + from Ft.Xml import XPath + xpath = XPath + from Ft.Xml.XPath import Conversions + PrettyPrint = Ft.Xml.Domlette.PrettyPrint + from Ft.Rdf.Inference.Common import SplitQName + import xml.dom +else: + from xml import xpath + from xml.xpath import Conversions + from xml.dom.ext import PrettyPrint, SplitQName + from xml.dom import Node WSDL_NAMESPACE='http://schemas.xmlsoap.org/wsdl/' @@ -50,9 +68,25 @@ g_faultExpression = xpath.Compile('w:fault') g_portsExpression = xpath.Compile('w:port') -def ReadFromStream(stream): - """Read in a WSDL message from a steam object""" +class WsdlException(Exception): + def __init__(self, msg): + self.msg = msg + def __str__(self): + return self.msg + + +def ReadFromStream(stream, uri='file://' + os.getcwd() + os.sep + 'foo'): + """Read in a WSDL message from a steam object + + 4Suite 0.12 requires a URI when parsing xml data, as it is required to + resolve XIncludes and entities. It is also required for some XSLT (for + example xsl:include and xsl:import) and RDF.""" + ws = Wsdl() + if DOMLETTE_UNIFICATION: + dom = Ft.Xml.Domlette.NonvalidatingReader.parseStream(stream, uri) + ws.fromDom(dom) + else: reader = pDomlette.PyExpatReader() dom = reader.fromStream(stream) ws.fromDom(dom) @@ -68,10 +102,17 @@ def ReadFromUri(uri): """Read in a WSDL message from a URI""" st = urllib.urlopen(uri) - ws = ReadFromStream(st) + ws = ReadFromStream(st, uri) st.close() return ws +def getAttributeNSWrapper(node, namespaceprefix, attribute): + """Newer stuff uses xml.dom.EMPTY_NAMESPACE (None) instead of ''.""" + + if not namespaceprefix and DOMLETTE_UNIFICATION: + return node.getAttributeNS(xml.dom.EMPTY_NAMESPACE, attribute) + else: + return node.getAttributeNS(namespaceprefix, attribute) class Wsdl: """This class represents the entire WSDL definition. It can be created from one of the above @@ -218,13 +259,14 @@ for m in messages: con = xpath.Context.Context(m, processorNss={'w': WSDL_NAMESPACE}) documentation = DocumentationFromDom(con) - msg = self.addMessage(m.getAttributeNS('','name'),documentation) + msg = self.addMessage(getAttributeNSWrapper(m,'','name'), + documentation) parts = g_partsExpression.evaluate(con) for p in parts: - n = p.getAttributeNS('','name') - element = p.getAttributeNS('','element') - _type = p.getAttributeNS('','type') + n = getAttributeNSWrapper(p,'','name') + element = getAttributeNSWrapper(p,'','element') + _type = getAttributeNSWrapper(p,'','type') msg.addPart(n,element,_type) def toDom(self,doc): @@ -241,7 +283,8 @@ def addPart(self,name,element='',_type=''): """Add a new part to a message""" if self.parts.has_key(name): - raise WsdlException("Message %s already has part %s exists" % (self.name,name)) + raise WsdlException("Message '%s' already has part '%s' exists" \ + % (self.name,name)) p = Part(name) p.element = element p.type = _type @@ -296,13 +339,13 @@ con = xpath.Context.Context(pt, processorNss={'w': WSDL_NAMESPACE}) documentation = DocumentationFromDom(con) - p = self.addPortType(pt.getAttributeNS('','name'),documentation) + p = self.addPortType(getAttributeNSWrapper(pt,'','name'),documentation) operations = g_operationsExpression.evaluate(con) for op in operations: con = xpath.Context.Context(op, processorNss={'w': WSDL_NAMESPACE}) documentation = DocumentationFromDom(con) - o = p.addOperation(op.getAttributeNS('','name'),documentation) + o = p.addOperation(getAttributeNSWrapper(op,'','name'),documentation) self.__inputFromDom(con,o) self.__outputFromDom(con,o) self.__faultsFromDom(con,o) @@ -322,8 +365,8 @@ input = g_inputExpression.evaluate(con) if len(input): input = input[0] - msg = input.getAttributeNS('','message') - name = input.getAttributeNS('','name') + msg = getAttributeNSWrapper(input,'','message') + name = getAttributeNSWrapper(input,'','name') icon = xpath.Context.Context(input, processorNss={'w': WSDL_NAMESPACE}) documentation = DocumentationFromDom(icon) o.setInput(msg,name,documentation) @@ -332,8 +375,8 @@ output = g_outputExpression.evaluate(con) if len(output): output = output[0] - msg = output.getAttributeNS('','message') - name = output.getAttributeNS('','name') + msg = getAttributeNSWrapper(output,'','message') + name = getAttributeNSWrapper(output,'','name') ocon = xpath.Context.Context(output, processorNss={'w': WSDL_NAMESPACE}) documentation = DocumentationFromDom(ocon) o.setOutput(msg,name,documentation) @@ -341,8 +384,8 @@ def __faultsFromDom(self,con,o): faults = g_faultExpression.evaluate(con) for fault in faults: - msg = fault.getAttributeNS('','message') - name = fault.getAttributeNS('','name') + msg = getAttributeNSWrapper(fault,'','message') + name = getAttributeNSWrapper(fault,'','name') fcon = xpath.Context.Context(fault, processorNss={'w': WSDL_NAMESPACE}) documentation = DocumentationFromDom(fcon) o.addFault(name,msg,documentation) @@ -530,7 +573,8 @@ con = xpath.Context.Context(b, processorNss={'w': WSDL_NAMESPACE}) documentation = DocumentationFromDom(con) - bi = self.addBinding(b.getAttributeNS('','name'),b.getAttributeNS('','type'),documentation) + bi = self.addBinding(getAttributeNSWrapper(b,'','name'), + getAttributeNSWrapper(b,'','type'),documentation) for child in b.childNodes: if child.nodeType != Node.ELEMENT_NODE: @@ -542,7 +586,8 @@ con = xpath.Context.Context(child, processorNss={'w': WSDL_NAMESPACE}) documentation = DocumentationFromDom(con) - o = bi.addOperation(child.getAttributeNS('','name'),documentation) + o = bi.addOperation(getAttributeNSWrapper(child,'','name'), + documentation) self.__readInputFromDom(con,o) self.__readOutputFromDom(con,o) @@ -609,7 +654,7 @@ else: #An extension extensions.append(ExtensionFromDom(iChild)) - bf = op.addFault(fault.getAttributeNS('','name'),documentation) + bf = op.addFault(getAttributeNSWrapper(fault,'','name'),documentation) for e in extensions: bf.addExtension(e) @@ -785,12 +830,13 @@ con = xpath.Context.Context(serv, processorNss={'w': WSDL_NAMESPACE}) documentation = DocumentationFromDom(con) - s = self.addService(serv.getAttributeNS('','name'),documentation) + s = self.addService(getAttributeNSWrapper(serv,'','name'),documentation) for pd in g_portsExpression.evaluate(con): pcon = xpath.Context.Context(pd, processorNss={'w': WSDL_NAMESPACE}) documentation = DocumentationFromDom(pcon) - p = s.addPort(pd.getAttributeNS('','name'),pd.getAttributeNS('','binding'),documentation) + p = s.addPort(getAttributeNSWrapper(pd,'','name'), + getAttributeNSWrapper(pd,'','binding'),documentation) for child in pd.childNodes: if child.nodeType != Node.ELEMENT_NODE: From uche.ogbuji@fourthought.com Mon Mar 3 18:40:26 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Mon, 03 Mar 2003 11:40:26 -0700 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: Message from Michael McLay of "Mon, 03 Mar 2003 12:20:56 EST." <200303031220.56667.mclay@nist.gov> Message-ID: > On Monday 03 March 2003 11:05 am, Rich Salz wrote: > > > Having said that, the practicality is again in question: not just the > > > workload, but the process of agreeing on exactly how to slice and dice > > > PyXML. > > > > I think we try to force-feed the Python core as much as they'll take. > > Like making pate' :) > > I was about to write to suggest that as much of PyXML as is practical be moved > into the Python distribution. I was happy to see someone proposed it first. > Would it be possible to get some of the useful stuff from 4suite added to the > Python distribution as well? The good news on this is that we're actually approaching the long overdue final merge point between 4XPath/4XSLT and PyXML: i.e. 4Suite 1.0. So we can probably start planning this move at least as far as 4XPath/4XSLT are conerned. Note that along with these come the Domlettes and the XInclude/XPointer stuff. Of course, this leads us to the likely bad news. I think that there might be some resistance to all the bells and whistles we use to work all this stuff in 4Suite. Martin, for example, already preferred to rewrite the XPath/XPattern parsers in Yapps. If the 4SUite mechanisms are not accepeted as they are, or close to it, I anticipate a lot of work, that we might not be able to find contributors for. > It's getting down to the wire on the 2.3 release. Perhaps it would be a good > idea to raise the subject on python-dev. I'd like to just get a round of thoughts from the others on this thread first. Then I'll volunteer to broach the topic on python-dev. AT least I'll talk about swallowing SAX and DOM-minus-4DOM. I think talk of swallowing 4XPath, 4XSLT or aught else from 4Suite 1.0 is probably a topic for later on, on python-dev, though fair discussion here right now. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com The open office file format - http://www-106.ibm.com/developerworks/xml/librar y/x-think15/ 4Suite Repository Features - https://www6.software.ibm.com/reg/devworks/dw-x4su ite5-i/ XML class warfare - http://www.adtmag.com/article.asp?id=6965 See you at XML Web Services One - http://www.xmlconference.com/santaclara/ From faassen@vet.uu.nl Mon Mar 3 19:58:59 2003 From: faassen@vet.uu.nl (Martijn Faassen) Date: Mon, 3 Mar 2003 20:58:59 +0100 Subject: [XML-SIG] Re: Finding _xmlplus in Python 2.3a2 In-Reply-To: References: <20030302165929.GB17610@vet.uu.nl> <200303021114.59524.jeremy.kloth@fourthought.com> <20030302215513.GA18402@vet.uu.nl> <20030303103847.GB20110@vet.uu.nl> Message-ID: <20030303195859.GA21993@vet.uu.nl> Martin v. L=F6wis wrote: > Martijn Faassen writes: >=20 > > Of course, but it would also simplify matters in development and > > deployment.=20 >=20 > It wouldn't simplify maintenance, though: Files that are now shared > identically between Python and PyXML now must be "nearly" shared: > Every reference to the package should then read "_xmlplus" for the > copy of the file in PyXML, and should read "xml" for the copy of the > file in Python. >=20 > It would also be an ongoing source of user confusion: Should I use > xml.dom.minidom, or _xmlplus.dom.minidom? etc. Yes, those are two good points. I'm not sure about user confusion=20 issues; I still suspect the current scheme is far more confusing for users. People definitely construct the wrong mental model about the way things are set up now, and this leads to confusion and wasted time. The nearly shared maintenance issue is a more thorny one, though. If PyXML actually moved maintenance of modules that end up in the Python core out of PyXML then the problem would be decreased here. This does require updating those files only when a new major version of Python is released (unless you sneak them in like the email package upgrade). Would this be a large problem? As far as I'm aware eventually this is the plan for that code anyway -- what is the thinking on that? > > And I hope there can be some discussion of migration=20 > > strategies. You could for instance abandon the scheme in the next > > PyXML release, keep _xmlplus of the previous one installed if it's > > there, and point out to people that in order to use PyXML from now on > > they have to explicitly refer to the pyxml namespace. You could even > > provide a migration hack where people can explicitly enable pyxml to > > be picked up in the traditional way. >=20 > Please be aware that there is *a lot* of code out there that is still > in use but unmaintained. We still get questions from people using code > written for PyXML 0.5, with API that went away in PyXML 0.6. Somebody > has to port this code, but nobody can, as the original author lost > interest. Yes, but changing the way packages work wouldn't much alter this, right? Though you could say that breaking all the imports would cause a lot of code to become unusuable with a PyXML upgrade? I don't think that's strictly the case as one might keep an older version of PyXML installed in parallel. In fact that might become easier if you have a renaming (at least keeping before the renaming things installed in=20 parallel to the after the renaming stuff). Regards, Martijn From faassen@vet.uu.nl Mon Mar 3 20:12:39 2003 From: faassen@vet.uu.nl (Martijn Faassen) Date: Mon, 3 Mar 2003 21:12:39 +0100 Subject: [XML-SIG] Re: Finding _xmlplus in Python 2.3a2 In-Reply-To: <002e01c2e192$769ef940$6401a8c0@tbp1> References: <20030302165929.GB17610@vet.uu.nl> <200303021114.59524.jeremy.kloth@fourthought.com> <20030302215513.GA18402@vet.uu.nl> <20030303103847.GB20110@vet.uu.nl> <002e01c2e192$769ef940$6401a8c0@tbp1> Message-ID: <20030303201239.GB21993@vet.uu.nl> Thomas B. Passin wrote: > 1) An easy, definitive way to determine whether I am using the _xmlplus > stuff or the standard stuff, and > 2) A convenient way to force the use of the library code that I want, in > case the automatic machinery should disagree. That would definitely help. Currently the problem is that _xmlplus is supposed to be an implementation detail, except one suddenly needs to know exactly what is going on when an error occurs. Mental models of developers (I discussed this with a coworker today who went through this experience) seem to go through the following stages: * no clue that importing from xml involves PyXML in any way. Impression something is odd as various platforms display different behaviors. * Installing PyXML adds new functionality to the 'xml' core namespace. The original stuff defined by the core library is still managed by the core library however. Hey, installing/upgrading PyXML broke my stuff that depends on the core library, that's odd? What's _xmlplus? * Okay, so _xmlplus is from PyXML, and it mysteriously gets integrated with the 'xml' package somehow, displaying somewhat unpredictable interactions. * Finding out (in his case getting told by me and looking at the code) that PyXML takes over everything, depending on its version and Python's version. Anyway, one definitely needs to know this if one uses PyXML a lot. Perhaps others have had similar learning experiences? > I realize that we do not want to mix-and-match parts of the standard library > with parts of PyXML, and perhaps that is one of the main concerns that > Martin is expressing (Martin, is that right?). But if we override, say, > expat with our own version and it does not behave the same way as the > standard library, not only will we cause confusion but Python itself will > get a bad name very quickly - users will not care that only PyXML causes > these troubles, they will blame Python generally. At the sprint before EuroPython last summer I discovered that on my machine I could not import expat from a certain location from Python 2.1 but could from Python 2.2, but on someone else's machine it was the other way around, or something. And then installing PyXML also changed the behavior in some different way. I forget the details, but it was pretty funny though of course also frustrating. :) Of course this was because some code was importing expat from non-canonical locations. Anything that can go confused with expat will go confused with it. :) > I do not think that any of the alternative proposals so far have discussed > the mix-and-match issue sufficiently. The current approach handles it well > except for breakages caused by bugs or API changes. Martijn, would you care > to talk about this issue some more from your point of view? I'd say that a straightforward import structure even though it would provide two potential places to import the 'same' thing from is still more helpful than the current situation. One way one could solve it is by moving stuff from PyXML that are already inside the Python core. That may not be desirable as development is still ongoing, but surely some things are stable enough by now to stop maintaining as part of PyXML? Another possibility would be to issue warnings if you import something from the core Python library while a newer PyXML version is installed. Not ideal as you'd get them during deployment, but might point people in the right direction... I guess here finding out what is installed and changing imports accordingly in dynamic fashion might help, but that would put the burden on the application programmer, which isn't a good idea either (see expat). Regards, Martijn From faassen@vet.uu.nl Mon Mar 3 20:14:33 2003 From: faassen@vet.uu.nl (Martijn Faassen) Date: Mon, 3 Mar 2003 21:14:33 +0100 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: References: <20030301014057.GA11922@vet.uu.nl> <20030302165143.GA17610@vet.uu.nl> <200303021412.38780.mmclay@comcast.net> <200303021223.35364.jeremy.kloth@fourthought.com> <20030302220205.GB18402@vet.uu.nl> <20030303105148.GC20110@vet.uu.nl> Message-ID: <20030303201433.GC21993@vet.uu.nl> Martin v. L=F6wis wrote: > Martijn Faassen writes: >=20 > > This caused developer confusion in at three of my co-developers here > > at independent instances, and since I only have three co-developers > > here this indicates to me something unexpected is going on. The > > _xmlplus hack is not pythonic -- imports appear from different > > places based on version checks, and the core library is unexpectedly > > overridden completely. >=20 > While I can sympathize with these concerns, I don't think anything can > be done to change the situation that isn't very painful, and requires > more resources than I can offer. We (at Infrae) can also put in some resources if necessary. Regards, Martijn From tpassin@comcast.net Mon Mar 3 23:12:30 2003 From: tpassin@comcast.net (Thomas B. Passin) Date: Mon, 03 Mar 2003 18:12:30 -0500 Subject: [XML-SIG] Re: Finding _xmlplus in Python 2.3a2 References: <20030302165929.GB17610@vet.uu.nl> <200303021114.59524.jeremy.kloth@fourthought.com> <20030302215513.GA18402@vet.uu.nl> <20030303103847.GB20110@vet.uu.nl> <002e01c2e192$769ef940$6401a8c0@tbp1> <20030303201239.GB21993@vet.uu.nl> Message-ID: <002c01c2e1da$5d59edd0$6401a8c0@tbp1> [ "Martijn Faassen"] > One way one could solve it is by moving stuff from PyXML that are already > inside the Python core. That may not be desirable as development is still > ongoing, but surely some things are stable enough by now to stop > maintaining as part of PyXML? > It seems that we may be converging on moving some basics from PyXML into the Python core. Before we settle on that, who would maintain and update that code once it got moved? XML-SIG (I think that would be best)? Cheers, Tom P From Mike.Olson@fourthought.com Mon Mar 3 16:03:55 2003 From: Mike.Olson@fourthought.com (Michael Olson) Date: Mon, 3 Mar 2003 09:03:55 -0700 Subject: [XML-SIG] http://docs.4suite.org/ in xml.dom modules In-Reply-To: <20030303102145.GC9968@calvin.fayauffre.org> Message-ID: > The problem is that nothing's available at that url (docs.4suite.org > doesn't even exist). > > Is there any objection to my removing these lines from the source =20 > files? > None here. It was an idea we had a long time ago that never panned =20 out... Mike > -- =20 > Alexandre Fayolle > LOGILAB, Paris (France). > http://www.logilab.com http://www.logilab.fr http://www.logilab.org > D=E9veloppement logiciel avanc=E9 - Intelligence Artificielle - = Formations > > _______________________________________________ > XML-SIG maillist - XML-SIG@python.org > http://mail.python.org/mailman/listinfo/xml-sig > ------------------------------------------------------------------------=20= ----------------- Mike Olson Principal =20 Consultant mike.olson@fourthought.com +1 303 583 9900 Fourthought, Inc. =20 http://Fourthought.com PO Box 270590, http://4Suite.org Louisville, CO 80027-5009, USA XML strategy, XML tools, knowledge management From rmangaliag@slu.edu.ph Tue Mar 4 06:51:23 2003 From: rmangaliag@slu.edu.ph (rmangaliag@slu.edu.ph) Date: Tue, 4 Mar 2003 14:51:23 +0800 Subject: [XML-SIG] xml to pdf... a newbie question... Message-ID: <1046760683.3e644ceb6416d@mbox.slu.edu.ph> am new here and hoping to be treated like a real freshman... :) this is my first post... :) a friend showed me fop of java which is capable of creating pdf files using xml/xsl... do we have a python program/application that can do the same... i am about to start a web-based project here in our school that will require reports in pdf format, i want to use zope and wondering if and when i access a database and return an xml version of it, i could change it to pdf... is my chain of thought correct???? tnx... ------------------------------------------------- Email Service Provided by SLU-Net Saint Louis University ( http://www.slu.edu.ph ) ------------------------------------------------- From martin@v.loewis.de Tue Mar 4 07:00:51 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 04 Mar 2003 08:00:51 +0100 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: References: Message-ID: John J Lee writes: > When I use a Python core module, and then install a related third-party > module (no matter if it's written by the same people, and/or covers very > similar ground), I don't expect it to clobber the first module unless I > explicitly ask for that (by using try / except, or manipulating sys.path > and the module system myself). I expect it not to even touch the first > module, actually. And I would be correct, for all cases EXCEPT PyXML. No, you wouldn't. There are many cases where installing a new Python package can modify the behaviour of existing Python modules: 1. Any package can install a .pth file, extending sys.path. This, in turn, can cause imports to be resolved in a different way. For this change in behaviour, you don't even have to *use* the installed package. 2. A module can install additional codecs, causing changes in behaviour to unicode_string.encode(), and codecs.lookup(). 3. A module can register things in copy_reg, causing changes in behaviour to the pickle, cPickle, and copy modules. There are probably more examples, but this "silently augment" approach is wide-spread in Python (and, indeed, in the world of computing: any kind of plug-in, by nature, silently extends the behaviour of the application it is plugged into). Regards, Martin From gia@webde-ag.de Tue Mar 4 07:00:37 2003 From: gia@webde-ag.de (Gisbert Amm) Date: Tue, 4 Mar 2003 08:00:37 +0100 Subject: [XML-SIG] xml to pdf... a newbie question... Message-ID: <74ADFA8C453ED611A71E00508BBBA135D9E85C@exchange1.cinetic.de> > a friend showed me fop of java which is capable of creating > pdf files using > xml/xsl... > > do we have a python program/application that can do the same... > > i am about to start a web-based project here in our school > that will require > reports in pdf format, i want to use zope and wondering if > and when i access a > database and return an xml version of it, i could change it to pdf... > Unfortunately I haven't seen a FO processor written in Python yet, but there's another possible solution for you: a free library called ReportLab for PDF creation with Python. It does'nt use XML/XSLT and FO but that probably doesn't matter for your project, on the contrary: ReportLab was especially designed for generation of PDF documents in real time from any data source on web servers. Here you can find it: http://www.reportlab.com/ Regards Gisbert Amm From martin@v.loewis.de Tue Mar 4 07:05:24 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 04 Mar 2003 08:05:24 +0100 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: References: Message-ID: John J Lee writes: > > But wouldn't a renaming of the _xmlplus package cause even more > > developer confusion? [...] > Of course, for people who can upgrade (which is almost everyone, > eventually), it would be simply: > > from pyxml.blah import spam > > But you know all this, so I wonder why you ask? :-P Because this is not about blah and rhubarb, but about dom and sax. If we get both xml.dom and pyxml.dom, won't people get confused as they have to pick one, and don't know how to make a choice? Especially if it doesn't appear to make any difference for some applications? I can't answer that question, because if I implement that change, I know that *I* won't get confused, but I can't generalize from that. Regards, Martin From martin@v.loewis.de Tue Mar 4 07:02:10 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 04 Mar 2003 08:02:10 +0100 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: <200303031220.56667.mclay@nist.gov> References: <3E637D2F.7030802@datapower.com> <200303031220.56667.mclay@nist.gov> Message-ID: Michael McLay writes: > It's getting down to the wire on the 2.3 release. Perhaps it would > be a good idea to raise the subject on python-dev. I don't think anything can or should be done in this respect. What precisely are you proposing (i.e. what specific changes to Python core do you suggest?) Regards, Martin From martin@v.loewis.de Tue Mar 4 07:10:12 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 04 Mar 2003 08:10:12 +0100 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: References: Message-ID: John J Lee writes: > > I bring up the bug reporting simply because I don't recall anyone reporting > > that PyXML broke their Python installation until now. The cases you mention > > are abstract, but without concrete details, I cannot reply otherwise. > [...] > > That argument makes sense only when applied to a feature to be introduced > in the future, in which case we can't know what effect it will have > without considering concrete details. This discussion is about a feature > already introduced (the _xmlplus hack), which we *know* causes problems > (unless you don't believe your users). I think this is the case: We don't believe the users. I know Martijn has coworkers who are confused by this (in the sense that they are unaware of the entire issue, or have the wrong mental model). This, in itself, is no problem: Everybody of us certainly is unaware of some things, and has wrong mental models of other things. The question is whether this has created real problems, in the sense of wasted time and energy. Martijn has reported that it did, in the case of using undocumented API for constructing nodes. I find this example inconvincing, as the next Python release will make the same change, and thus break this code even without PyXML being installed. I haven't heard any other practical examples of real problems caused by the current setup. Regards, Martin From martin@v.loewis.de Tue Mar 4 07:15:25 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 04 Mar 2003 08:15:25 +0100 Subject: [XML-SIG] Re: Finding _xmlplus in Python 2.3a2 In-Reply-To: <002e01c2e192$769ef940$6401a8c0@tbp1> References: <20030302165929.GB17610@vet.uu.nl> <200303021114.59524.jeremy.kloth@fourthought.com> <20030302215513.GA18402@vet.uu.nl> <20030303103847.GB20110@vet.uu.nl> <002e01c2e192$769ef940$6401a8c0@tbp1> Message-ID: "Thomas B. Passin" writes: > I realize that we do not want to mix-and-match parts of the standard library > with parts of PyXML, and perhaps that is one of the main concerns that > Martin is expressing (Martin, is that right?). I have a number of concerns, both maintainer issues, and user issues. 1. Maintenance issues: a) proposed change is unimplementable (more precisely: the straight-forward implementation is incorrect) Just renaming _xmlplus can't work: you get duplicate classes, in particular exception classes; if you mix them, you get surprising errors. Likewise, you get multiple .dom.Node classes, which is evil. b) proposed change creates an ongoing maintenance problem, because of nearly-shared files. 2. User issues: I'm concerned that proponents of "ditch _xmlplus" only see the problems that this would solve, not the problems that this would create. a) Users have to change tons of code. b) Users will be confused which of two nearly-identical libraries they should use. Regards, Martin From martin@v.loewis.de Tue Mar 4 07:19:36 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 04 Mar 2003 08:19:36 +0100 Subject: [XML-SIG] Re: Finding _xmlplus in Python 2.3a2 In-Reply-To: <20030303201239.GB21993@vet.uu.nl> References: <20030302165929.GB17610@vet.uu.nl> <200303021114.59524.jeremy.kloth@fourthought.com> <20030302215513.GA18402@vet.uu.nl> <20030303103847.GB20110@vet.uu.nl> <002e01c2e192$769ef940$6401a8c0@tbp1> <20030303201239.GB21993@vet.uu.nl> Message-ID: Martijn Faassen writes: > One way one could solve it is by moving stuff from PyXML that are already > inside the Python core. That may not be desirable as development is still > ongoing, but surely some things are stable enough by now to stop > maintaining as part of PyXML? There are still lots of open issues with minidom, and with expat. Fred Drake has recently essentially rewritten minidom, to address problems found by users (mainly efficiency concerns, and some correctness concerns). It is likely that there will be rushes of activity in the future again (with long periods of inactivity in-between). PyXML offers a great opportunity to hand out the code to users of the xml package; it allows to correct problems more quickly than a Python beta release cycle. Regards, Martin From martin@v.loewis.de Tue Mar 4 07:21:44 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 04 Mar 2003 08:21:44 +0100 Subject: [XML-SIG] Re: Finding _xmlplus in Python 2.3a2 In-Reply-To: <002c01c2e1da$5d59edd0$6401a8c0@tbp1> References: <20030302165929.GB17610@vet.uu.nl> <200303021114.59524.jeremy.kloth@fourthought.com> <20030302215513.GA18402@vet.uu.nl> <20030303103847.GB20110@vet.uu.nl> <002e01c2e192$769ef940$6401a8c0@tbp1> <20030303201239.GB21993@vet.uu.nl> <002c01c2e1da$5d59edd0$6401a8c0@tbp1> Message-ID: "Thomas B. Passin" writes: > It seems that we may be converging on moving some basics from PyXML into the > Python core. Before we settle on that, who would maintain and update that > code once it got moved? XML-SIG (I think that would be best)? This statement is to abstract for me to agree: I don't know what basics are proposed (I think all the basics are already in Python), and I don't know who that XML-SIG is who would maintain it (in my experience, maintenance requires actual developers, at least in free software - only corporations can offer anonymous-maintenance-by-organization). Regards, Martin From martin@v.loewis.de Tue Mar 4 07:25:51 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 04 Mar 2003 08:25:51 +0100 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: <20030303201433.GC21993@vet.uu.nl> References: <20030301014057.GA11922@vet.uu.nl> <20030302165143.GA17610@vet.uu.nl> <200303021412.38780.mmclay@comcast.net> <200303021223.35364.jeremy.kloth@fourthought.com> <20030302220205.GB18402@vet.uu.nl> <20030303105148.GC20110@vet.uu.nl> <20030303201433.GC21993@vet.uu.nl> Message-ID: Martijn Faassen writes: > > While I can sympathize with these concerns, I don't think anything can > > be done to change the situation that isn't very painful, and requires > > more resources than I can offer. > > We (at Infrae) can also put in some resources if necessary. Thanks for the offer. I would need somebody to do all the work, and take all the blame, someone who won't run away once the work is done and the user complaints come in (for, say, atleast two years). It would probably best if that person would take over a few PyXML releases (you can't have responsibility without power). That is not to say that I want to withdraw from PyXML, but I feel really uneasy about such a change, and I cannot defend something I don't believe in. Regards, Martin From amit.shah@iflexsolutions.com Tue Mar 4 07:36:05 2003 From: amit.shah@iflexsolutions.com (amit.shah@iflexsolutions.com) Date: Tue, 4 Mar 2003 13:06:05 +0530 Subject: [XML-SIG] pls unsuscribe.. Message-ID: name: amit s shah email address : amit.shah@iflexsolutions.com From rmangaliag@slu.edu.ph Tue Mar 4 08:38:01 2003 From: rmangaliag@slu.edu.ph (rmangaliag@slu.edu.ph) Date: Tue, 4 Mar 2003 16:38:01 +0800 Subject: [XML-SIG] xml to pdf... a newbie question... Message-ID: <1046767081.3e6465e9943fd@mbox.slu.edu.ph> thanks... i'm currently downloading it now... how about if i choose to present the reports in postscript??? is there a python application that can change xml/xsl to postscript??? tnx again... :) > a friend showed me fop of java which is capable of creating > pdf files using > xml/xsl... > > do we have a python program/application that can do the same... > > i am about to start a web-based project here in our school > that will require > reports in pdf format, i want to use zope and wondering if > and when i access a > database and return an xml version of it, i could change it to pdf... > Unfortunately I haven't seen a FO processor written in Python yet, but there's another possible solution for you: a free library called ReportLab for PDF creation with Python. It does'nt use XML/XSLT and FO but that probably doesn't matter for your project, on the contrary: ReportLab was especially designed for generation of PDF documents in real time from any data source on web servers. Here you can find it: http://www.reportlab.com/ Regards Gisbert Amm ------------------------------------------------- Email Service Provided by SLU-Net Saint Louis University ( http://www.slu.edu.ph ) ------------------------------------------------- From gia@webde-ag.de Tue Mar 4 09:43:44 2003 From: gia@webde-ag.de (Gisbert Amm) Date: Tue, 4 Mar 2003 10:43:44 +0100 Subject: [XML-SIG] xml to pdf... a newbie question... Message-ID: <74ADFA8C453ED611A71E00508BBBA135D9E860@exchange1.cinetic.de> > thanks... i'm currently downloading it now... > > how about if i choose to present the reports in postscript??? > > is there a python application that can change xml/xsl to postscript??? > I'm afraid there isn't a out-of-the-box solution. But I don't know exactly. The only way to create Postscript I know is from DocBook XML via Latex to Postscript, but that's a thorny path and seems somewhat oversized just for some reports ... On the other hand: If you want to be flexible with future output formats, write out your data from Python to XML (stream or file) and then transform it with XSLT to the format you want. There are several XSLT engines in general and for python, most popular perhaps Saxon (Java) and 4xslt (Python) and Xalan (C++, Java) for which exists a Python interface called Pyana which I use currently. And FOP, as you certainly know, can generate PDF from XML directly (using the appropriate XSLT). Be aware of the work to do with XSLT (and to learn it, if you're not already typing it fluently). If PDF is the only format you need, ReportLab is a good choice. Regards Gisbert Amm From rmangaliag@slu.edu.ph Tue Mar 4 10:12:08 2003 From: rmangaliag@slu.edu.ph (rmangaliag@slu.edu.ph) Date: Tue, 4 Mar 2003 18:12:08 +0800 Subject: [XML-SIG] xml to pdf... a newbie question... Message-ID: <1046772728.3e647bf8a476e@mbox.slu.edu.ph> thank you very much Gisbert... you dont know how much help you gave me... hope i can finish the work... again... thanks... ali :) ------------------------------------------------- Email Service Provided by SLU-Net Saint Louis University ( http://www.slu.edu.ph ) ------------------------------------------------- From faassen@vet.uu.nl Tue Mar 4 11:02:44 2003 From: faassen@vet.uu.nl (Martijn Faassen) Date: Tue, 4 Mar 2003 12:02:44 +0100 Subject: [XML-SIG] Re: Finding _xmlplus in Python 2.3a2 In-Reply-To: <002c01c2e1da$5d59edd0$6401a8c0@tbp1> References: <20030302165929.GB17610@vet.uu.nl> <200303021114.59524.jeremy.kloth@fourthought.com> <20030302215513.GA18402@vet.uu.nl> <20030303103847.GB20110@vet.uu.nl> <002e01c2e192$769ef940$6401a8c0@tbp1> <20030303201239.GB21993@vet.uu.nl> <002c01c2e1da$5d59edd0$6401a8c0@tbp1> Message-ID: <20030304110244.GA24855@vet.uu.nl> Thomas B. Passin wrote: > [ "Martijn Faassen"] > > > One way one could solve it is by moving stuff from PyXML that are already > > inside the Python core. That may not be desirable as development is still > > ongoing, but surely some things are stable enough by now to stop > > maintaining as part of PyXML? > > It seems that we may be converging on moving some basics from PyXML into the > Python core. Before we settle on that, who would maintain and update that > code once it got moved? XML-SIG (I think that would be best)? It's nice we are converging; I hadn't read the other posts suggesting the same thing when I made mine. I would think the XML-SIG still manages the code. See also PEP 2 (which I wrote and which is still not official as far as I'm aware, but it models this fairly well): http://www.python.org/peps/pep-0002.html Regards, Martijn From mgushee@havenrock.com Tue Mar 4 11:01:57 2003 From: mgushee@havenrock.com (mgushee@havenrock.com) Date: Tue, 04 Mar 2003 04:01:57 -0700 Subject: [XML-SIG] xml to pdf... a newbie question... In-Reply-To: <74ADFA8C453ED611A71E00508BBBA135D9E860@exchange1.cinetic.de> Message-ID: <3E642535.5212.29933DB@localhost> On 4 Mar 2003 at 10:43, Gisbert Amm wrote: > > thanks... i'm currently downloading it now... > > > > how about if i choose to present the reports in postscript??? > > > > is there a python application that can change xml/xsl to postscript??? > > > I'm afraid there isn't a out-of-the-box solution. But I don't know exactly. > > The only way to create Postscript I know is from DocBook XML via Latex to > Postscript, but that's a thorny path and seems somewhat oversized just for > some reports ... Another similar, more flexible option is to use ConTeXt. It's another TeX macro system, and it has semi-built-in support for processing XML directly. By 'semi-built-in', I mean that you will likely have to write a sort of mapping file to tell ConTeXt how to handle your particular XML dialect. Not too hard if you're well-versed in TeX, but otherwise it might be rough. Actually, you could render the XML (using your Python code) to a Tkinter Canvas, and then use the Canvas.postscript() method to output PS. If you don't need a GUI, I believe you can do this without ever displaying the Tk window. It's kind of an odd approach, but certainly feasible (and probably no harder than any of the other options that have been mentioned). > On the other hand: If you want to be flexible with future output formats, > write out your data from Python to XML (stream or file) and then transform > it with XSLT to the format you want. > > There are several XSLT engines in general and for python, most popular > perhaps Saxon (Java) and 4xslt (Python) and Xalan (C++, Java) for which > exists a Python interface called Pyana which I use currently. And FOP, as > you certainly know, can generate PDF from XML directly (using the > appropriate XSLT). I wouldn't call that 'direct', since you need to use full XSL rather than just XSLT. > Be aware of the work to do with XSLT (and to learn it, if you're not already > typing it fluently). > > If PDF is the only format you need, ReportLab is a good choice. I second that recommendation. I would just add that once you've got ReportLab it may not be at all clear how to proceed, but I would suggest writing a SAX Handler that uses ReportLab's PLATYPUS interface to generate PDF. One problem you may run into is that ReportLab has built-in so-called "XML support"--meaning that it automatically interprets certain tags within paragraphs as formatting instructions (, , and the like). But it doesn't handle arbitrary elements or full XML documents. I wish they hadn't added that "feature"--it's a significant flaw in an otherwise excellent product. But, as I recall, it's not terribly hard to work around that as long as you're aware of the issue. It's been a while since I've done anything with ReportLab, but I may be able to help a bit if you run into trouble. -- Matt Gushee Englewood, CO USA From faassen@vet.uu.nl Tue Mar 4 11:13:11 2003 From: faassen@vet.uu.nl (Martijn Faassen) Date: Tue, 4 Mar 2003 12:13:11 +0100 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: References: Message-ID: <20030304111311.GB24855@vet.uu.nl> Uche Ogbuji wrote: > I think this is the best proposal I've heard so far in this thread. > Unfortunately, I sense that bundling PyXML would be a hard sell on python-dev > :-( Agreed. This is understandable too. :) > I do think that Python's pace of change has picked up since the original > _xmlplus decision, so I could also get behind a proposal that *eliminates* the > separate subset of PyXML in Python. Specifically: > > * break PyXML in two packages such that there is no overlap at all between the > two > * The base package (i.e. sax, and dom minus 4DOM, I think) *becomes* the part > that is directly bundled with Python, i.e. disappears from the PyXML CVS and > moves into Python CVS, with all that implies Would the CVS transition be a necessary consequence of moving it into the Python core officially? After all, some of it is distributed *with* the Python core already, it's just that PyXML *also* distributes versions of it. > * The python-xml-extras package (i.e. 4DOM, marshal, etc.) does indeed move to > a separate top-level package name as a separate package > > Having said that, the practicality is again in question: not just the > workload, but the process of agreeing on exactly how to slice and dice PyXML. > But I do think this is a *much* better solution than ditching the _xmlplus > method without merging PyXML-in-Python with PyXML-from-XML-SIG, and if a > change did somehow become prctical, I would mive strongly for either Rich's > proposal above, or, better yet, mine. My main goal is to somehow improve the _xmlplus situation, and my goal was to have a discussion on how to do it. So, I'm glad the discussion is at least taking place, whatever the outcome will be. Moving stuff into the core and outside of PyXML certainly sounds good to me. Regards, Martijn From faassen@vet.uu.nl Tue Mar 4 11:33:30 2003 From: faassen@vet.uu.nl (Martijn Faassen) Date: Tue, 4 Mar 2003 12:33:30 +0100 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: References: <200303031220.56667.mclay@nist.gov> Message-ID: <20030304113330.GC24855@vet.uu.nl> Uche Ogbuji wrote: [snip] > Of course, this leads us to the likely bad news. I think that there might be > some resistance to all the bells and whistles we use to work all this stuff in > 4Suite. Martin, for example, already preferred to rewrite the XPath/XPattern > parsers in Yapps. If the 4SUite mechanisms are not accepeted as they are, or > close to it, I anticipate a lot of work, that we might not be able to find > contributors for. Side note: Infrae's working on an XML database with a (hopefully) fast XPath implementation that uses a fast but compact index mechanism and things like database joins. I took some of the PyXML XPath parsing code to build up the basic parse tree. I'm worried about the long-term maintenance issues of that code, as I had to do quite a bit of hacking to make it work and use my Parsed* classes and not PyXML's. I think that this uses Martin's parser and not 4Suite's. A pluggable architecture would be nice. :) > > It's getting down to the wire on the 2.3 release. Perhaps it would be a good > > idea to raise the subject on python-dev. > > I'd like to just get a round of thoughts from the others on this thread first. > Then I'll volunteer to broach the topic on python-dev. AT least I'll talk > about swallowing SAX and DOM-minus-4DOM. I think talk of swallowing 4XPath, > 4XSLT or aught else from 4Suite 1.0 is probably a topic for later on, on > python-dev, though fair discussion here right now. Yes, I think we should consider not letting that be swallowed by the core ever. After all, these are programming language implementations (XPath and XSLT are) and the Python core is already maintaining one. So I would suggest distributing this as a separate package (pyxml) and not having the ambition of moving it into the core. Regards, Martijn From faassen@vet.uu.nl Tue Mar 4 11:37:04 2003 From: faassen@vet.uu.nl (Martijn Faassen) Date: Tue, 4 Mar 2003 12:37:04 +0100 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: References: <3E637D2F.7030802@datapower.com> <200303031220.56667.mclay@nist.gov> Message-ID: <20030304113704.GD24855@vet.uu.nl> Martin v. L=F6wis wrote: > Michael McLay writes: >=20 > > It's getting down to the wire on the 2.3 release. Perhaps it would > > be a good idea to raise the subject on python-dev. >=20 > I don't think anything can or should be done in this respect. What > precisely are you proposing (i.e. what specific changes to Python core > do you suggest?) I'd say, since the parsers and sax and minidom are already part of the core distribution from a user's point of view, moving these components into the core also for maintenance. The XML-SIG can still maintain these and feed patches, but it wouldn't distribute it as part of PyXML. If really really necessary the XML-SIG could even distribute this as a *separate* package from PyXML that overrides the core 'xml' stuff containing only upgrades of what is in the core, not new functionality, but only if it's extremely clear that this is going to hap= pen to those who install it and developers. And I suspect that the mentioned systems are mature enough not to need this anyway; bugfixes can just go in Python bugfix releases. Regards, Martijn From faassen@vet.uu.nl Tue Mar 4 11:49:36 2003 From: faassen@vet.uu.nl (Martijn Faassen) Date: Tue, 4 Mar 2003 12:49:36 +0100 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: References: Message-ID: <20030304114936.GE24855@vet.uu.nl> Martin v. L=F6wis wrote: > No, you wouldn't. There are many cases where installing a new Python > package can modify the behaviour of existing Python modules: >=20 > 1. Any package can install a .pth file, extending sys.path. This, in > turn, can cause imports to be resolved in a different way. For this > change in behaviour, you don't even have to *use* the installed > package. Don't know about this one. Does this happen a lot, and what is the motivation? Is the use case like installing something in site-packages bu= t keeping the new modules in a separate location instead? > 2. A module can install additional codecs, causing changes in > behaviour to unicode_string.encode(), and codecs.lookup(). Additional codecs is the key thing here. Can existing codecs get overridd= en? Anyway, this is not installing a new version of source code, but plugging in data. > 3. A module can register things in copy_reg, causing changes in > behaviour to the pickle, cPickle, and copy modules. Sure, a module can add its own __add__ too causing changes in behavior in the core too. :) Does existing code commonly get *overridden* by this mechanism, or is it a mechanism to plug in more functionality?=20 And if something goes wrong, the offending module will be in the tracebac= k. If something goes wrong with PyXML, _xmlplus will be in the traceback and this is not very enlightening. And if you hadn't installed PyXML _xmlplus won't be in the traceback, with the *same client code*. I don't think that this happens in the cases you sketched above. > There are probably more examples, but this "silently augment" approach > is wide-spread in Python (and, indeed, in the world of computing: any > kind of plug-in, by nature, silently extends the behaviour of the > application it is plugged into). Yes, and people believe (if they reach this stage) that PyXML silently augments the 'xml' functionality with new features. Unfortunately it silently overrides all of its code instead.=20 I don't believe that in the cases you mention core Python APIs get extend= ed with new ones, either. Hmm...can we at least get a consensus that the current _xmlplus approach = is not ideal and can be confusin and that we should try to improve it if we = can? Not part of this consensus is how hard improving matters would be, what the improvement would entail and who should do the work; just a consensus that we should consider improving matters somehow. :) Regards, Martijn From faassen@vet.uu.nl Tue Mar 4 12:02:16 2003 From: faassen@vet.uu.nl (Martijn Faassen) Date: Tue, 4 Mar 2003 13:02:16 +0100 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: References: <20030301014057.GA11922@vet.uu.nl> <20030302165143.GA17610@vet.uu.nl> <200303021412.38780.mmclay@comcast.net> <200303021223.35364.jeremy.kloth@fourthought.com> <20030302220205.GB18402@vet.uu.nl> <20030303105148.GC20110@vet.uu.nl> <20030303201433.GC21993@vet.uu.nl> Message-ID: <20030304120216.GF24855@vet.uu.nl> Martin v. L=F6wis wrote: > Martijn Faassen writes: >=20 > > > While I can sympathize with these concerns, I don't think anything = can > > > be done to change the situation that isn't very painful, and requir= es > > > more resources than I can offer. > >=20 > > We (at Infrae) can also put in some resources if necessary. >=20 > Thanks for the offer. I would need somebody to do all the work, and > take all the blame, someone who won't run away once the work is done > and the user complaints come in (for, say, atleast two years). It > would probably best if that person would take over a few PyXML > releases (you can't have responsibility without power). At a present stage I cannot make that commitment.. > That is not to say that I want to withdraw from PyXML, but I feel > really uneasy about such a change, and I cannot defend something I > don't believe in. I'd prefer working out some strategies that are less painful and that we can all agree on. There seems to be some consensus at least of=20 separating the pieces already distributed with the Python core from PyXML itself. I imagine something like the following steps: * pieces of PyXML are already synced up with the Python core. Instead, those pieces will be maintained either in the Python core CVS or in a PyXML CVS separate from the PyXML distribution. * Newer PyXML distributions stop from overriding this code in the core. They only offer added functionality. * Either we give up the notion about putting everything under the 'xml' namespace, or a new mechanism is devised for extending the 'xml' namespace while not overriding core code. The former would have my preference as it'd be much simpler, and would involve a new namespace. * If a new top level namespace is created (such as 'pyxml'), some code will break. For instance 'xml.xpath' will break and users will have to start using 'pyxml.xpath'=20 * the transition for developers to the pyxml namespace is not so painful, as the code in there will be relatively new (xpath for=20 instance) and not so many systems are using it yet. A system can even be devised where a new version of PyXML can be installed in para= llel with an older _xmlplus version of PyXML. * Eventually it may be decided to move more code from the pyxml package into the xml package and thus into the Python core. Python core requirements may need changes and API breakages to this code anyway, so that importing the new core code from a different location is the right thing to do. This is similar to the way other packages get adopted into the Python core. Some of these steps are more dangerous than others, but all seem to be reasonably doable, don't they? Regards, Martijn From gia@webde-ag.de Tue Mar 4 12:06:23 2003 From: gia@webde-ag.de (Gisbert Amm) Date: Tue, 4 Mar 2003 13:06:23 +0100 Subject: [XML-SIG] xml to pdf... a newbie question... Message-ID: <74ADFA8C453ED611A71E00508BBBA135D9E867@exchange1.cinetic.de> > On 4 Mar 2003 at 10:43, Gisbert Amm wrote: > > > On the other hand: If you want to be flexible with future > output formats, > > write out your data from Python to XML (stream or file) and > then transform > > it with XSLT to the format you want. > > > > There are several XSLT engines in general and for python, > most popular > > perhaps Saxon (Java) and 4xslt (Python) and Xalan (C++, > Java) for which > > exists a Python interface called Pyana which I use > currently. And FOP, as > > you certainly know, can generate PDF from XML directly (using the > > appropriate XSLT). > > I wouldn't call that 'direct', since you need to use full XSL rather > than just XSLT. You're right, of course. > One problem you may run into is that ReportLab has built-in so-called > > "XML support"--meaning that it automatically interprets certain tags > within paragraphs as formatting instructions (, , and the > like). But it doesn't handle arbitrary elements or full XML > documents. I wish they hadn't added that "feature"--it's a > significant flaw in an otherwise excellent product. But, as I recall, > > it's not terribly hard to work around that as long as you're aware of > > the issue. It's been a while since I've done anything with ReportLab, > > but I may be able to help a bit if you run into trouble. > Thank you for pointing that out and for your other interesting remarks. Regards Gisbert Amm From martin@v.loewis.de Tue Mar 4 12:24:56 2003 From: martin@v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Tue, 04 Mar 2003 13:24:56 +0100 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: <20030304114936.GE24855@vet.uu.nl> References: <20030304114936.GE24855@vet.uu.nl> Message-ID: <3E649B18.5040207@v.loewis.de> Martijn Faassen wrote: > Don't know about this one. Does this happen a lot, and what is the > motivation? Is the use case like installing something in site-packages but > keeping the new modules in a separate location instead? I believe only few packages ship with .pth files, which predate packages. AFAIK, Numerical Python uses that, to put stuff into site-packages/Numeric, and still have all modules inside Numeric appear at the toplevel. >>2. A module can install additional codecs, causing changes in >> behaviour to unicode_string.encode(), and codecs.lookup(). > > > Additional codecs is the key thing here. Can existing codecs get overridden? This is underspecified, and undocumented, but I believe you can, atleast by modifying the codecs aliases. > Anyway, this is not installing a new version of source code, but > plugging in data. No. A codec is an algorithm, that performs some computation. Depending on whether certain codecs are installed, the very same Python program can behave differently on different machines. >>3. A module can register things in copy_reg, causing changes in >> behaviour to the pickle, cPickle, and copy modules. > > Sure, a module can add its own __add__ too causing changes in behavior > in the core too. :) Does existing code commonly get *overridden* by this > mechanism, or is it a mechanism to plug in more functionality? It is designed to plug in more functionality, just like _xmlplus is. > And if something goes wrong, the offending module will be in the traceback. What is the offending module? The plugin, or the code using the plugin? > If something goes wrong with PyXML, _xmlplus will be in the traceback > and this is not very enlightening. I can't see the difference. If something goes wrong after replacing xml with _xmlplus, both _xmlplus, and the offending code (usually its caller) will be in the traceback. > And if you hadn't installed PyXML > _xmlplus won't be in the traceback, with the *same client code*. Just like any other plugin: If you don't install the plugin, you don't see the plugin in the traceback (obviously). > Yes, and people believe (if they reach this stage) that PyXML silently > augments the 'xml' functionality with new features. Unfortunately it > silently overrides all of its code instead. But it does augment, by overriding all code! The code it overrides is nearly-identical to the code it replaces, except for bug fixes. > I don't believe that in the cases you mention core Python APIs get extended > with new ones, either. Defined "get extended". If I can't pass "big-5" to the builtin unicode function first, but can do so after installing a codec, I would say that I have just extended the builtin unicode function. > Hmm...can we at least get a consensus that the current _xmlplus approach i > not ideal and can be confusin and that we should try to improve it if we can? I can agree with that. Regards, Martin From mal@lemburg.com Tue Mar 4 12:45:55 2003 From: mal@lemburg.com (M.-A. Lemburg) Date: Tue, 04 Mar 2003 13:45:55 +0100 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: <3E649B18.5040207@v.loewis.de> References: <20030304114936.GE24855@vet.uu.nl> <3E649B18.5040207@v.loewis.de> Message-ID: <3E64A003.8060002@lemburg.com> Martin v. L=F6wis wrote: Welcome bak, Martin :-) Hope you had a nice holiday ! >>> 2. A module can install additional codecs, causing changes in >>> behaviour to unicode_string.encode(), and codecs.lookup(). >> >> Additional codecs is the key thing here. Can existing codecs get=20 >> overridden? >=20 > This is underspecified, and undocumented, but I believe you can, atleas= t=20 > by modifying the codecs aliases. It is undocumented on purpose: you are not supposed to override existing codecs; you are also not supposed to hack the encodings' package aliase table. Instead you are advised to come up with a new name, e.g. by placing the codecs into a special package, and registering your own search function if you want to provide aliases for the codec. BTW, hacking aliases is not guaranteed to always work: the codec registry uses an internal cache which it consults *before* querying the codec search functions. You would have to hack the aliases table prior to first usage of the codec to be successful. --=20 Marc-Andre Lemburg eGenix.com Professional Python Software directly from the Source (#1, Mar 04 2003) >>> Python/Zope Products & Consulting ... http://www.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ Python UK 2003, Oxford: 28 days left EuroPython 2003, Charleroi, Belgium: 112 days left From faassen@vet.uu.nl Tue Mar 4 14:10:32 2003 From: faassen@vet.uu.nl (Martijn Faassen) Date: Tue, 4 Mar 2003 15:10:32 +0100 Subject: [XML-SIG] xml namespace prefix and xml.sax.saxutils.XMLGenerator Message-ID: <20030304141032.GA25744@vet.uu.nl> Hi there, I'm using xml.sax.saxutils.XMLGenerator to generate XML from sax events automatically, and I think I've discovered a bug. The XML standard defines that an attribute called 'xml:lang' may be defined. The XML namespace standard expands on this in Section 4, 'Using Qualified Names': Namespace Constraint: Prefix Declared The namespace prefix, unless it is xml or xmlns, must have been declared in a namespace declaration attribute in either the start-tag of the element where the prefix is used or in an an ancestor element (i.e. an element in whose content the prefixed markup occurs). The prefix xml is by definition bound to the namespace name http://www.w3.org/XML/1998/namespace. The prefix xmlns is used only for namespace bindings and is not itself bound to any namespace name. The generator works fine for 'xmlns', but it doesn't seem to handle 'xml' properly. What should be the case if I understand this right is that the 'xml' namespace is always declared (and thus does not get a special xmlns declaration). The XMLGenerator and perhaps other code does not recognize the 'xml' prefix however, and barfs over it when generating startElementNS(). Trying to introduce it by using startPrefixMapping() fails, as then the generator automatically will add an explicit definition to the document element (xmlns:xml="http://www.w3.org/XML/1998/namespace"), which shouldn't happen. The fix seems to be as following. Change line 221 or thereabouts from: self._ns_contexts = [{}] # contains uri -> prefix dicts into this: # contains uri -> prefix dicts self._ns_contexts = [{'http://www.w3.org/XML/1998/namespace': 'xml'}] If this is deemed to be a good fix I can check this one in myself. I wonder though if there would be any other problems with 'xml:' in sax handlers I'm less familiar with (reading it in appears to work fine). Anyone? Regards, Martijn From faassen@vet.uu.nl Tue Mar 4 14:12:42 2003 From: faassen@vet.uu.nl (Martijn Faassen) Date: Tue, 4 Mar 2003 15:12:42 +0100 Subject: [XML-SIG] Re: Finding _xmlplus in Python 2.3a2 In-Reply-To: References: <20030302165929.GB17610@vet.uu.nl> <200303021114.59524.jeremy.kloth@fourthought.com> <20030302215513.GA18402@vet.uu.nl> <20030303103847.GB20110@vet.uu.nl> <002e01c2e192$769ef940$6401a8c0@tbp1> <20030303201239.GB21993@vet.uu.nl> Message-ID: <20030304141242.GB25744@vet.uu.nl> Martin v. L=F6wis wrote: > PyXML offers a great opportunity to hand out the code to users of the > xml package; it allows to correct problems more quickly than a Python > beta release cycle. I'd prefer if PyXML offered a great opportunity to hand out code to users of the pyxml package instead of overriding the core xml package.. If code is as much in flux as you describe it shouldn't have been distribute= d as part of the core library at all in my opinion. Regards, Martijn From faassen@vet.uu.nl Tue Mar 4 14:19:30 2003 From: faassen@vet.uu.nl (Martijn Faassen) Date: Tue, 4 Mar 2003 15:19:30 +0100 Subject: [XML-SIG] Re: Finding _xmlplus in Python 2.3a2 In-Reply-To: References: <20030302165929.GB17610@vet.uu.nl> <200303021114.59524.jeremy.kloth@fourthought.com> <20030302215513.GA18402@vet.uu.nl> <20030303103847.GB20110@vet.uu.nl> <002e01c2e192$769ef940$6401a8c0@tbp1> Message-ID: <20030304141930.GC25744@vet.uu.nl> Martin v. L=F6wis wrote: > "Thomas B. Passin" writes: >=20 > > I realize that we do not want to mix-and-match parts of the standard = library > > with parts of PyXML, and perhaps that is one of the main concerns tha= t > > Martin is expressing (Martin, is that right?). >=20 > I have a number of concerns, both maintainer issues, and user issues. >=20 > 1. Maintenance issues: >=20 > a) proposed change is unimplementable (more precisely: the > straight-forward implementation is incorrect) > Just renaming _xmlplus can't work: you get duplicate classes, in > particular exception classes; if you mix them, you get > surprising errors. Likewise, you get multiple .dom.Node classes, > which is evil. >=20 > b) proposed change creates an ongoing maintenance problem, because > of nearly-shared files. We already have this ongoing maintenance problem -- in practice now *user= s* of PyXML (though not the developers of PyXML) have to deal with the=20 consequences of having nearly identical but different files. In addition = it is not clear to users which set of files is actually in use. The solution (which I'm not claiming is straightforward) would be to get = rid=20 of this duplication entirely. > 2. User issues: > I'm concerned that proponents of "ditch _xmlplus" only see the > problems that this would solve, not the problems that this would > create. > a) Users have to change tons of code. > b) Users will be confused which of two nearly-identical libraries th= ey > should use. Therefore we should *get rid* of the situation where we have two nearly identical libraries. Users of PyXML/python xml package *already* are confused with two nearly identical libraries. I've tried to show that the _xmlhack does *not* make this invisible to users; in fact it makes it more confusing. I do consider a certain amount of pain to get rid of this in my opinion v= ery painful hack worth it, though. Regards, Martijn From martin@v.loewis.de Tue Mar 4 14:36:50 2003 From: martin@v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Tue, 04 Mar 2003 15:36:50 +0100 Subject: [XML-SIG] Re: Finding _xmlplus in Python 2.3a2 In-Reply-To: <20030304141242.GB25744@vet.uu.nl> References: <20030302165929.GB17610@vet.uu.nl> <200303021114.59524.jeremy.kloth@fourthought.com> <20030302215513.GA18402@vet.uu.nl> <20030303103847.GB20110@vet.uu.nl> <002e01c2e192$769ef940$6401a8c0@tbp1> <20030303201239.GB21993@vet.uu.nl> <20030304141242.GB25744@vet.uu.nl> Message-ID: <3E64BA02.9050706@v.loewis.de> Martijn Faassen wrote: > I'd prefer if PyXML offered a great opportunity to hand out code to users > of the pyxml package instead of overriding the core xml package.. If > code is as much in flux as you describe it shouldn't have been distributed > as part of the core library at all in my opinion. That might indeed be the case, but if you wait for perfection, you won't get any core XML libraries for quite a few more years. Marketing is what drove incorporation of XML libraries into Python 2.0, plus the libraries were significantly better than what was there (xmllib). It was only later that the problems we have since corrected had been discovered (e.g. that pulldom is quite inefficient for building a DOM; using expat was so much faster than anything else we had at the time). Regards, Martin From faassen@vet.uu.nl Tue Mar 4 14:44:03 2003 From: faassen@vet.uu.nl (Martijn Faassen) Date: Tue, 4 Mar 2003 15:44:03 +0100 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: <3E649B18.5040207@v.loewis.de> References: <20030304114936.GE24855@vet.uu.nl> <3E649B18.5040207@v.loewis.de> Message-ID: <20030304144403.GD25744@vet.uu.nl> "Martin v. L=F6wis" wrote: > Martijn Faassen wrote: > >Don't know about this one. Does this happen a lot, and what is the > >motivation? Is the use case like installing something in site-packages= but > >keeping the new modules in a separate location instead? >=20 > I believe only few packages ship with .pth files, which predate=20 > packages. AFAIK, Numerical Python uses that, to put stuff into=20 > site-packages/Numeric, and still have all modules inside Numeric appear= =20 > at the toplevel. All right. So let's not ship a .pth file with PyXML. :) > >>2. A module can install additional codecs, causing changes in > >> behaviour to unicode_string.encode(), and codecs.lookup(). > > > >Additional codecs is the key thing here. Can existing codecs get=20 > >overridden? >=20 > This is underspecified, and undocumented, but I believe you can, atleas= t=20 > by modifying the codecs aliases. Okay. I hope this is not a common practice as it would get really confusing (install a module and suddenly code that uses one codec elsewhere all breaks, ugh, though presumably the code elsewhere would still need to call a function register the new codec? in that case it's not as bad). > >Anyway, this is not installing a new version of source code, but > >plugging in data. >=20 > No. A codec is an algorithm, that performs some computation. Depending=20 > on whether certain codecs are installed, the very same Python program=20 > can behave differently on different machines. A codec does not introduce new API however, which I probably a more accur= ate description of what I was trying to get at. Also the codec algorithm=20 is as far as I understand follows a fairly uncomplicated interface (data in, data out), while PyXML provides a very extensive set of interfa= ces (which do frequently have benefit of being defined by standards at least). > >>3. A module can register things in copy_reg, causing changes in > >> behaviour to the pickle, cPickle, and copy modules. > > > >Sure, a module can add its own __add__ too causing changes in behavior > >in the core too. :) Does existing code commonly get *overridden* by th= is > >mechanism, or is it a mechanism to plug in more functionality?=20 >=20 > It is designed to plug in more functionality, just like _xmlplus is.=20 Are you sure this is equivalent? Does this system add new APIs? And it ad= ds=20 abilities for objects presumably defined by the installed package itself.= Does=20 installing that package suddenly change the behavior of *other* code on t= he system, commonly, without this code having asked for it? I can't think of examples (unless things like site.py get modified), but perhaps I'm missi= ng=20 them. > >And if something goes wrong, the offending module will be in the trace= back. >=20 > What is the offending module? The plugin, or the code using the plugin? The plugin, presumably. As well as the code using the plugin. :) > >If something goes wrong with PyXML, _xmlplus will be in the traceback > >and this is not very enlightening.=20 >=20 > I can't see the difference. If something goes wrong after replacing xml= =20 > with _xmlplus, both _xmlplus, and the offending code (usually its=20 > caller) will be in the traceback. Except that nobody is supposed to know what the heck _xmlplus is, where it comes from, and how it ended up in the 'xml' namespace, as it's an implementation detail. And it happens when I run client software installe= d in a completely separate way. So yes, I'll see _xmlplus in the traceback while I didn't before. But I don't believe that commonly happens with the other systems you sketched before. If you plug in code into the Python core so your own application will be able to use it, fine. If you plug in code into the Python core so that all sorts of applications suddenly start using it *without explicitl= y asking for it*, not fine. > > And if you hadn't installed PyXML > >_xmlplus won't be in the traceback, with the *same client code*. >=20 > Just like any other plugin: If you don't install the plugin, you don't=20 > see the plugin in the traceback (obviously). Give me examples of plugins in the Python core besides PyXML that change = the behavior of client code of core libraries that *don't* explicitly ask for such a thing to happen (by for instance importing from the modules that install the plugins). Give me examples of modules that when installe= d, will break code that never references that module explicitly, due to a bug or bugfix in the newly installed module. > >Yes, and people believe (if they reach this stage) that PyXML silently > >augments the 'xml' functionality with new features. Unfortunately it > >silently overrides all of its code instead.=20 >=20 > But it does augment, by overriding all code! The code it overrides is=20 > nearly-identical to the code it replaces, except for bug fixes. I've already pointed out that even bug fixes cause confusion and problems. You cannot shield users from having to know about the _xmlplus hack. > >I don't believe that in the cases you mention core Python APIs get ext= ended > >with new ones, either. >=20 > Defined "get extended". If I can't pass "big-5" to the builtin unicode=20 > function first, but can do so after installing a codec, I would say tha= t=20 > I have just extended the builtin unicode function. Add new classes and new functions to existing modules, and new methods to existing classes. I'm not talking about allowing existing APIs to=20 accept new arguments. Mind that I'm not arguing that such an architecture is always a bad idea. I would like to have a registry for Python XML software where I can ask for a DOM implementation or an XPath implementation and get one.=20 Indirection can be useful, especially if you have a clear set of interfac= es. An example in PyXML is how you can ask different engines to do the parsing for you (or the default one if you don't care). A difference with the current situation is that the user doesn't have to deal with near-ide= ntical code in two places (instead different implementations of the same functionality, each with its own tradeoffs), and that the user can be explicit as well if desired. Java as well as Zope 3 now define a tree of interfaces, and various implementations can claim to implement these interfaces. This type of thing is very useful, and I'd like more of that, as then I could more easily swap out one (say) xpath engine with another. > >Hmm...can we at least get a consensus that the current _xmlplus approa= ch i > >not ideal and can be confusin and that we should try to improve it if = we=20 > >can? >=20 > I can agree with that. Phew. So we at least end this posting on a positive note. :) Regards, Martijn From cz@gocept.com Tue Mar 4 14:48:45 2003 From: cz@gocept.com (Christian Zagrodnick) Date: Tue, 4 Mar 2003 15:48:45 +0100 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: <3E649B18.5040207@v.loewis.de> References: <20030304114936.GE24855@vet.uu.nl> <3E649B18.5040207@v.loewis.de> Message-ID: <20030304144845.GA27812@gocept.com> On Tue, Mar 04, 2003 at 01:24:56PM +0100, "Martin v. L=C3=B6wis" wrote: =20 > >And if something goes wrong, the offending module will be in the trace= back. >=20 > What is the offending module? The plugin, or the code using the plugin? >=20 > >If something goes wrong with PyXML, _xmlplus will be in the traceback > >and this is not very enlightening.=20 >=20 > I can't see the difference. If something goes wrong after replacing xml= =20 > with _xmlplus, both _xmlplus, and the offending code (usually its=20 > caller) will be in the traceback. I actually wondered what this _xmlplus might be. This did not make any sense to me. As xml was a core packate to me. As Martijn pointed out earlier the common user is not aware of that magic replcement. Now I am aware of it, but I'd still prefer a pyxml toplevel package. --=20 Christian Zagrodnick gocept gmbh & co. kg - schalaunische strasse 6 - 06366 koethen/anhalt fon. +49 3496 3099112, +49 179 1463644, +31 645 266224 fax. +49 3496 3099118 From faassen@vet.uu.nl Tue Mar 4 14:55:00 2003 From: faassen@vet.uu.nl (Martijn Faassen) Date: Tue, 4 Mar 2003 15:55:00 +0100 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: References: Message-ID: <20030304145459.GE25744@vet.uu.nl> Martin v. L=F6wis wrote: > John J Lee writes: >=20 > > > I bring up the bug reporting simply because I don't recall anyone r= eporting > > > that PyXML broke their Python installation until now. The cases yo= u mention > > > are abstract, but without concrete details, I cannot reply otherwis= e. > > [...] > >=20 > > That argument makes sense only when applied to a feature to be introd= uced > > in the future, in which case we can't know what effect it will have > > without considering concrete details. This discussion is about a fea= ture > > already introduced (the _xmlplus hack), which we *know* causes proble= ms > > (unless you don't believe your users). =20 >=20 > I think this is the case: We don't believe the users. What? Do you think I and others are arguing about this for fun or something? Could any other users please pipe in here? > I know Martijn > has coworkers who are confused by this (in the sense that they are > unaware of the entire issue, or have the wrong mental model). This, in > itself, is no problem: Everybody of us certainly is unaware of some > things, and has wrong mental models of other things. This setup positively *encourages* the development of a wrong mental model though. This causes the waste of time and energy. > The question is whether this has created real problems, in the sense > of wasted time and energy. Martijn has reported that it did, in the > case of using undocumented API for constructing nodes. I find this > example inconvincing, as the next Python release will make the same > change, and thus break this code even without PyXML being installed > I haven't heard any other practical examples of real problems caused > by the current setup. I've also mentioned the case of the developer being confused where his sax parser was coming from. Doing the obvious thing leads you to the wrong place; you go to the Python core library and look at the 'xml' pack= age there, and find a sax parser. After much frustration you find out that it is somewhere else entirely. Another example is looking for 'xpath', and while you find sax and all, you don't find it in the 'xml' package. How odd? Where is it? Developers do look at source code, but they are faced with a huge decoy in this situation if PyXML is installed. These *are* real problems. Regards, Martijn From mclay@nist.gov Tue Mar 4 16:33:00 2003 From: mclay@nist.gov (Michael McLay) Date: Tue, 4 Mar 2003 11:33:00 -0500 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: <20030304113704.GD24855@vet.uu.nl> References: <20030304113704.GD24855@vet.uu.nl> Message-ID: <200303041133.00175.mclay@nist.gov> On Tuesday 04 March 2003 06:37 am, Martijn Faassen wrote: > Martin v. L=F6wis wrote: > > Michael McLay writes: > > > It's getting down to the wire on the 2.3 release. Perhaps it would > > > be a good idea to raise the subject on python-dev. > > > > I don't think anything can or should be done in this respect. What > > precisely are you proposing (i.e. what specific changes to Python cor= e > > do you suggest?) > > I'd say, since the parsers and sax and minidom are already part of the > core distribution from a user's point of view, moving these components > into the core also for maintenance. The XML-SIG can still maintain > these and feed patches, but it wouldn't distribute it as part of > PyXML. If really really necessary the XML-SIG could even distribute > this as a *separate* package from PyXML that overrides the core 'xml' > stuff containing only upgrades of what is in the core, not new > functionality, but only if it's extremely clear that this is going to > happen to those who install it and developers. And I suspect that the > mentioned systems are mature enough not to need this anyway; bugfixes c= an > just go in Python bugfix releases. I agree. PyXML was set up to develope XML capabilities for Python. It was= my=20 understanding that as the packages matured they would be moved into the=20 standard distribution. A new release of Python is about to happen and if=20 there is work in PyXML that should be checked into the Python distributio= n,=20 then it needs to be done soon. From veillard@redhat.com Tue Mar 4 17:48:43 2003 From: veillard@redhat.com (Daniel Veillard) Date: Tue, 4 Mar 2003 12:48:43 -0500 Subject: [XML-SIG] xml namespace prefix and xml.sax.saxutils.XMLGenerator In-Reply-To: <20030304141032.GA25744@vet.uu.nl>; from faassen@vet.uu.nl on Tue, Mar 04, 2003 at 03:10:32PM +0100 References: <20030304141032.GA25744@vet.uu.nl> Message-ID: <20030304124843.Z13003@redhat.com> On Tue, Mar 04, 2003 at 03:10:32PM +0100, Martijn Faassen wrote: > The generator works fine for 'xmlns', but it doesn't seem to handle 'xml' > properly. What should be the case if I understand this right is that the > 'xml' namespace is always declared (and thus does not get a special > xmlns declaration). That's right. Daniel -- Daniel Veillard | Red Hat Network https://rhn.redhat.com/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ From jjl@pobox.com Tue Mar 4 18:33:02 2003 From: jjl@pobox.com (John J Lee) Date: Tue, 4 Mar 2003 18:33:02 +0000 (GMT) Subject: [XML-SIG] xml to pdf... a newbie question... In-Reply-To: <1046767081.3e6465e9943fd@mbox.slu.edu.ph> Message-ID: On Tue, 4 Mar 2003 rmangaliag@slu.edu.ph wrote: [in response to suggestion to use reportab] > thanks... i'm currently downloading it now... > > how about if i choose to present the reports in postscript??? [...] Erm, reportlab? I haven't tested the postscript output, but apparently it's there (in the standard reportlab package): http://www.reportlab.com/rl_addons.html That link also says there's a PIL renderer for reportlab, which would allow output in any format. Another couple of possibilities: sketch is an interactive vector graphics editor written in Python & C: http://sketch.sourceforge.net/ PIDDLE is similar to reportlab, with a simpler and less capable API, but with more backends (so you can output to all kinds of other formats): http://piddle.sourceforge.net/ I'm sure there are other options, too. Sorry, this is a bit offtopic now... John From mark@easymailings.com Wed Mar 5 03:13:11 2003 From: mark@easymailings.com (Mark Bucciarelli) Date: Tue, 4 Mar 2003 22:13:11 -0500 Subject: [XML-SIG] [OT] Python Coding Standards Message-ID: <200303042213.11225.mark@easymailings.com> --Boundary-00=_HtWZ+vlI32RDnU0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline This came across Mitch Kapor's dev list. Looked pretty well done, thought I would share it. Mark --Boundary-00=_HtWZ+vlI32RDnU0 Content-Type: message/rfc822; name="forwarded message" Content-Transfer-Encoding: 8bit Content-Description: David Jeske : [Dev] Python Coding Standards Return-Path: Delivered-To: mark@hubcapconsulting.com Received: (qmail 8320 invoked by uid 7794); 5 Mar 2003 02:32:38 -0000 Received: from dev-admin@osafoundation.org by mail.zoper.com by uid 89 with qmail-scanner-1.15 (clamscan: 0.53. spamassassin: 2.43. Clear:SA:0(-2.5/5.0):. Processed in 5.782846 secs); 05 Mar 2003 02:32:38 -0000 Received: from unknown (HELO aloha.osafoundation.org) (64.39.15.120) by 0 with DES-CBC3-SHA encrypted SMTP; 5 Mar 2003 02:32:32 -0000 Received: from aloha.osafound.org (localhost [127.0.0.1]) by aloha.osafoundation.org (8.12.8/8.12.7) with ESMTP id h252SfF9011543; Tue, 4 Mar 2003 20:28:41 -0600 Received: from mozart.chat.net (cb4.neotonic.com [66.7.159.72]) by aloha.osafoundation.org (8.12.8/8.12.7) with SMTP id h252RqF9011522 for ; Tue, 4 Mar 2003 20:27:53 -0600 Received: (qmail 26662 invoked by uid 120); 5 Mar 2003 02:27:52 -0000 From: David Jeske To: dev@osafoundation.org Message-ID: <20030304182752.S12706@mozart> Mail-Followup-To: dev@osafoundation.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre3i X-Scanned-By: MIMEDefang 2.29 (www . roaringpenguin . com / mimedefang) Subject: [Dev] Python Coding Standards Sender: dev-admin@osafoundation.org Errors-To: dev-admin@osafoundation.org X-BeenThere: dev@osafoundation.org X-Mailman-Version: 2.0.13 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Developer Discussions List-Unsubscribe: , List-Archive: Date: Tue, 4 Mar 2003 18:27:52 -0800 X-Spam-Status: No, hits=-2.5 required=5.0 tests=KNOWN_MAILING_LIST,QUOTED_EMAIL_TEXT, SIGNATURE_SHORT_SPARSE,SPAM_PHRASE_01_02 version=2.43 X-Spam-Level: Status: R X-Status: N X-KMail-EncryptionState: X-KMail-SignatureState: It took me a while to get someone still at Yahoo to find the original document for me. Here it is, and I've added some comments about the motivations behind the conventions. I apologize for its length, but this is all really useful stuff. > Python Coding Standards > > Authors: David W. Jeske, Brandon C. Long > > This document defines the eGroups Python coding conventions moving > forward. It is based on previous standards, but clears up a few areas of > confusion. > > Rules > > Naming > > * Don't use acronyms. Spell things ouw when possible. (ex > VoiceChatPage.py, not VCPage.py) Without compile-time static errors, getting names right becomes much more important. Therefore we used long-ish names and quasi-symbol completion (available in the Python emacs mode) to help avoid using the wrong class/variable/method names. > * Global variables should begin with a "g", example: gUserServerPort > * Constants should begin with a "k", example: kYes > * Class names start with a capital letter and capitalize each word. > example: FooBarCom > > General > > * Don't create "double maintaniance", see special section below! This seems like just good programming practice, but it's much more important in Python where forgetting to do step 2 of 5 in adding something won't be a compile error. > * Don't make extraneous protcols/classes. Do your homework. Find out if > something similar already exists first. One consistant (sub-optimal) > way is better than five perfect ways. Fewer classes is better > * Don't generalize too early. Code is easier to read if it only calls > well-known functions or local-functions. If you have found only two > unrelated parts of the system which want to use the same code snippit, > it may be better off leaving that code snippit in both places. > * A code snippit should only be reused if it is in one of the > "library" portions of the system. (i.e. don't import a web-page > to reuse it's code) > * A code snippit should be in a library portion of the system only > if either (a) it is used in many of different places in the > software, (b) the behavior of the different places should > DEFINETLY be coupled (i.e. when you change the shared code it > should change in both places). While another good general rule, because it's really really hard to track dependencies in Python, this becomes much more important for code stability. > * Don't put code in a class which does not need the class data. (i.e. it > should be a function somewhere!) > * Keep "public" APIs simple. Document them as such. Be sure to document > the _intent_ of the API. If you don't, someone will read the code and > make assumptions based on the current implementation. > * If you change what a functions or method's intent is, CHANGE ITS NAME! This turned out to be one of the most important rules. It turned into: * If you must add required arguments to a function either (a) change it's name, or better still (b) make a new named function and leave the old one. Even with unit testing, it's really hard to track dependencies like this. We would need code coverage tools and exhaustive tests, neither of which we had. > * In the "new world order" we want one class per file inside a proper > package directory. We originally had lots of files in a single directory, with each file itself being a module. However, one file is just not enough for expanding functionality, so we moved to (roughly) one file per class, and making different directories for different packages. We tried to use the Python "package directory" support but it turned out to be somewhat problematic to reorganize. Because there is no static compile, hunting down all the places which referenced something from its old location was not always easy. In my more recent Python projects we use a more "c-like" model. We have several directories for different functions, but we don't use the "package naming", instead we just put all the paths in the classpath. This allows us to expand a single file module into many files and eventually move it into its own directory without affecting any existing code. > Lists > > * Lists should always be items of the same type. > * Position information in lists should not matter. This is really important. In fact, today I would add: * Only use tuples locally. Do not pass them around. Tracking dependencies between the places that use something and the places that pack something is hard. This is the same fragility that exists in lots of LISP software. > Dictionaries > > * Avoid using dictionaries as structures. If you have a pre-defined set > of attributes, use a class and access them like attributes. In other > words, qualifiers for dictionaries should almost always be variables, > not constants. In general, you should probably: > > Do this: an_object.name > Not this: a_dict["name"] > > Do this: a_dict[a_key] > Not this: value = getattr(an_object,a_key) This more sensibly works with command completion as well. Using strings as symbols is evil. > Objects/Classes > > * Private (most) instance variables should start with an underscore. While this is worded badly, it's trying to say that most instance variables should be private and all private variables should start with an underscore. (i.e. when in doubt make it private) > * All eGroups API methods should use the eGroups naming convention > described below > * Avoid accessing private instance data directly from outside an object > * Methods (and functions) should always return items of the same type. > (i.e. do not return a tuple in one case, and a number in another) This is also really important. This means that we also did NOT ever return "None" as a NULL pointer value for a failure case. It's just too hard to track down these problems in Python, so we always throw custom exceptions for failure cases. > * Keyword arguments should always be optional. If the argument is > required, make it a non-keyword argument, and put the argument name > into the method name by using our method naming convention. > > Exceptions > > * Always include the module and class name in an error declaration. > * Avoid try/except blocks for a dictionary, use .has_key() or get(,) > instead. > * ANY time you have an unqualified "except:" clause, you must report the > error with the handleexception module. Like this: > > try: > # do something > except: > import handleexception > handleexception.HandleException() handleexception was a standard module which grabbed a stack backtrace and reported that the error occured. This allowed us to track down these "global exceptions" that really shouldn't happen. If something happens alot, it should get a custom exception handler. We also built a really nice tool which cataloged all these exceptions which occured on the running code for any process in the website service so we could browse through the real exception state and arguments. I would also add: * Code should be designed to fail earlier rather than later * Classes should be as "stateless" as possible. To achieve this a class should be usable immediately after construction, and work functions should take optional arguments instead of requiring you to call state-change methods. We had some troublesome code conceptually similar to this: foo = SomeClass() foo.setState_(bar) foo.setOtherState_(baz) foo.doWork() As the complexity increases, it becomes hard to figure out what you must set to make the class "usable", and it was hard to tell the difference between what was state of making the class "useful" vs. "doing the work". This code above should be: foo = SomeClass(bar) # bar required to make the class "useful" foo.doWork(otherState=baz) # baz is an optional work paramater ---- The method naming convention below was used for most "public" parts of our library api. Along with the simple emacs Python symbol completion, this really helped make the APIs easy to use. It is sort of the poor-man's dynamic typed version of Intellisense. > Method Naming > > Public method names should: > 1) start with a lower-case letter > 2) upper-case the first letter of each word > 3) include a description of the required arguments it takes, each > followed by an underscore. > > Here are some examples: > > def charset_(self, o) ## takes one argument, the charset, in MessagePage.py > > def getPodForGroup_(self,groupname) ## takes one argument, the "Group", in DataCluster.py > > def getSubsForUser_(self,username) ## takes one argument, the "User", in userserv.py > > > This is inspired by the Objective-C "descriptive" method syntax: > > [object method: arg1 withName1: arg2 withName2: arg3]; > > Where you get things like: > > [object getPodForGroup: "stevestest" andUser: "jeske@chat.net"] > > Which is a hell of alot more understandable than the C/C++ ish: > > object->getPod("stevestest","jeske@chat.net") (i.e. when you can't look up the symbol easily) > In the following lisp-esq funtion, there is less strong a > relationship between the name and the arguments: > > object.get-pod-group-user("stevestest","jeske@chat.net") > > (i.e. the above could mean any of: > > object.getPodForGroup_andUser_("stevestest","jeske@chat.net") > object.getUser_inGroup_onPod_("jeske@chat.net","stevestest",1) > object.getGroupsforUser_onPod_("jeske@chat.net",1) > > ) -- David Jeske (N9LCA) + http://www.chat.net/~jeske/ + jeske@chat.net _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Open Source Applications Foundation "Dev" mailing list http://lists.osafoundation.org/mailman/listinfo/dev --Boundary-00=_HtWZ+vlI32RDnU0-- From jjl@pobox.com Wed Mar 5 13:43:56 2003 From: jjl@pobox.com (John J Lee) Date: Wed, 5 Mar 2003 13:43:56 +0000 (GMT) Subject: [XML-SIG] [OT] Python Coding Standards In-Reply-To: <200303042213.11225.mark@easymailings.com> Message-ID: On Tue, 4 Mar 2003, Mark Bucciarelli wrote: > This came across Mitch Kapor's dev list. Looked pretty well done, thought I > would share it. LOL. Spam about the best way to write spamming software (albeit of the dead-tree variety, looking at http://www.easymailings.com/). Actually, I can't decide whether this is spam, not-spam or both-at-once... Mark: Why not post to comp.lang.python instead? I wouldn't be surprised if it generated a vigorous discussion, though I doubt many Pythonistas will agree with your prescriptions. John From mark@easymailings.com Wed Mar 5 15:05:39 2003 From: mark@easymailings.com (Mark Bucciarelli) Date: Wed, 5 Mar 2003 10:05:39 -0500 Subject: [XML-SIG] [OT] Python Coding Standards In-Reply-To: References: Message-ID: <200303051005.39565.mark@easymailings.com> On Wednesday 05 March 2003 8:43 am, John J Lee wrote: > On Tue, 4 Mar 2003, Mark Bucciarelli wrote: > > This came across Mitch Kapor's dev list. Looked pretty well done, > > thought I would share it. > > LOL. Spam about the best way to write spamming software (albeit of the > dead-tree variety, looking at http://www.easymailings.com/). Actually, I > can't decide whether this is spam, not-spam or both-at-once... Geez, I marked it as off topic. Didn't mean it as spam, meant it as a discussion piece. I thought there were some interesting points. [BTW--not all bulk mailings are spam! Some small non-profits with opt-in lists actually appreciate the Free Software I wrote--saves them stress, time and money. If you have ever done a bulk mailing, you know what I am talking about.] > Mark: Why not post to comp.lang.python instead? I wouldn't be surprised > if it generated a vigorous discussion, though I doubt many Pythonistas > will agree with your prescriptions. I'll pass. Burned once, twice shy. They are not my prescriptions anyway, I think they come via the folks that wrote eGroups at Yahoo! Mark. From mclay@nist.gov Wed Mar 5 16:02:22 2003 From: mclay@nist.gov (Michael McLay) Date: Wed, 5 Mar 2003 11:02:22 -0500 Subject: [XML-SIG] [OT] Python Coding Standards In-Reply-To: References: Message-ID: <200303051102.22306.mclay@nist.gov> On Wednesday 05 March 2003 08:43 am, John J Lee wrote: > On Tue, 4 Mar 2003, Mark Bucciarelli wrote: > > This came across Mitch Kapor's dev list. Looked pretty well done, > > thought I would share it. > > LOL. Spam about the best way to write spamming software (albeit of the > dead-tree variety, looking at http://www.easymailings.com/). Actually, I > can't decide whether this is spam, not-spam or both-at-once... Please play nice and keep the tone civil. The comment about his email address was unnecessary. If you didn't think the content he was sharing was appropriate for the list then politely suggesting an appropriate mailing list is all that needs to said. The forwarded message is about improving software written in Python. This mailing list is for discussion of software written in Python. It may be off topic but it isn't spam. Spam would include something about helping a General get money out of a country in Africa or a fast method to get rich. The subject of the message was a Python style guide used at eGroups. There is nothing about spam tools in the document, and eGroups is not a spam tool. eGroups is a mailing list archival service. The Python community has used it on a number of projects and it is yet another example of a useful large scale application that was written in Python. > Mark: Why not post to comp.lang.python instead? I wouldn't be surprised > if it generated a vigorous discussion, though I doubt many Pythonistas > will agree with your prescriptions. What do you mean by his "prescriptions"? The style guide provided some sensible suggestions about how to write code that is maintainable. Perhaps the eGroups style guide should be compared to Guido's Style Guide for Python Code [1] to see if there are some new ideas that should be added to the PEP. [1] http://www.python.org/peps/pep-0008.html From jjl@pobox.com Wed Mar 5 21:03:45 2003 From: jjl@pobox.com (John J Lee) Date: Wed, 5 Mar 2003 21:03:45 +0000 (GMT) Subject: [XML-SIG] [OT] Python Coding Standards In-Reply-To: <200303051102.22306.mclay@nist.gov> Message-ID: On Wed, 5 Mar 2003, Michael McLay wrote: > On Wednesday 05 March 2003 08:43 am, John J Lee wrote: > > On Tue, 4 Mar 2003, Mark Bucciarelli wrote: > > > This came across Mitch Kapor's dev list. Looked pretty well done, > > > thought I would share it. > > > > LOL. Spam about the best way to write spamming software (albeit of the > > dead-tree variety, looking at http://www.easymailings.com/). Actually, I > > can't decide whether this is spam, not-spam or both-at-once... > > Please play nice and keep the tone civil. Oh, sorry -- no incivility intended. It just struck me as funny that someone writing mass-mailing software knowingly wrote an off-topic message here. Would be unwise of me to be harsh about it, since I just posted two offtopic messages myself (including this one)... > The comment about his email address was unnecessary. I'm confused. That was the whole point! > If you didn't think the content he was sharing was appropriate for the > list then politely suggesting an appropriate mailing list is all that > needs to said. Well, I did do that, in addition to poking fun at Mark. I guess I forgot the ;-) [...] > It may be off topic but it isn't spam. [...] No, that's true, you're right. > The subject of the message was a Python style guide used at eGroups. There is > nothing about spam tools in the document, and eGroups is not a spam tool. Oh, I see. I wasn't referring to eGroups, I was referring to easymailings.com, for whom, I assume, Mark works. Mark added some comments to the eGroups stuff (unless I misread the quoting...). > > Mark: Why not post to comp.lang.python instead? I wouldn't be surprised > > if it generated a vigorous discussion, though I doubt many Pythonistas > > will agree with your prescriptions. > > What do you mean by his "prescriptions"? The style guide provided some Gee, I just meant 'prescriptions'. I can see how you'd read some harshness into my phrasing though -- sorry, none intended! Now, I'll shut up and let this list get on with on-topic stuff. John From jasj@miller.cs.uwm.edu Wed Mar 5 21:47:57 2003 From: jasj@miller.cs.uwm.edu (Jason Michael Jurkowski) Date: Wed, 5 Mar 2003 15:47:57 -0600 (CST) Subject: [XML-SIG] broken install of PyXML-0.8.2 on darwin Message-ID: i experienced a broken install of PyXML-0.8.2 on darwin. the following details two minor changes I made to setup.py to 'fix' the install. changed line 11 to: from distutils.sysconfig import get_config_var changed line 59 to: get_config_var("LDSHARED").find("-flat_namespace") == -1: jason From bill@rfa.org Thu Mar 6 00:02:27 2003 From: bill@rfa.org (Bill Eldridge) Date: Wed, 05 Mar 2003 19:02:27 -0500 Subject: [XML-SIG] xml to pdf... a newbie question... In-Reply-To: <1046767081.3e6465e9943fd@mbox.slu.edu.ph> References: <1046767081.3e6465e9943fd@mbox.slu.edu.ph> Message-ID: <3E669013.8080501@rfa.org> --------------050501010204000906040104 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit I found "htmldoc" much simpler than ReportLab and more in line with what I needed. rmangaliag@slu.edu.ph wrote: >thanks... i'm currently downloading it now... > >how about if i choose to present the reports in postscript??? > >is there a python application that can change xml/xsl to postscript??? > >tnx again... >:) > > > >>a friend showed me fop of java which is capable of creating >>pdf files using >>xml/xsl... >> >>do we have a python program/application that can do the same... >> >>i am about to start a web-based project here in our school >>that will require >>reports in pdf format, i want to use zope and wondering if >>and when i access a >>database and return an xml version of it, i could change it to pdf... >> >> >> >Unfortunately I haven't seen a FO processor written in Python yet, but >there's another possible solution for you: a free library called ReportLab >for PDF creation with Python. > >It does'nt use XML/XSLT and FO but that probably doesn't matter for your >project, on the contrary: ReportLab was especially designed for generation >of PDF documents in real time from any data source on web servers. Here you >can find it: http://www.reportlab.com/ > >Regards >Gisbert Amm >------------------------------------------------- > Email Service Provided by SLU-Net >Saint Louis University ( http://www.slu.edu.ph ) >------------------------------------------------- > >_______________________________________________ >XML-SIG maillist - XML-SIG@python.org >http://mail.python.org/mailman/listinfo/xml-sig > > --------------050501010204000906040104 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit
I found "htmldoc" much simpler than ReportLab and
more in line with what I needed.

rmangaliag@slu.edu.ph wrote:
thanks... i'm currently downloading it now...

how about if i choose to present the reports in postscript???

is there a python application that can change xml/xsl to postscript???

tnx again...
:)

  
a friend showed me fop of java which is capable of creating 
pdf files using 
xml/xsl...

do we have a python program/application that can do the same...

i am about to start a web-based project here in our school 
that will require 
reports in pdf format, i want to use zope and wondering if 
and when i access a 
database and return an xml version of it, i could change it to pdf...

    
Unfortunately I haven't seen a FO processor written in Python yet, but
there's another possible solution for you: a free library called ReportLab
for PDF creation with Python.

It does'nt use XML/XSLT and FO but that probably doesn't matter for your
project, on the contrary: ReportLab was especially designed for generation
of PDF documents in real time from any data source on web servers. Here you
can find it: http://www.reportlab.com/

Regards
Gisbert Amm
-------------------------------------------------
      Email Service Provided by SLU-Net
Saint Louis University ( http://www.slu.edu.ph )
-------------------------------------------------

_______________________________________________
XML-SIG maillist  -  XML-SIG@python.org
http://mail.python.org/mailman/listinfo/xml-sig
  

--------------050501010204000906040104-- From martin@v.loewis.de Thu Mar 6 06:26:40 2003 From: martin@v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Thu, 06 Mar 2003 07:26:40 +0100 Subject: [XML-SIG] broken install of PyXML-0.8.2 on darwin In-Reply-To: References: Message-ID: <3E66EA20.2070500@v.loewis.de> Jason Michael Jurkowski wrote: > i experienced a broken install of PyXML-0.8.2 on darwin. the following > details two minor changes I made to setup.py to 'fix' the install. > > changed line 11 to: > from distutils.sysconfig import get_config_var > > changed line 59 to: > get_config_var("LDSHARED").find("-flat_namespace") == -1: It's relatively unlikely that I implement that change. For every PyXML release for the last two years, somebody said that it won't work on Darwin, and proposed a change to make it work. I implemented that change, and then in the next release, somebody else said that the previous solution doesn't work, and proposed something else. So unless I get a specific patch with elaboration why a certain setup is the right thing, and an email address I can put into setup.py, I'm unwilling to make any changes I cannot test. Regards, Martin From rmangaliag@slu.edu.ph Thu Mar 6 07:08:03 2003 From: rmangaliag@slu.edu.ph (rmangaliag@slu.edu.ph) Date: Thu, 6 Mar 2003 15:08:03 +0800 Subject: [XML-SIG] xml to pdf... a newbie question... Message-ID: <1046934483.3e66f3d36ac3c@mbox.slu.edu.ph> how can i generate pdf with htmldoc??? or did i get the message right? -------------------------------------- I found "htmldoc" much simpler than ReportLab and more in line with what I needed. rmangaliag@slu.edu.ph wrote: thanks... i'm currently downloading it now... how about if i choose to present the reports in postscript??? is there a python application that can change xml/xsl to postscript??? tnx again... :) a friend showed me fop of java which is capable of creating pdf files using xml/xsl... do we have a python program/application that can do the same... i am about to start a web-based project here in our school that will require reports in pdf format, i want to use zope and wondering if and when i access a database and return an xml version of it, i could change it to pdf... Unfortunately I haven't seen a FO processor written in Python yet, but there's another possible solution for you: a free library called ReportLab for PDF creation with Python. It does'nt use XML/XSLT and FO but that probably doesn't matter for your project, on the contrary: ReportLab was especially designed for generation of PDF documents in real time from any data source on web servers. Here you can find it: http://www.reportlab.com/ Regards Gisbert Amm ------------------------------------------------- Email Service Provided by SLU-Net Saint Louis University ( http://www.slu.edu.ph ) ------------------------------------------------- _______________________________________________ XML-SIG maillist - XML-SIG@python.org http://mail.python.org/mailman/listinfo/xml-sig ------------------------------------------------- Email Service Provided by SLU-Net Saint Louis University ( http://www.slu.edu.ph ) ------------------------------------------------- From gia@webde-ag.de Thu Mar 6 07:47:35 2003 From: gia@webde-ag.de (Gisbert Amm) Date: Thu, 6 Mar 2003 08:47:35 +0100 Subject: [XML-SIG] xml to pdf... a newbie question... Message-ID: <74ADFA8C453ED611A71E00508BBBA135D9E87B@exchange1.cinetic.de> > how can i generate pdf with htmldoc??? > or did i get the message right? > > > -------------------------------------- > > I found "htmldoc" much simpler than ReportLab and > more in line with what I needed. > You need at first to generate HTML. That you can feed to htmldoc which outputs pretty nice PDF (see for instance the Dive into Python Book by Mark Pilgrim - http://diveintopython.org/). htmldoc you can find here: http://www.easysw.com/htmldoc/ With htmldoc you're fixed to HTML output as the first target. But you can get Postscript OTH. For future maintainability, I'd first write out XML anyway (DocBook, preferrably), transform it with XSLT to HTML and then feed it to htmldoc. It's a completely different approach than with ReportLab - you can potentially output whatever format you want. If you want to keep it very simple, you could of course write out HTML. However, if I had to do the task, I'd never do this anymore. Regards Gisbert From rmangaliag@slu.edu.ph Thu Mar 6 08:09:52 2003 From: rmangaliag@slu.edu.ph (rmangaliag@slu.edu.ph) Date: Thu, 6 Mar 2003 16:09:52 +0800 Subject: [XML-SIG] xml to pdf... a newbie question... Message-ID: <1046938192.3e670250b9714@mbox.slu.edu.ph> thanks... but one last question... can that happen on the server, for example, in one operation??? what i mean is, can a user, through zope, get a pdf report generated by python through xml to html to htmldoc... that will result to pdf??? or even post script??? thanks... you've been so helpful guys... ----- Original Message ----- From: "Gisbert Amm" To: ; Sent: Thursday, March 06, 2003 3:47 PM Subject: RE: [XML-SIG] xml to pdf... a newbie question... > > how can i generate pdf with htmldoc??? > > or did i get the message right? > > > > > > -------------------------------------- > > > > I found "htmldoc" much simpler than ReportLab and > > more in line with what I needed. > > > You need at first to generate HTML. That you can feed to htmldoc which > outputs pretty nice PDF (see for instance the Dive into Python Book by Mark > Pilgrim - http://diveintopython.org/). > > htmldoc you can find here: http://www.easysw.com/htmldoc/ > > With htmldoc you're fixed to HTML output as the first target. But you can > get Postscript OTH. > > For future maintainability, I'd first write out XML anyway (DocBook, > preferrably), transform it with XSLT to HTML and then feed it to htmldoc. > It's a completely different approach than with ReportLab - you can > potentially output whatever format you want. > > If you want to keep it very simple, you could of course write out HTML. > However, if I had to do the task, I'd never do this anymore. > > Regards > Gisbert ------------------------------------------------- Email Service Provided by SLU-Net Saint Louis University ( http://www.slu.edu.ph ) ------------------------------------------------- From gia@webde-ag.de Thu Mar 6 08:27:14 2003 From: gia@webde-ag.de (Gisbert Amm) Date: Thu, 6 Mar 2003 09:27:14 +0100 Subject: [XML-SIG] xml to pdf... a newbie question... Message-ID: <74ADFA8C453ED611A71E00508BBBA135D9E87C@exchange1.cinetic.de> > thanks... but one last question... > > can that happen on the server, for example, in one operation??? > > what i mean is, can a user, through zope, get a pdf report > generated by python > through xml to html to htmldoc... that will result to pdf??? > or even post > script??? In this case it would be better to left out the step via XML and sacrifice maintainablity at this point for the benefit of performance. That means: generate HTML, call htmldoc with that HTML and transfer the resulting PDF to the user. For not so big documents and not so much requests that should work. Unfortunately you have to invoke htmldoc with a system call, there is no API available (see http://www.easysw.com/htmldoc/htmldoc.html) For a high number of requests or larger documents I'd keep a solution with ReportLab in mind. BTW: We are fairly OT with this thread, aren't we? ;-) Regards Gisbert From webmaster@pferdemarkt.ws Thu Mar 6 14:18:36 2003 From: webmaster@pferdemarkt.ws (webmaster@pferdemarkt.ws) Date: Thu, 6 Mar 2003 06:18:36 -0800 Subject: [XML-SIG] Pferdemarkt.ws informiert! Newsletter 03/2003 http://www.pferdemarkt.ws Message-ID: <200303061418.GAA28634@eagle.he.net> http://www.pferdemarkt.ws Wir sind in 2003 erfolgreich in des neue \"Pferdejahr 2003 gestartet. Für den schnellen Erfolg unseres Marktes möchten wir uns bei Ihnen bedanken. Heute am 06.03.2003 sind wir gut 2 Monate Online! Täglich wächst unsere Datenbank um 30 Neue Angebote. Stellen auch Sie als Privatperson Ihre zu verkaufenden Pferde direkt und vollkommen kostenlos ins Internet. Zur besseren Sichtbarmachung Ihrer Angebote können Sie bis zu ein Bild zu Ihrer Pferdeanzeige kostenlos einstellen! Wollen Sie direkt auf die erste Seite, dann können wir Ihnen unser Bonussystem empfehlen. klicken Sie hier: http://www.pferdemarkt.ws/bestellung.html Ihr http://Pferdemarkt.ws Team Klicken Sie hier um sich direkt einzuloggen http://www.Pferdemarkt.ws Kostenlos Anbieten, Kostenlos Suchen! Direkt von Privat zu Privat! Haben Sie noch Fragen mailto: webmaster@pferdemarkt.ws From Martina@Oefelein.de Thu Mar 6 21:07:58 2003 From: Martina@Oefelein.de (Martina Oefelein) Date: Thu, 6 Mar 2003 22:07:58 +0100 Subject: [XML-SIG] broken install of PyXML-0.8.2 on darwin In-Reply-To: <3E66EA20.2070500@v.loewis.de> Message-ID: Hi Martin > It's relatively unlikely that I implement that change. For every PyXML > release for the last two years, somebody said that it won't work on > Darwin, and proposed a change to make it work. I implemented that > change, and then in the next release, somebody else said that the > previous solution doesn't work, and proposed something else. > > So unless I get a specific patch with elaboration why a certain setup > is the right thing, and an email address I can put into setup.py, I'm > unwilling to make any changes I cannot test. OK, so I'll elaborate: When trying to run setup.py, you get this error: [iBook:~/Desktop/PyXML-0.8.2] martina% python setup.py build Traceback (most recent call last): File "setup.py", line 58, in ? if sys.platform[:6] == "darwin" and \ NameError: name 'distutils' is not defined [iBook:~/Desktop/PyXML-0.8.2] martina% The offending code is: if sys.platform[:6] == "darwin" and \ distutils.sysconfig.get_config_var("LDSHARED").find("-flat_namespace") == -1: # Mac OS X LDFLAGS.append('-flat_namespace') This fails due to two trivial and obvious errors: (a) there is no "import distutils", instead in line 11: from distutils.sysconfig import get_config_vars (b) the wrong function is imported (get_config_vars instead of get_config_var). The proposed patch fixes both (a) and (b). After this patch it builds, albeit with a bunch of warnings (tested with the original Apple python on MacOS X 10.2.4) ciao Martina From Martina@Oefelein.de Thu Mar 6 21:29:13 2003 From: Martina@Oefelein.de (Martina Oefelein) Date: Thu, 6 Mar 2003 22:29:13 +0100 Subject: [XML-SIG] broken install of PyXML-0.8.2 on darwin In-Reply-To: Message-ID: Hi Martin, > After this patch it builds, albeit with a bunch of warnings For the warnings see the build log below, essentially there are only 2 issues: 1. From expat: `regparm' attribute directive ignored 2. Warnings about not matching architecture i386. This is not pyxml-specific, it happens with many other projects, too. It's due to the "-arch i386 -arch ppc" on the ggc command line. The pyobjc people have a hack to remove this: if sys.platform == 'darwin': # Apple has used build options that don't work with a 'normal' system. # Remove '-arch i386' from the LDFLAGS. import distutils.sysconfig distutils.sysconfig.get_config_vars() x = distutils.sysconfig._config_vars['LDSHARED'] y = x.replace('-arch i386', '') if y != x: print "Fixing Apple strangeness in Python configuration" distutils.sysconfig._config_vars['LDSHARED'] = y However, the i386 specification is of course needed for Darwin on Intel. Therefore I don't recommend that you apply this patch "as is". ciao Martina ---- [iBook:~/Desktop/PyXML-0.8.2] martina% python setup.py build running build running build_py creating build creating build/lib.darwin-6.4-Power Macintosh-2.2 creating build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus copying xml/__init__.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus copying xml/FtCore.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus copying xml/ns.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus creating build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom copying xml/dom/__init__.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom copying xml/dom/Attr.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom copying xml/dom/CDATASection.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom copying xml/dom/CharacterData.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom copying xml/dom/Comment.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom copying xml/dom/Document.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom copying xml/dom/DocumentFragment.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom copying xml/dom/DocumentType.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom copying xml/dom/DOMImplementation.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom copying xml/dom/domreg.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom copying xml/dom/Element.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom copying xml/dom/Entity.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom copying xml/dom/EntityReference.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom copying xml/dom/Event.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom copying xml/dom/expatbuilder.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom copying xml/dom/FtNode.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom copying xml/dom/javadom.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom copying xml/dom/MessageSource.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom copying xml/dom/minicompat.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom copying xml/dom/minidom.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom copying xml/dom/minitraversal.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom copying xml/dom/NamedNodeMap.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom copying xml/dom/NodeFilter.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom copying xml/dom/NodeIterator.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom copying xml/dom/NodeList.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom copying xml/dom/Notation.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom copying xml/dom/ProcessingInstruction.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom copying xml/dom/pulldom.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom copying xml/dom/Range.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom copying xml/dom/Text.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom copying xml/dom/TreeWalker.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom copying xml/dom/xmlbuilder.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom creating build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/__init__.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/GenerateHtml.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLAnchorElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLAppletElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLAreaElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLBaseElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLBaseFontElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLBodyElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLBRElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLButtonElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLCollection.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLDirectoryElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLDivElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLDListElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLDocument.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLDOMImplementation.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLFieldSetElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLFontElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLFormElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLFrameElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLFrameSetElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLHeadElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLHeadingElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLHRElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLHtmlElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLIFrameElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLImageElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLInputElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLIsIndexElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLLabelElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLLegendElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLLIElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLLinkElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLMapElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLMenuElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLMetaElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLModElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLObjectElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLOListElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLOptGroupElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLOptionElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLParagraphElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLParamElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLPreElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLQuoteElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLScriptElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLSelectElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLStyleElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLTableCaptionElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLTableCellElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLTableColElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLTableElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLTableRowElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLTableSectionElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLTextAreaElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLTitleElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html copying xml/dom/html/HTMLUListElement.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/html creating build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/ext copying xml/dom/ext/__init__.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/ext copying xml/dom/ext/c14n.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/ext copying xml/dom/ext/Dom2Sax.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/ext copying xml/dom/ext/Printer.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/ext copying xml/dom/ext/Visitor.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/ext copying xml/dom/ext/XHtml2HtmlPrinter.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/ext copying xml/dom/ext/XHtmlPrinter.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/ext creating build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/ext/reader copying xml/dom/ext/reader/__init__.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/ext/reader copying xml/dom/ext/reader/HtmlLib.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/ext/reader copying xml/dom/ext/reader/HtmlSax.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/ext/reader copying xml/dom/ext/reader/PyExpat.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/ext/reader copying xml/dom/ext/reader/Sax.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/ext/reader copying xml/dom/ext/reader/Sax2.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/ext/reader copying xml/dom/ext/reader/Sax2Lib.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/ext/reader copying xml/dom/ext/reader/Sgmlop.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/dom/ext/reader creating build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/marshal copying xml/marshal/__init__.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/marshal copying xml/marshal/generic.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/marshal copying xml/marshal/wddx.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/marshal creating build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/unicode copying xml/unicode/__init__.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/unicode copying xml/unicode/iso8859.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/unicode copying xml/unicode/utf8_iso.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/unicode creating build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/parsers copying xml/parsers/__init__.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/parsers copying xml/parsers/expat.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/parsers copying xml/parsers/sgmllib.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/parsers creating build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/__init__.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/_outputters.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/catalog.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/charconv.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/dtdparser.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/errors.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/namespace.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/utils.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/xcatalog.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/xmlapp.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/xmldtd.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/xmlproc.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/xmlutils.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/parsers/xmlproc copying xml/parsers/xmlproc/xmlval.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/parsers/xmlproc creating build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/sax copying xml/sax/__init__.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/sax copying xml/sax/_exceptions.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/sax copying xml/sax/expatreader.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/sax copying xml/sax/handler.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/sax copying xml/sax/sax2exts.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/sax copying xml/sax/saxexts.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/sax copying xml/sax/saxlib.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/sax copying xml/sax/saxutils.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/sax copying xml/sax/writer.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/sax copying xml/sax/xmlreader.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/sax creating build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/sax/drivers copying xml/sax/drivers/__init__.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/sax/drivers copying xml/sax/drivers/drv_htmllib.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/sax/drivers copying xml/sax/drivers/drv_ltdriver.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/sax/drivers copying xml/sax/drivers/drv_ltdriver_val.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/sax/drivers copying xml/sax/drivers/drv_pyexpat.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/sax/drivers copying xml/sax/drivers/drv_sgmllib.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/sax/drivers copying xml/sax/drivers/drv_sgmlop.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/sax/drivers copying xml/sax/drivers/drv_xmldc.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/sax/drivers copying xml/sax/drivers/drv_xmllib.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/sax/drivers copying xml/sax/drivers/drv_xmlproc.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/sax/drivers copying xml/sax/drivers/drv_xmlproc_val.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/sax/drivers copying xml/sax/drivers/drv_xmltoolkit.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/sax/drivers copying xml/sax/drivers/pylibs.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/sax/drivers creating build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/sax/drivers2 copying xml/sax/drivers2/__init__.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/sax/drivers2 copying xml/sax/drivers2/drv_htmllib.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/sax/drivers2 copying xml/sax/drivers2/drv_javasax.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/sax/drivers2 copying xml/sax/drivers2/drv_pyexpat.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/sax/drivers2 copying xml/sax/drivers2/drv_sgmllib.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/sax/drivers2 copying xml/sax/drivers2/drv_sgmlop.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/sax/drivers2 copying xml/sax/drivers2/drv_sgmlop_html.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/sax/drivers2 copying xml/sax/drivers2/drv_xmlproc.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/sax/drivers2 creating build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/utils copying xml/utils/__init__.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/utils copying xml/utils/characters.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/utils copying xml/utils/iso8601.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/utils copying xml/utils/qp_xml.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/utils creating build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/schema copying xml/schema/__init__.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/schema copying xml/schema/trex.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/schema creating build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/xpath copying xml/xpath/__init__.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/xpath copying xml/xpath/BuiltInExtFunctions.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/xpath copying xml/xpath/Context.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/xpath copying xml/xpath/Conversions.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/xpath copying xml/xpath/CoreFunctions.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/xpath copying xml/xpath/ExpandedNameWrapper.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/xpath copying xml/xpath/MessageSource.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/xpath copying xml/xpath/NamespaceNode.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/xpath copying xml/xpath/ParsedAbbreviatedAbsoluteLocationPath.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/xpath copying xml/xpath/ParsedAbbreviatedRelativeLocationPath.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/xpath copying xml/xpath/ParsedAbsoluteLocationPath.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/xpath copying xml/xpath/ParsedAxisSpecifier.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/xpath copying xml/xpath/ParsedExpr.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/xpath copying xml/xpath/ParsedNodeTest.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/xpath copying xml/xpath/ParsedPredicateList.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/xpath copying xml/xpath/ParsedRelativeLocationPath.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/xpath copying xml/xpath/ParsedStep.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/xpath copying xml/xpath/pyxpath.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/xpath copying xml/xpath/Set.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/xpath copying xml/xpath/Util.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/xpath copying xml/xpath/XPathGrammar.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/xpath copying xml/xpath/XPathParser.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/xpath copying xml/xpath/XPathParserBase.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/xpath copying xml/xpath/yappsrt.py -> build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/xpath running build_ext building '_xmlplus.parsers.pyexpat' extension creating build/temp.darwin-6.4-Power Macintosh-2.2 gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -no-cpp-precomp -DXML_NS=1 -DXML_DTD=1 -DBYTEORDER=4321 -DXML_CONTEXT_BYTES=1024 -Iextensions/expat/lib -I/usr/include/python2.2 -c extensions/pyexpat.c -o build/temp.darwin-6.4-Power Macintosh-2.2/pyexpat.o gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -no-cpp-precomp -DXML_NS=1 -DXML_DTD=1 -DBYTEORDER=4321 -DXML_CONTEXT_BYTES=1024 -Iextensions/expat/lib -I/usr/include/python2.2 -c extensions/expat/lib/xmlparse.c -o build/temp.darwin-6.4-Power Macintosh-2.2/xmlparse.o In file included from extensions/expat/lib/xmlparse.c:83: extensions/expat/lib/xmltok.h:143: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.h:144: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.h:149: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.h:280: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.h:281: warning: `regparm' attribute directive ignored extensions/expat/lib/xmlparse.c:345: warning: `regparm' attribute directive ignored extensions/expat/lib/xmlparse.c:360: warning: `regparm' attribute directive ignored extensions/expat/lib/xmlparse.c:361: warning: `regparm' attribute directive ignored extensions/expat/lib/xmlparse.c:362: warning: `regparm' attribute directive ignored extensions/expat/lib/xmlparse.c:364: warning: `regparm' attribute directive ignored extensions/expat/lib/xmlparse.c:365: warning: `regparm' attribute directive ignored extensions/expat/lib/xmlparse.c:368: warning: `regparm' attribute directive ignored extensions/expat/lib/xmlparse.c:369: warning: `regparm' attribute directive ignored extensions/expat/lib/xmlparse.c:370: warning: `regparm' attribute directive ignored extensions/expat/lib/xmlparse.c:377: warning: `regparm' attribute directive ignored extensions/expat/lib/xmlparse.c:379: warning: `regparm' attribute directive ignored extensions/expat/lib/xmlparse.c:383: warning: `regparm' attribute directive ignored extensions/expat/lib/xmlparse.c:385: warning: `regparm' attribute directive ignored extensions/expat/lib/xmlparse.c:825: warning: `regparm' attribute directive ignored extensions/expat/lib/xmlparse.c:1013: warning: `regparm' attribute directive ignored extensions/expat/lib/xmlparse.c:4558: warning: `regparm' attribute directive ignored extensions/expat/lib/xmlparse.c:4925: warning: `regparm' attribute directive ignored extensions/expat/lib/xmlparse.c:5261: warning: `regparm' attribute directive ignored extensions/expat/lib/xmlparse.c:5270: warning: `regparm' attribute directive ignored extensions/expat/lib/xmlparse.c:5343: warning: `regparm' attribute directive ignored extensions/expat/lib/xmlparse.c:5358: warning: `regparm' attribute directive ignored extensions/expat/lib/xmlparse.c:5371: warning: `regparm' attribute directive ignored extensions/expat/lib/xmlparse.c:5381: warning: `regparm' attribute directive ignored extensions/expat/lib/xmlparse.c:5388: warning: `regparm' attribute directive ignored extensions/expat/lib/xmlparse.c:5399: warning: `regparm' attribute directive ignored extensions/expat/lib/xmlparse.c:5410: warning: `regparm' attribute directive ignored extensions/expat/lib/xmlparse.c:5430: warning: `regparm' attribute directive ignored extensions/expat/lib/xmlparse.c:5463: warning: `regparm' attribute directive ignored extensions/expat/lib/xmlparse.c:5489: warning: `regparm' attribute directive ignored extensions/expat/lib/xmlparse.c:5512: warning: `regparm' attribute directive ignored extensions/expat/lib/xmlparse.c:5575: warning: `regparm' attribute directive ignored gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -no-cpp-precomp -DXML_NS=1 -DXML_DTD=1 -DBYTEORDER=4321 -DXML_CONTEXT_BYTES=1024 -Iextensions/expat/lib -I/usr/include/python2.2 -c extensions/expat/lib/xmlrole.c -o build/temp.darwin-6.4-Power Macintosh-2.2/xmlrole.o In file included from extensions/expat/lib/xmlrole.h:14, from extensions/expat/lib/xmlrole.c:13: extensions/expat/lib/xmltok.h:143: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.h:144: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.h:149: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.h:280: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.h:281: warning: `regparm' attribute directive ignored extensions/expat/lib/xmlrole.c:111: warning: `regparm' attribute directive ignored extensions/expat/lib/xmlrole.c:1290: warning: `regparm' attribute directive ignored gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -no-cpp-precomp -DXML_NS=1 -DXML_DTD=1 -DBYTEORDER=4321 -DXML_CONTEXT_BYTES=1024 -Iextensions/expat/lib -I/usr/include/python2.2 -c extensions/expat/lib/xmltok.c -o build/temp.darwin-6.4-Power Macintosh-2.2/xmltok.o In file included from extensions/expat/lib/xmltok.c:13: extensions/expat/lib/xmltok.h:143: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.h:144: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.h:149: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.h:280: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.h:281: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.c:116: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.c:122: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.c:128: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.c:136: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.c:142: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.c:150: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.c:156: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.c:162: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.c:176: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.c:177: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.c:178: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.c:179: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.c:180: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.c:181: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.c:182: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.c:183: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.c:184: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.c:215: warning: `regparm' attribute directive ignored In file included from extensions/expat/lib/xmltok.c:290: extensions/expat/lib/xmltok_impl.c:1522: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok_impl.c:1697: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok_impl.c:1724: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.c:509: warning: `regparm' attribute directive ignored In file included from extensions/expat/lib/xmltok.c:687: extensions/expat/lib/xmltok_impl.c:1522: warning: `regparm' attribute directive ignored In file included from extensions/expat/lib/xmltok.c:687: extensions/expat/lib/xmltok_impl.c:1697: warning: `regparm' attribute directive ignored In file included from extensions/expat/lib/xmltok.c:687: extensions/expat/lib/xmltok_impl.c:1724: warning: `regparm' attribute directive ignored In file included from extensions/expat/lib/xmltok.c:826: extensions/expat/lib/xmltok_impl.c:1522: warning: `regparm' attribute directive ignored In file included from extensions/expat/lib/xmltok.c:826: extensions/expat/lib/xmltok_impl.c:1697: warning: `regparm' attribute directive ignored In file included from extensions/expat/lib/xmltok.c:826: extensions/expat/lib/xmltok_impl.c:1724: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.c:908: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.c:945: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.c:1159: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.c:1178: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.c:1215: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.c:1249: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.c:1259: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.c:1269: warning: `regparm' attribute directive ignored extensions/expat/lib/xmltok.c:1447: warning: `regparm' attribute directive ignored gcc -arch i386 -arch ppc -bundle -flat_namespace -undefined suppress build/temp.darwin-6.4-Power Macintosh-2.2/pyexpat.o build/temp.darwin-6.4-Power Macintosh-2.2/xmlparse.o build/temp.darwin-6.4-Power Macintosh-2.2/xmlrole.o build/temp.darwin-6.4-Power Macintosh-2.2/xmltok.o -o build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/parsers/pyexpat.so ld: for architecture i386 ld: warning /usr/lib/bundle1.o cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) ld: warning build/temp.darwin-6.4-Power Macintosh-2.2/pyexpat.o cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) ld: warning build/temp.darwin-6.4-Power Macintosh-2.2/xmlparse.o cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) ld: warning build/temp.darwin-6.4-Power Macintosh-2.2/xmlrole.o cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) ld: warning build/temp.darwin-6.4-Power Macintosh-2.2/xmltok.o cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) ld: warning /usr/lib/gcc/darwin/3.1/libgcc.a archive's cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (can't load from it) ld: warning /usr/lib/libSystem.dylib cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) building '_xmlplus.parsers.sgmlop' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -no-cpp-precomp -I/usr/include/python2.2 -c extensions/sgmlop.c -o build/temp.darwin-6.4-Power Macintosh-2.2/sgmlop.o gcc -arch i386 -arch ppc -bundle -flat_namespace -undefined suppress build/temp.darwin-6.4-Power Macintosh-2.2/sgmlop.o -o build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/parsers/sgmlop.so ld: for architecture i386 ld: warning /usr/lib/bundle1.o cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) ld: warning build/temp.darwin-6.4-Power Macintosh-2.2/sgmlop.o cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) ld: warning /usr/lib/gcc/darwin/3.1/libgcc.a archive's cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (can't load from it) ld: warning /usr/lib/libSystem.dylib cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) building '_xmlplus.utils.boolean' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -no-cpp-precomp -I/usr/include/python2.2 -c extensions/boolean.c -o build/temp.darwin-6.4-Power Macintosh-2.2/boolean.o gcc -arch i386 -arch ppc -bundle -flat_namespace -undefined suppress build/temp.darwin-6.4-Power Macintosh-2.2/boolean.o -o build/lib.darwin-6.4-Power Macintosh-2.2/_xmlplus/utils/boolean.so ld: for architecture i386 ld: warning /usr/lib/bundle1.o cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) ld: warning build/temp.darwin-6.4-Power Macintosh-2.2/boolean.o cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) ld: warning /usr/lib/gcc/darwin/3.1/libgcc.a archive's cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (can't load from it) ld: warning /usr/lib/libSystem.dylib cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) running build_scripts creating build/scripts-2.2 copying and adjusting scripts/xmlproc_parse -> build/scripts-2.2 copying and adjusting scripts/xmlproc_val -> build/scripts-2.2 From basu@mahiti.org Fri Mar 7 10:00:04 2003 From: basu@mahiti.org (Basalingamma) Date: Fri, 7 Mar 2003 15:30:04 +0530 (IST) Subject: [XML-SIG] help please Message-ID: <47138.192.168.0.232.1047031204.squirrel@192.168.0.254> Dear all, I am dealing with a project "automation of web application of testing tool **puffin**". I am using Python and zope. So, may I know what will be the best way to store xml tags for system and testaction configuration entered by tester in form.And generate xml file using python. ------------------------ Basalingamma, Volunteer, Mahiti Infotech Private Limited 314/1, Vijay Kiran, II Floor, 7th Cross, Domlur Layout, Domlur, Bangalore - 560 071 From gia@webde-ag.de Fri Mar 7 10:13:39 2003 From: gia@webde-ag.de (Gisbert Amm) Date: Fri, 7 Mar 2003 11:13:39 +0100 Subject: [XML-SIG] help please Message-ID: <74ADFA8C453ED611A71E00508BBBA135D9E893@exchange1.cinetic.de> > And generate xml file using python. A simple example using minidom (a DOM implementation): >>>from xml.dom.minidom import Document >>>newdoc = Document() >>> docindex = newdoc.createElement("docindex") >>> newdoc.appendChild(docindex) >>> newdoc.createElement("entry") >>> docindex.appendChild(entry) >>> newdoc.toxml() '\n' and so on :-) (see http://python.org/doc/current/lib/module-xml.dom.minidom.html) Regards Gisbert Amm From basu@mahiti.org Fri Mar 7 10:54:27 2003 From: basu@mahiti.org (Basalingamma) Date: Fri, 7 Mar 2003 16:24:27 +0530 (IST) Subject: [XML-SIG] please help Message-ID: <47256.192.168.0.232.1047034467.squirrel@192.168.0.254> Dear all, Since I am dealing with the project 'automation of the web application testing tool puffin'.I need to design form and enter xml tags . Since i am using zope .I am getting problem with storage of tree structured xml tag.May I know the best way of storage. ------------------------ Basalingamma, Volunteer, Mahiti Infotech Private Limited 314/1, Vijay Kiran, II Floor, 7th Cross, Domlur Layout, Domlur, Bangalore - 560 071 From felix@fbreuer.de Sat Mar 8 19:32:24 2003 From: felix@fbreuer.de (Felix Breuer) Date: 08 Mar 2003 20:32:24 +0100 Subject: [XML-SIG] incremental XSL transformations Message-ID: <1047151944.1483.14.camel@tapir> Hello! I am looking for a XSLT processor that supports the following mode of operation: Given: * a source DOM tree to be transformed * a XSLT stylesheet Initialization: * apply the stylesheet to the source tree to obtain a result DOM tree * obtain a mapping from the source tree to the result tree which maps elements/text nodes in the source tree to the set of elements/text nodes which have been generated from them by means of an XSLT template On changes in the source DOM tree: * incrementally modify the result tree accordingly * update the mapping For more on such incremental transformations see: http://www.research.ibm.com/people/v/villard/Papiers/incXSLT.pdf Now my question is: Does 4XSLT or any other Python XSLT processor support such a mode of operation or could be extended to support such a mode of operation? Thanks in advance, Felix -- Felix Breuer From uche.ogbuji@fourthought.com Sat Mar 8 20:19:55 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Sat, 08 Mar 2003 13:19:55 -0700 Subject: [XML-SIG] Re: [4suite-dev] incremental XSL transformations In-Reply-To: <1047151944.1483.14.camel@tapir> References: <1047151944.1483.14.camel@tapir> Message-ID: <3E6A506B.1010007@fourthought.com> Felix Breuer wrote: >Hello! > >I am looking for a XSLT processor that supports the following mode of >operation: > >Given: > * a source DOM tree to be transformed > * a XSLT stylesheet > >Initialization: > * apply the stylesheet to the source tree to obtain a result DOM tree > * obtain a mapping from the source tree to the result tree which maps > elements/text nodes in the source tree to the set of elements/text > nodes which have been generated from them by means of an XSLT > template > >On changes in the source DOM tree: > * incrementally modify the result tree accordingly > * update the mapping > >For more on such incremental transformations see: >http://www.research.ibm.com/people/v/villard/Papiers/incXSLT.pdf > >Now my question is: Does 4XSLT or any other Python XSLT processor >support such a mode of operation or could be extended to support such a >mode of operation? > > That's a neat idea. 4XSLT does not support such a mode, nor do I know of any other processor at all, regardless of language, that does. I think it could be extended to support this by instrumenting all the XSLT element classes to maintain a mapping from source node IDs to result sub-trees, and using clever analysis to sync these in future based on this mapping. This is not a feature I forsee in the near future for 4Suite, but it sounds like it would be a neat project for someone else to take on. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Universal Business Language (UBL) - http://www-106.ibm.com/developerworks/xml/library/x-think16.html EXSLT by example - http://www-106.ibm.com/developerworks/library/x-exslt.html The worry about program wizards - http://www.adtmag.com/article.asp?id=7238 Use rdf:about and rdf:ID effectively in RDF/XML - http://www-106.ibm.com/developerworks/xml/library/x-tiprdfai.html Keep context straight in XSLT - http://www-106.ibm.com/developerworks/xml/library/x-tipcurrent.html Python Generators + DOM - http://www.xml.com/pub/a/2003/01/08/py-xml.html Simple XML Processing With elementtree - http://www.xml.com/pub/a/2003/02/12/py-xml.html From uche.ogbuji@fourthought.com Sun Mar 9 00:44:08 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Sat, 08 Mar 2003 17:44:08 -0700 Subject: [XML-SIG] [PATCH] wsdllib.py In-Reply-To: Message from Mark Bucciarelli of "Mon, 03 Mar 2003 13:30:45 EST." <200303031330.48377.mark@easymailings.com> Message-ID: > On Monday 03 March 2003 12:35 am, Uche Ogbuji wrote: > > > Is there any chance you could put together a patch to update wsdllib.py > > Patch enclosed below (output of diff -u -b). Please review and comment. I am very grateful for this contribution. Thanks. I've been trying to properly review ad test this patch so I can prep a new wsdllib.py releae, but I've been having account problems on the IBM site. Just to be sure it's tracked and will be applied as soon as posssible, I reated a formal patch entry: http://www-124.ibm.com/developerworks/patch/index.php?func=detailpatch&patch_id =405&group_id=73 I'll update you when I'm able to apply and test the patch properly. Thanks again. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Universal Business Language (UBL) - http://www-106.ibm.com/developerworks/xml/l ibrary/x-think16.html EXSLT by example - http://www-106.ibm.com/developerworks/library/x-exslt.html The worry about program wizards - http://www.adtmag.com/article.asp?id=7238 Use rdf:about and rdf:ID effectively in RDF/XML - http://www-106.ibm.com/develo perworks/xml/library/x-tiprdfai.html Keep context straight in XSLT - http://www-106.ibm.com/developerworks/xml/libra ry/x-tipcurrent.html Python Generators + DOM - http://www.xml.com/pub/a/2003/01/08/py-xml.html Simple XML Processing With elementtree - http://www.xml.com/pub/a/2003/02/12/py -xml.html From uche.ogbuji@fourthought.com Sun Mar 9 01:12:15 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Sat, 08 Mar 2003 18:12:15 -0700 Subject: [XML-SIG] Re: Finding _xmlplus in Python 2.3a2 In-Reply-To: Message from "Thomas B. Passin" of "Mon, 03 Mar 2003 18:12:30 EST." <002c01c2e1da$5d59edd0$6401a8c0@tbp1> Message-ID: > [ "Martijn Faassen"] > > > One way one could solve it is by moving stuff from PyXML that are already > > inside the Python core. That may not be desirable as development is still > > ongoing, but surely some things are stable enough by now to stop > > maintaining as part of PyXML? > > > > It seems that we may be converging on moving some basics from PyXML into the > Python core. Before we settle on that, who would maintain and update that > code once it got moved? XML-SIG (I think that would be best)? Weeeeeeel. My guess is that such a move would require a *person's* name, and nothing as wooly as "XML-SIG" in order to fly in the python-dev camp. And this would be rightly so. The problem is that I don't have the bandwidth to attach my name to maintaining it, and I wouldn't want to presume that anyone else does. Unless someone steps forward clearly to volunteer, I fear that this whole discussion is largely academic. I appreciate Martijn's offer fo some resources, but I'm not sure that even that puts us on firm enough ground. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Universal Business Language (UBL) - http://www-106.ibm.com/developerworks/xml/l ibrary/x-think16.html EXSLT by example - http://www-106.ibm.com/developerworks/library/x-exslt.html The worry about program wizards - http://www.adtmag.com/article.asp?id=7238 Use rdf:about and rdf:ID effectively in RDF/XML - http://www-106.ibm.com/develo perworks/xml/library/x-tiprdfai.html Keep context straight in XSLT - http://www-106.ibm.com/developerworks/xml/libra ry/x-tipcurrent.html Python Generators + DOM - http://www.xml.com/pub/a/2003/01/08/py-xml.html Simple XML Processing With elementtree - http://www.xml.com/pub/a/2003/02/12/py -xml.html From uche.ogbuji@fourthought.com Sun Mar 9 01:16:21 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Sat, 08 Mar 2003 18:16:21 -0700 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: Message from martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) of "04 Mar 2003 08:02:10 +0100." Message-ID: > Michael McLay writes: > > > It's getting down to the wire on the 2.3 release. Perhaps it would > > be a good idea to raise the subject on python-dev. > > I don't think anything can or should be done in this respect. What > precisely are you proposing (i.e. what specific changes to Python core > do you suggest?) I don't think there is reasonably anythign o be dne in the Python 2.3 timeframe, but I think the overall discussion has been about the idea of moving SAX and DOM more firmly into Python core, i.e. not maintaining two separate versions of pysax and dom-minus-4DOM. The thinking is that this may be a relatively inexpensive way to reduce some of the confusion that people have mentioned in this thread. If you think it's not so inexpensive, or that it's a bad idea, that in itself would be a useful data point. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Universal Business Language (UBL) - http://www-106.ibm.com/developerworks/xml/library/x-think16.html EXSLT by example - http://www-106.ibm.com/developerworks/library/x-exslt.html The worry about program wizards - http://www.adtmag.com/article.asp?id=7238 Use rdf:about and rdf:ID effectively in RDF/XML - http://www-106.ibm.com/developerworks/xml/library/x-tiprdfai.html Keep context straight in XSLT - http://www-106.ibm.com/developerworks/xml/library/x-tipcurrent.html Python Generators + DOM - http://www.xml.com/pub/a/2003/01/08/py-xml.html Simple XML Processing With elementtree - http://www.xml.com/pub/a/2003/02/12/py-xml.html From uche.ogbuji@fourthought.com Sun Mar 9 01:19:01 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Sat, 08 Mar 2003 18:19:01 -0700 Subject: [XML-SIG] Re: Finding _xmlplus in Python 2.3a2 In-Reply-To: Message from martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) of "04 Mar 2003 08:19:36 +0100." Message-ID: > Martijn Faassen writes: > > > One way one could solve it is by moving stuff from PyXML that are already > > inside the Python core. That may not be desirable as development is still > > ongoing, but surely some things are stable enough by now to stop > > maintaining as part of PyXML? > > There are still lots of open issues with minidom, and with expat. Fred > Drake has recently essentially rewritten minidom, to address problems > found by users (mainly efficiency concerns, and some correctness > concerns). It is likely that there will be rushes of activity in the > future again (with long periods of inactivity in-between). > > PyXML offers a great opportunity to hand out the code to users of the > xml package; it allows to correct problems more quickly than a Python > beta release cycle. OK. This was actally the issue that made me bring up he idea of a merge in the first place. I figured that now that we have a Python release almost every six months (whether alpha, beta or full) that maybe this gives us enough flexibility for such bursts of activity. I gather you think that maintaining the separate PyXML release cycle is still valuable? -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Universal Business Language (UBL) - http://www-106.ibm.com/developerworks/xml/l ibrary/x-think16.html EXSLT by example - http://www-106.ibm.com/developerworks/library/x-exslt.html The worry about program wizards - http://www.adtmag.com/article.asp?id=7238 Use rdf:about and rdf:ID effectively in RDF/XML - http://www-106.ibm.com/develo perworks/xml/library/x-tiprdfai.html Keep context straight in XSLT - http://www-106.ibm.com/developerworks/xml/libra ry/x-tipcurrent.html Python Generators + DOM - http://www.xml.com/pub/a/2003/01/08/py-xml.html Simple XML Processing With elementtree - http://www.xml.com/pub/a/2003/02/12/py -xml.html From uche.ogbuji@fourthought.com Sun Mar 9 01:24:02 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Sat, 08 Mar 2003 18:24:02 -0700 Subject: [XML-SIG] Finding _xmlplus in Python 2.3a2 In-Reply-To: Message from martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) of "04 Mar 2003 08:25:51 +0100." Message-ID: > Martijn Faassen writes: > > > > While I can sympathize with these concerns, I don't think anything can > > > be done to change the situation that isn't very painful, and requires > > > more resources than I can offer. > > > > We (at Infrae) can also put in some resources if necessary. > > Thanks for the offer. I would need somebody to do all the work, and > take all the blame, someone who won't run away once the work is done > and the user complaints come in (for, say, atleast two years). It > would probably best if that person would take over a few PyXML > releases (you can't have responsibility without power). > > That is not to say that I want to withdraw from PyXML, but I feel > really uneasy about such a change, and I cannot defend something I > don't believe in. I'm certainly glad you don't want to withdraw from PyXML, and I certainly say that we should not go forward with any move that you would not be comfortable with. You've largely directed the project for a long time now, and it would be both disrespectful of your effort and a foolish scorning of the most experienced developer to side-step your concerns. I too an unconvinced of the strength of the argument for a straightforward removal of _xmlplus. I thought, however, that a faster core Python release cycle means that we can maybe pursue a more broadly-considerd solution of simply eliminating the double-maintenance of core code. If you think such an approach is too simplistic, then I'd reconsider my position. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Universal Business Language (UBL) - http://www-106.ibm.com/developerworks/xml/l ibrary/x-think16.html EXSLT by example - http://www-106.ibm.com/developerworks/library/x-exslt.html The worry about program wizards - http://www.adtmag.com/article.asp?id=7238 Use rdf:about and rdf:ID effectively in RDF/XML - http://www-106.ibm.com/develo perworks/xml/library/x-tiprdfai.html Keep context straight in XSLT - http://www-106.ibm.com/developerworks/xml/libra ry/x-tipcurrent.html Python Generators + DOM - http://www.xml.com/pub/a/2003/01/08/py-xml.html Simple XML Processing With elementtree - http://www.xml.com/pub/a/2003/02/12/py -xml.html From uche.ogbuji@fourthought.com Sun Mar 9 01:35:17 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Sat, 08 Mar 2003 18:35:17 -0700 Subject: [XML-SIG] xml namespace prefix and xml.sax.saxutils.XMLGenerator In-Reply-To: Message from Martijn Faassen of "Tue, 04 Mar 2003 15:10:32 +0100." <20030304141032.GA25744@vet.uu.nl> Message-ID: > Hi there, > > I'm using xml.sax.saxutils.XMLGenerator to generate XML from sax > events automatically, and I think I've discovered a bug. [SNIP] For my aprt, I'm quite familiar ith all the specifications from which you quoted, but I saw no actual code in your reportthat demonstrates the problem. I couldn't reconstruct it from your description. Do you mean that you create an attributeNSImpl object containing {http://www.w3.org/XML/1998/namespace}lang (James Clark notation) and that you got a traceback as a result? If so, then that is a bug, but I'm just guessing you mean the above. I'd like to see some tet code and the error it produces. > The generator works fine for 'xmlns', but it doesn't seem to handle 'xml' > properly. What should be the case if I understand this right is that the > 'xml' namespace is always declared (and thus does not get a special > xmlns declaration). The XMLGenerator and perhaps other code does not > recognize the 'xml' prefix however, and barfs over it when generating > startElementNS(). > > Trying to introduce it by using startPrefixMapping() fails, as then > the generator automatically will add an explicit definition to the document > element (xmlns:xml="http://www.w3.org/XML/1998/namespace"), which shouldn't > happen. It is perfectly correct to explicitly declare the xml prefix, as long as it is declared to the http://www.w3.org/XML/1998/namespace namespace. Of course it is *convenient* not to generate this declaration, since it's not needed. > The fix seems to be as following. Change line 221 or thereabouts from: > > self._ns_contexts = [{}] # contains uri -> prefix dicts > > into this: > > # contains uri -> prefix dicts > self._ns_contexts = [{'http://www.w3.org/XML/1998/namespace': 'xml'}] > > If this is deemed to be a good fix I can check this one in myself. I wonder > though if there would be any other problems with 'xml:' in sax handlers I'm less > familiar with (reading it in appears to work fine). Anyone? Thanks for finding a fix, but I'd like to be sure I understand the bug repro case before I coul decided whether this is a needed ix. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Universal Business Language (UBL) - http://www-106.ibm.com/developerworks/xml/library/x-think16.html EXSLT by example - http://www-106.ibm.com/developerworks/library/x-exslt.html The worry about program wizards - http://www.adtmag.com/article.asp?id=7238 Use rdf:about and rdf:ID effectively in RDF/XML - http://www-106.ibm.com/developerworks/xml/library/x-tiprdfai.html Keep context straight in XSLT - http://www-106.ibm.com/developerworks/xml/library/x-tipcurrent.html Python Generators + DOM - http://www.xml.com/pub/a/2003/01/08/py-xml.html Simple XML Processing With elementtree - http://www.xml.com/pub/a/2003/02/12/py-xml.html From uche.ogbuji@fourthought.com Sun Mar 9 01:42:06 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Sat, 08 Mar 2003 18:42:06 -0700 Subject: [XML-SIG] xml namespace prefix and xml.sax.saxutils.XMLGenerator In-Reply-To: Message from Daniel Veillard of "Tue, 04 Mar 2003 12:48:43 EST." <20030304124843.Z13003@redhat.com> Message-ID: > On Tue, Mar 04, 2003 at 03:10:32PM +0100, Martijn Faassen wrote: > > The generator works fine for 'xmlns', but it doesn't seem to handle 'xml' > > properly. What should be the case if I understand this right is that the > > 'xml' namespace is always declared (and thus does not get a special > > xmlns declaration). > > That's right. Just to continue to be nitpicky, The xml prefix does not *need* to be declared, but there is nothing wrong with declaring it, either, as long as XMLNS constraints are met. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Universal Business Language (UBL) - http://www-106.ibm.com/developerworks/xml/l ibrary/x-think16.html EXSLT by example - http://www-106.ibm.com/developerworks/library/x-exslt.html The worry about program wizards - http://www.adtmag.com/article.asp?id=7238 Use rdf:about and rdf:ID effectively in RDF/XML - http://www-106.ibm.com/develo perworks/xml/library/x-tiprdfai.html Keep context straight in XSLT - http://www-106.ibm.com/developerworks/xml/libra ry/x-tipcurrent.html Python Generators + DOM - http://www.xml.com/pub/a/2003/01/08/py-xml.html Simple XML Processing With elementtree - http://www.xml.com/pub/a/2003/02/12/py -xml.html From uche.ogbuji@fourthought.com Sun Mar 9 01:50:50 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Sat, 08 Mar 2003 18:50:50 -0700 Subject: [XML-SIG] help please In-Reply-To: Message from "Basalingamma" of "Fri, 07 Mar 2003 15:30:04 +0530." <47138.192.168.0.232.1047031204.squirrel@192.168.0.254> Message-ID: > Dear all, > I am dealing with a project "automation of web application of testing > tool **puffin**". > I am using Python and zope. So, may I know what will be the best way to > store xml tags for system and testaction configuration entered by tester > in form.And generate xml file using python. See http://www.xml.com/pub/a/2002/09/25/py.html http://www.xml.com/pub/a/2002/10/16/py-xml.html http://www.xml.com/pub/a/2002/11/13/py-xml.html http://www.xml.com/pub/a/2002/12/11/py-xml.html And the upcoming (next week) article in that series which covers using xml.sax.saxutils.XMLGenerator for output. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Universal Business Language (UBL) - http://www-106.ibm.com/developerworks/xml/l ibrary/x-think16.html EXSLT by example - http://www-106.ibm.com/developerworks/library/x-exslt.html The worry about program wizards - http://www.adtmag.com/article.asp?id=7238 Use rdf:about and rdf:ID effectively in RDF/XML - http://www-106.ibm.com/develo perworks/xml/library/x-tiprdfai.html Keep context straight in XSLT - http://www-106.ibm.com/developerworks/xml/libra ry/x-tipcurrent.html Python Generators + DOM - http://www.xml.com/pub/a/2003/01/08/py-xml.html Simple XML Processing With elementtree - http://www.xml.com/pub/a/2003/02/12/py -xml.html From mark@easymailings.com Mon Mar 10 17:22:47 2003 From: mark@easymailings.com (Mark Bucciarelli) Date: Mon, 10 Mar 2003 12:22:47 -0500 Subject: [XML-SIG] Two SimpleXMLRPCServer questions Message-ID: <200303101222.54095.mark@easymailings.com> I have implemented a simple xmlrpc message queue (inspired heavily by the pyMQ project on SourceForge--but don't bother going there, the code isn't posted there yet, as it's pre-alpha.) I use ZODB to store the queue data. I can't figure out how to pass the ZODB file name in as a command parameter to the script. To paraphrase, the script goes like this: g_quit = 0 # isn't ASPN great? if __name__ == '__main__': db = 'somefile.fs' server = SimpleXMLRPCServer() server.register_instance() while not g_quit: server.handle_request() The other question I have is how to make this server stop (and perhaps finish it's work) when someone presses a control-C in the console. BTW, the SimpleXMLRPCServer class is pretty amazing. I set up a queue of 1000 messages and was able to server 20 threads simultaneously issuing a getMessagesFromTopic call without dropping a single connection. (Granted, I cranked the request_queue_size from 5 to 200 ....) So far, no need for the complexity of threads and locking ... :) Mark From brian@sweetapp.com Mon Mar 10 18:22:40 2003 From: brian@sweetapp.com (Brian Quinlan) Date: Mon, 10 Mar 2003 10:22:40 -0800 Subject: [XML-SIG] Two SimpleXMLRPCServer questions In-Reply-To: <200303101222.54095.mark@easymailings.com> Message-ID: <003001c2e732$091a3a10$21795418@dell1700> > I use ZODB to store the queue data. I can't figure out how to pass the > ZODB file name in as a command parameter to the script. I don't know what you mean. > The other question I have is how to make this server stop (and perhaps > finish it's work) when someone presses a control-C in the console. Hmmmm....the fact that this doesn't work better already is probably a bug. Look at SimpleXMLRPCRequestHandler.do_POST. You might want to create your own subclass and modify that method such that KeyboardInterrupts set g_quit. KeyboardInterrupts should work if other code in handle_request is executing. Cheers, Brian From mark@easymailings.com Mon Mar 10 18:21:42 2003 From: mark@easymailings.com (Mark Bucciarelli) Date: Mon, 10 Mar 2003 13:21:42 -0500 Subject: [XML-SIG] Two SimpleXMLRPCServer questions In-Reply-To: <003001c2e732$091a3a10$21795418@dell1700> References: <003001c2e732$091a3a10$21795418@dell1700> Message-ID: <200303101321.42406.mark@easymailings.com> On Monday 10 March 2003 1:22 pm, Brian Quinlan wrote: > > I use ZODB to store the queue data. I can't figure out how to pass > > the ZODB file name in as a command parameter to the script. > > I don't know what you mean. Right now, I register a class that holds all the server methods. In a custom _dispatch method, I check to see if the server is "started." If it's not, then I start it, meaning that I open a connection to the ZODB database. In order to open this connection, I need to have the filename of the persistent storage. What I would like to do is pass this file name into the script that starts up the server as a command-line parameter. I can't figure out how to get this file name and give it to the class so the _dispatch has access to it. I could make an xmlrpc connection in another thread and then call a setup method via HTTP POST, but that seems a bit kludgy and I was hoping for a more elegant solution. > > The other question I have is how to make this server stop (and perhaps > > finish it's work) when someone presses a control-C in the console. > > Look at SimpleXMLRPCRequestHandler.do_POST. You might want to create > your own subclass and modify that method such that KeyboardInterrupts > set g_quit. Won't this only work if the do_POST is running? Mark From brian@sweetapp.com Mon Mar 10 18:53:58 2003 From: brian@sweetapp.com (Brian Quinlan) Date: Mon, 10 Mar 2003 10:53:58 -0800 Subject: [XML-SIG] Two SimpleXMLRPCServer questions In-Reply-To: <200303101321.42406.mark@easymailings.com> Message-ID: <003101c2e736$6881ea30$21795418@dell1700> > What I would like to do is pass this file name into the script that starts > up the server as a command-line parameter. I can't figure out how to get > this file name and give it to the class so the _dispatch has access to it. I take it that you don't want to use a global variable or examine sys.argv in _dispatch? > Won't this only work if the do_POST is running? do_POST is the only code, in the handle_request code path, with a bare except clause (except handle_request itself which just does a bit of cleanup). Cheers, Brian From veillard@redhat.com Mon Mar 10 18:54:32 2003 From: veillard@redhat.com (Daniel Veillard) Date: Mon, 10 Mar 2003 13:54:32 -0500 Subject: [XML-SIG] Re: [4suite-dev] incremental XSL transformations In-Reply-To: <3E6A506B.1010007@fourthought.com>; from uche.ogbuji@fourthought.com on Sat, Mar 08, 2003 at 01:19:55PM -0700 References: <1047151944.1483.14.camel@tapir> <3E6A506B.1010007@fourthought.com> Message-ID: <20030310135432.P21835@redhat.com> On Sat, Mar 08, 2003 at 01:19:55PM -0700, Uche Ogbuji wrote: > Felix Breuer wrote: > > >Hello! > > > >I am looking for a XSLT processor that supports the following mode of > >operation: > > > >Given: > > * a source DOM tree to be transformed > > * a XSLT stylesheet > > > >Initialization: > > * apply the stylesheet to the source tree to obtain a result DOM tree > > * obtain a mapping from the source tree to the result tree which maps > > elements/text nodes in the source tree to the set of elements/text > > nodes which have been generated from them by means of an XSLT > > template > > > >On changes in the source DOM tree: > > * incrementally modify the result tree accordingly > > * update the mapping > > > >For more on such incremental transformations see: > >http://www.research.ibm.com/people/v/villard/Papiers/incXSLT.pdf > > > >Now my question is: Does 4XSLT or any other Python XSLT processor > >support such a mode of operation or could be extended to support such a > >mode of operation? > > 4XSLT does not support such a mode, nor do I know of any other processor > at all, regardless of language, that does. I think it could be extended Actually Lionel Villard integrated it into Xalan Java Apache code base. Daniel -- Daniel Veillard | Red Hat Network https://rhn.redhat.com/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ From mark@easymailings.com Mon Mar 10 18:44:15 2003 From: mark@easymailings.com (Mark Bucciarelli) Date: Mon, 10 Mar 2003 13:44:15 -0500 Subject: [XML-SIG] Two SimpleXMLRPCServer questions In-Reply-To: <003101c2e736$6881ea30$21795418@dell1700> References: <003101c2e736$6881ea30$21795418@dell1700> Message-ID: <200303101344.15916.mark@easymailings.com> On Monday 10 March 2003 1:53 pm, Brian Quinlan wrote: > I take it that you don't want to use a global variable or examine > sys.argv in _dispatch? Didn't think of those things. I figured there was an easy solution. :) > > Won't this only work if the do_POST is running? > > do_POST is the only code, in the handle_request code path, with a bare > except clause (except handle_request itself which just does a bit of > cleanup). Great, so that should work then. Thanks for your help. Mark From mark@easymailings.com Mon Mar 10 19:12:08 2003 From: mark@easymailings.com (Mark Bucciarelli) Date: Mon, 10 Mar 2003 14:12:08 -0500 Subject: [XML-SIG] Two SimpleXMLRPCServer questions In-Reply-To: <003001c2e732$091a3a10$21795418@dell1700> References: <003001c2e732$091a3a10$21795418@dell1700> Message-ID: <200303101412.09014.mark@easymailings.com> On Monday 10 March 2003 1:22 pm, Brian Quinlan wrote: > Look at SimpleXMLRPCRequestHandler.do_POST. You might want to create > your own subclass and modify that method such that KeyboardInterrupts > set g_quit. I tried this, but it the server doesn't terminate until a request comes in. Also, I get the confusing SyntaxWarning that the name 'g_quit' is assigned before global declaration. I tried moving g_quit to the top of the file, but this didn't help. I'll probably just start the server in it's own thread and then monitor raw_input() in the main thread. Thanks again for your help. Mark From uche.ogbuji@fourthought.com Wed Mar 12 03:48:53 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Tue, 11 Mar 2003 20:48:53 -0700 Subject: [XML-SIG] New Akara Features Message-ID: <3E6EAE25.7090503@fourthought.com> I've been steadily updating and improving the framework on which I manage tips and information for Python/XML developers. http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/pyxml-akara Ever more content and ever more framework features. I call the framework Akara, and it steals the IMHO best ideas from Wikis, Blogs, FAQ Wizards and the like, and offers a convenient interface for managing loosely related news and information. I'm preparing to release Akara as a separate project, but I thought I'd point out some of the new features you can already find on the Python/XML Akara. * An RSS feed of new items. Look for the RSS icon on key pages * Ability for arbitrary users to add comments * Better organization of the items between the sections * There are now three sections - General Python/XML - 4Suite users - 4Suite core developers I welcome feedback, and if you have any thoughts on items that may need correction, clarification or expansion, please don' hesitate to use the comment form for each item. http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/pyxml-akara -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Universal Business Language (UBL) - http://www-106.ibm.com/developerworks/xml/library/x-think16.html EXSLT by example - http://www-106.ibm.com/developerworks/library/x-exslt.html The worry about program wizards - http://www.adtmag.com/article.asp?id=7238 Use rdf:about and rdf:ID effectively in RDF/XML - http://www-106.ibm.com/developerworks/xml/library/x-tiprdfai.html Keep context straight in XSLT - http://www-106.ibm.com/developerworks/xml/library/x-tipcurrent.html Python Generators + DOM - http://www.xml.com/pub/a/2003/01/08/py-xml.html Simple XML Processing With elementtree - http://www.xml.com/pub/a/2003/02/12/py-xml.html From uche.ogbuji@fourthought.com Wed Mar 12 04:18:03 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Tue, 11 Mar 2003 21:18:03 -0700 Subject: [XML-SIG] Re: [4suite] New Akara Features In-Reply-To: <3E6EAE25.7090503@fourthought.com> References: <3E6EAE25.7090503@fourthought.com> Message-ID: <3E6EB4FB.9070105@fourthought.com> Uche Ogbuji wrote: > I've been steadily updating and improving the framework on which I > manage tips and information for Python/XML developers. > > http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/pyxml-akara > > Ever more content and ever more framework features. I call the > framework Akara, and it steals the IMHO best ideas from Wikis, Blogs, > FAQ Wizards and the like, and offers a convenient interface for > managing loosely related news and information. I'm preparing to > release Akara as a separate project, but I thought I'd point out some > of the new features you can already find on the Python/XML Akara. > > * An RSS feed of new items. Look for the RSS icon on key pages > * Ability for arbitrary users to add comments > * Better organization of the items between the sections > * There are now three sections > - General Python/XML > - 4Suite users > - 4Suite core developers > > I welcome feedback, and if you have any thoughts on items that may > need correction, clarification or expansion, please don' hesitate to > use the comment form for each item. > > http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/pyxml-akara I thought it worth mentioning that the simplistic RSS generator I added to Akara using Versa and XSLT produced 100% valid RSS right out of the box. Mark Pilgrim's and Sam Ruby's RSS Validator ( http://diveintomark.org/archives/2002/10/22/rss_validator.html ) passed it first time. Pretty cool how easy such things can be. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Universal Business Language (UBL) - http://www-106.ibm.com/developerworks/xml/library/x-think16.html EXSLT by example - http://www-106.ibm.com/developerworks/library/x-exslt.html The worry about program wizards - http://www.adtmag.com/article.asp?id=7238 Use rdf:about and rdf:ID effectively in RDF/XML - http://www-106.ibm.com/developerworks/xml/library/x-tiprdfai.html Keep context straight in XSLT - http://www-106.ibm.com/developerworks/xml/library/x-tipcurrent.html Python Generators + DOM - http://www.xml.com/pub/a/2003/01/08/py-xml.html Simple XML Processing With elementtree - http://www.xml.com/pub/a/2003/02/12/py-xml.html From nhytro-python@web.de Wed Mar 12 09:09:29 2003 From: nhytro-python@web.de (nhytro-python@web.de) Date: Wed, 12 Mar 2003 10:09:29 +0100 Subject: [XML-SIG] Grabbing and parsing text from a textarea(html form) Message-ID: <200303120909.h2C99T803263@mailgate5.cinetic.de> Hi all! could someone tell me what modules I need to grab user texta from a HTML Textarea form and parse to XML or stuctured text? Thanks nhytro ______________________________________________________________________________ Sie stehen auf POP3? Dann versenden Sie mit WEB.DE FreeMail Ihre SMS aus Outlook oder Netscape! http://freemail.web.de/features/?mc=021178 From gia@webde-ag.de Wed Mar 12 09:25:03 2003 From: gia@webde-ag.de (Gisbert Amm) Date: Wed, 12 Mar 2003 10:25:03 +0100 Subject: [XML-SIG] Grabbing and parsing text from a textarea(html form ) Message-ID: <74ADFA8C453ED611A71E00508BBBA135D9E8E2@exchange1.cinetic.de> > could someone tell me what modules I need to grab user texta > from a HTML Textarea form and parse to XML or stuctured text? Basically you need the cgi module (see http://python.org/doc/current/lib/node297.html). You get a dictionary from which you easily can generate XML. How to generate XML was asked a few days before. Uche Ogbuji postet the following links: http://www.xml.com/pub/a/2002/09/25/py.html http://www.xml.com/pub/a/2002/10/16/py-xml.html http://www.xml.com/pub/a/2002/11/13/py-xml.html http://www.xml.com/pub/a/2002/12/11/py-xml.html And the upcoming (next week) article in that series which covers using xml.sax.saxutils.XMLGenerator for output. Regards Gisbert Amm From 4rf3dd@msn.com Thu Mar 13 11:35:15 2003 From: 4rf3dd@msn.com (misha-lee ) Date: Thu, 13 Mar 2003 11:35:15 GMT Subject: [XML-SIG] vividos,! 1 truth about nutritional supplements Message-ID: To understand the truth about nutritional supplements

    You can stop receive promotions by sending email to this email address peopledel@yahoo.com

To understand the truth about nutritional supplements

 

You must have the correct information

 

For answers ON health and wealth

 

CLICKHERE

 

 

 

 

 

 

 

 

 

 

 

 

 

You can stop receive promotions by sending email to this email address peopledel@yahoo.com

 

From uche.ogbuji@fourthought.com Thu Mar 13 15:21:18 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Thu, 13 Mar 2003 08:21:18 -0700 Subject: Writing out XML (Re: [XML-SIG] Grabbing and parsing text from a textarea(html form ) ) In-Reply-To: Message from Gisbert Amm of "Wed, 12 Mar 2003 10:25:03 +0100." <74ADFA8C453ED611A71E00508BBBA135D9E8E2@exchange1.cinetic.de> Message-ID: > > could someone tell me what modules I need to grab user texta > > from a HTML Textarea form and parse to XML or stuctured text? > > Basically you need the cgi module (see > http://python.org/doc/current/lib/node297.html). > You get a dictionary from which you easily can generate XML. > > How to generate XML was asked a few days before. Uche Ogbuji postet the > following links: > > http://www.xml.com/pub/a/2002/09/25/py.html > http://www.xml.com/pub/a/2002/10/16/py-xml.html > http://www.xml.com/pub/a/2002/11/13/py-xml.html > http://www.xml.com/pub/a/2002/12/11/py-xml.html > > And the upcoming (next week) article in that series which covers using > xml.sax.saxutils.XMLGenerator for output. This article is now out: http://www.xml.com/pub/a/2003/03/12/py-xml.html -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Universal Business Language (UBL) - http://www-106.ibm.com/developerworks/xml/l ibrary/x-think16.html EXSLT by example - http://www-106.ibm.com/developerworks/library/x-exslt.html The worry about program wizards - http://www.adtmag.com/article.asp?id=7238 Use rdf:about and rdf:ID effectively in RDF/XML - http://www-106.ibm.com/develo perworks/xml/library/x-tiprdfai.html Keep context straight in XSLT - http://www-106.ibm.com/developerworks/xml/libra ry/x-tipcurrent.html Python Generators + DOM - http://www.xml.com/pub/a/2003/01/08/py-xml.html Simple XML Processing With elementtree - http://www.xml.com/pub/a/2003/02/12/py -xml.html From mmclay@comcast.net Mon Mar 17 03:27:02 2003 From: mmclay@comcast.net (Michael McLay) Date: Sun, 16 Mar 2003 22:27:02 -0500 Subject: [XML-SIG] SOAP, Web services, hype, and Python Message-ID: <200303162227.02230.mmclay@comcast.net> Why is there so little discussion of "web services" on xml-sig? I've read Paul Prescod's comments on web services verses REST. I generally agree with what he has written. I've also seen Dave Winer be critical of UDDI/WSDL and the "moras" that has been created. Unfortunately, my group seems to think this is the next big thing because Microsoft and IBM are pushing this technology. Am I being stubborn and they are correct, or is this stuff really broken and difficult to work with? I am working on a project that is attempting to use SOAP to send RosettaNet messages between web portals. The group is using Java as the primary implementation of the portal and I'm venturing off to use Python, as a test of technology independance. I have found the exercise to be frustrating. I have identified and worked with four partially completed implementations of SOAP in Python. The test process has been useful, because I have identified some minor flaws with the Java implementation, but I am somewhat concerned that the Python community seems so uninterested in SOAP and the associated web services tools, such as WSDL and UDDI. Are web services considered a dead end in the Python community? If so, then what should I be investigating as an alternative? Or, is the Python community just ignoring the industry's attempt to standardized on XML based exchange and interface definitions? Or, was it simply the economic downturn that caused everyone to abandon SOAP in Python? The WebServices implementation at Zope.org looks fairly complete, but I found problems when trying to use it to read and use WSDL definitions from various websites listed in xmethods.net. Opinions, comments, suggestions? From mark@easymailings.com Mon Mar 17 03:37:49 2003 From: mark@easymailings.com (Mark Bucciarelli) Date: Sun, 16 Mar 2003 22:37:49 -0500 Subject: [XML-SIG] SOAP, Web services, hype, and Python In-Reply-To: <200303162227.02230.mmclay@comcast.net> References: <200303162227.02230.mmclay@comcast.net> Message-ID: <200303162237.49789.mark@easymailings.com> On Sunday 16 March 2003 10:27 pm, Michael McLay wrote: [...] > I have identified and worked with four partially completed implementations > of SOAP in Python. If you just want the client, you can use the SOAP.py script from pygoogle (Mark Pilgrim) and the wsdllib.py from Uche. I had to patch wsdllib to work with the latest 4Suite (the patch is in the list archive). > I am somewhat concerned > that the Python community seems so uninterested in SOAP and the associated > web services tools, such as WSDL and UDDI. Are web services considered a > dead end in the Python community? Maybe because xmlrpc is just so drop-dead easy with Python and solves 80% of the problems with 20% of the work? Mark From martin@v.loewis.de Mon Mar 17 06:43:29 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 17 Mar 2003 07:43:29 +0100 Subject: [XML-SIG] SOAP, Web services, hype, and Python In-Reply-To: <200303162227.02230.mmclay@comcast.net> References: <200303162227.02230.mmclay@comcast.net> Message-ID: Michael McLay writes: > Am I being stubborn and they are correct, or is this stuff really > broken and difficult to work with? I think so, yes (more precisely: not broken, just ill-designed). It is so complex that it ain't no fun. Whenever I need RPC, I use CORBA. > Are web services considered a dead end in the Python community? I can't speak for the community in general, but I'll observe that people seem to contribute only things that they need in their own projects. So from the lack of contributions, I'd conclude that nobody really *needs* web services. > If so, then what should I be investigating as an alternative? I'd suggest to use an alternative infrastructure. I'd be curious what kind of service you need to offer, and who the users of that service would be (e.g. are client and server the same organization or different ones, etc). Regards, Martin From mal@lemburg.com Mon Mar 17 08:45:11 2003 From: mal@lemburg.com (M.-A. Lemburg) Date: Mon, 17 Mar 2003 09:45:11 +0100 Subject: [XML-SIG] SOAP, Web services, hype, and Python In-Reply-To: References: <200303162227.02230.mmclay@comcast.net> Message-ID: <3E758B17.4020807@lemburg.com> Martin v. L=F6wis wrote: > Michael McLay writes: >=20 >>Am I being stubborn and they are correct, or is this stuff really >>broken and difficult to work with? >=20 > I think so, yes (more precisely: not broken, just ill-designed). It is > so complex that it ain't no fun. Whenever I need RPC, I use CORBA. >=20 >>Are web services considered a dead end in the Python community? >=20 > I can't speak for the community in general, but I'll observe that > people seem to contribute only things that they need in their own > projects. So from the lack of contributions, I'd conclude that nobody > really *needs* web services. I'll have to object to that. Web services are in wide spread use and the base is getting larger. I agree that getting everything to work isn't easy, which is one of the reasons why Tim Couper and I have developed the Siena Web Services Architecture (http://www.siena-tech.com/) -- it basically does away with all the complicated stuff and lets programmers think about the services themselves rather than all the logistics that go between the using application and the server. --=20 Marc-Andre Lemburg eGenix.com Professional Python Software directly from the Source (#1, Mar 17 2003) >>> Python/Zope Products & Consulting ... http://www.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ Python UK 2003, Oxford: 15 days left EuroPython 2003, Charleroi, Belgium: 99 days left From rsalz@datapower.com Mon Mar 17 11:16:44 2003 From: rsalz@datapower.com (Rich Salz) Date: Mon, 17 Mar 2003 06:16:44 -0500 (EST) Subject: [XML-SIG] SOAP, Web services, hype, and Python In-Reply-To: <200303162227.02230.mmclay@comcast.net> Message-ID: Part of the reason is that folks who are using the various Python SOAP implementations generally find that they just work. I don't know of any UDDI implementations, but the lower layers are fine. You should look at the "Python Web Services" project at SourceForge, http://pywebsvcs.sf.net , and its pywebsvcs-discuss mailing list. /r$ From mark@easymailings.com Mon Mar 17 13:46:48 2003 From: mark@easymailings.com (Mark Bucciarelli) Date: Mon, 17 Mar 2003 08:46:48 -0500 Subject: [XML-SIG] API Docs [was SOAP, Web services, hype, and Python] In-Reply-To: References: Message-ID: <200303170846.48925.mark@easymailings.com> On Monday 17 March 2003 6:16 am, Rich Salz wrote: > You should look at the "Python Web Services" project at SourceForge, > http://pywebsvcs.sf.net , and its pywebsvcs-discuss mailing list. What tool did you use to generate your API docs? Mark From mclay@nist.gov Mon Mar 17 13:56:09 2003 From: mclay@nist.gov (Michael McLay) Date: Mon, 17 Mar 2003 08:56:09 -0500 Subject: [XML-SIG] SOAP, Web services, hype, and Python In-Reply-To: <200303162237.49789.mark@easymailings.com> References: <200303162227.02230.mmclay@comcast.net> <200303162237.49789.mark@easymailings.com> Message-ID: <200303170856.09410.mclay@nist.gov> On Sunday 16 March 2003 10:37 pm, Mark Bucciarelli wrote: > On Sunday 16 March 2003 10:27 pm, Michael McLay wrote: > > [...] > > > I have identified and worked with four partially completed > > implementations of SOAP in Python. > > If you just want the client, you can use the SOAP.py script from pygoogle > (Mark Pilgrim) and the wsdllib.py from Uche. I had to patch wsdllib to > work with the latest 4Suite (the patch is in the list archive). Thanks for the suggestions. I need both client and server sides. I looked at SOAP.py early on in my evaluation. I needed SOAP Messages with Attachments and it did not support this, so I moved on to look at other options. I see adding attachements is on the TODO list. > > I am somewhat concerned > > that the Python community seems so uninterested in SOAP and the > > associated web services tools, such as WSDL and UDDI. Are web services > > considered a dead end in the Python community? > > Maybe because xmlrpc is just so drop-dead easy with Python and solves 80% > of the problems with 20% of the work? It's too bad the SOAP committee continued on past what was done in XML-RPC. This is a classic example of a committee that was designing a horse and created a camel. From uche.ogbuji@fourthought.com Mon Mar 17 14:15:08 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Mon, 17 Mar 2003 07:15:08 -0700 Subject: [XML-SIG] SOAP, Web services, hype, and Python In-Reply-To: Message from Michael McLay of "Sun, 16 Mar 2003 22:27:02 EST." <200303162227.02230.mmclay@comcast.net> Message-ID: Interesting thread. I have but a moment, so scattershot... Michael McLay : > Why is there so little discussion of "web services" on xml-sig? I've read Paul > Prescod's comments on web services verses REST. I generally agree with what > he has written. I've also seen Dave Winer be critical of UDDI/WSDL and the > "moras" that has been created. Unfortunately, my group seems to think this is > the next big thing because Microsoft and IBM are pushing this technology. Am > I being stubborn and they are correct, or is this stuff really broken and > difficult to work with? Many of my recent entries on oreilly.net are apropos, I think: http://www.oreillynet.com/weblogs/author/1054 I have come to the conclusion that until the SOAP and WSDL committees get their acts together and undo some of the damage that was done by the early iteratiosn of the technologies, that this stuff is indeed broken and difficult to work with. And even if they band-aid some of the problems, there is still a fundamental nastiness in SOAP that makes it an obstacle to using the power of XML rather than an asset. Web services folks, many of whom I respect greatly, continue to go through gymnastics to prove the pretend interoperability, as I was reminded at the recent XML Web Services One. But on the other hand, some of the leading lights to the technology themselves have begin to realize that they may have taken an essentially good idea, and botched it. I can tell you that my experience in the field gives the lie to that interoperability, even if I twist my head to the view of RPC that is supposedly the interoperable core. I'll always say that the day WS folks decided to take on CORBA directly is the day they got themselves into the most trouble. > I am working on a project that is attempting to use SOAP to send RosettaNet > messages between web portals. The group is using Java as the primary > implementation of the portal and I'm venturing off to use Python, as a test > of technology independance. I have found the exercise to be frustrating. I > have identified and worked with four partially completed implementations of > SOAP in Python. The test process has been useful, because I have identified > some minor flaws with the Java implementation, but I am somewhat concerned > that the Python community seems so uninterested in SOAP and the associated > web services tools, such as WSDL and UDDI. Are web services considered a dead > end in the Python community? If so, then what should I be investigating as an > alternative? Or, is the Python community just ignoring the industry's attempt > to standardized on XML based exchange and interface definitions? Or, was it > simply the economic downturn that caused everyone to abandon SOAP in Python? I can't speak for others, but I know that have several times had to abandon the partial SOAP implementation in 4Suite, because implementing WS technologies brings me far too close to the ugliness of these technologies, and the itch has never exceeded the repulsion. When I've been forced to use WS in consulting which has been, mercifully, not very often), I have tended to stick to the toolkits thya will be used on the other side: (JAX-RPC or .NET) because I don't believe in WSDL/SOAP interoperability, and my non-belief has been blstered often enough. I had concluded that one day we could simply use ZSI or SOAPpy as a Web services implementation for 4Suite, but I haven't had enough success with either to take that step, yet. > The WebServices implementation at Zope.org looks fairly complete, but I found > problems when trying to use it to read and use WSDL definitions from various > websites listed in xmethods.net. I didn't even know there was one. URL, please? I'd like to mention it on xmlhack, and elsewhere. Surprised it's never been mentioned on zope-xml. "M.-A. Lemburg" : > I'll have to object to that. Web services are in wide spread > use and the base is getting larger. Well, same with Java, but I don't think that means we're all about to jump ship. > I agree that getting everything to work isn't easy, which is one of the > reasons why Tim Couper and I have developed the Siena Web Services > Architecture (http://www.siena-tech.com/) -- it basically does away > with all the complicated stuff and lets programmers think about the > services themselves rather than all the logistics that go between the > using application and the server. Very interesting. Another stealthy project I would have hoped would have come onto the scene a bit more loudly. Seems the only download is for Windows. I'll be watching this one and will give it a try when I can more readily do so (time and technology-wise). Rich Salz: > Part of the reason is that folks who are using the various Python > SOAP implementations generally find that they just work. I don't > know of any UDDI implementations, but the lower layers are fine. Wow. This really surpises me. I've had trouble using ZSI and SOAPpy even on the XMethods toys (e.g. when writing an article), and they have positively colapsed when trying to work with a real-in-the-field Web service implemented with JAX-RPC, .NET or IBM WS Toolkit. My typical experience with ZSI is an inscrutable fault from the other end, or unintelligible results. My typical experience with SOAPpy as been an inscrutable traceback in SOAPpy itself. I'd always assumed that SOAP/WSDL interop were understood works-in-progress with these packaes, so I've always really just shrugged about it. Now that I know that interop i claimed, I guess 'll try to remember to file bug reports if I run into such problems again (which I hope won't be too soon, as I prefer not to work with WS at all). -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Universal Business Language (UBL) - http://www-106.ibm.com/developerworks/xml/library/x-think16.html EXSLT by example - http://www-106.ibm.com/developerworks/library/x-exslt.html The worry about program wizards - http://www.adtmag.com/article.asp?id=7238 Use rdf:about and rdf:ID effectively in RDF/XML - http://www-106.ibm.com/developerworks/xml/library/x-tiprdfai.html Keep context straight in XSLT - http://www-106.ibm.com/developerworks/xml/library/x-tipcurrent.html Python Generators + DOM - http://www.xml.com/pub/a/2003/01/08/py-xml.html Using SAX for Proper XML Output - http://www.xml.com/pub/a/2003/03/12/py-xml.html SAX filters for flexible processing - http://www-106.ibm.com/developerworks/xml/library/x-tipsaxflex.html From mal@lemburg.com Mon Mar 17 14:51:43 2003 From: mal@lemburg.com (M.-A. Lemburg) Date: Mon, 17 Mar 2003 15:51:43 +0100 Subject: [XML-SIG] SOAP, Web services, hype, and Python In-Reply-To: References: Message-ID: <3E75E0FF.7070206@lemburg.com> >>I agree that getting everything to work isn't easy, which is one of the >>reasons why Tim Couper and I have developed the Siena Web Services >>Architecture (http://www.siena-tech.com/) -- it basically does away >>with all the complicated stuff and lets programmers think about the >>services themselves rather than all the logistics that go between the >>using application and the server. > > Very interesting. Another stealthy project I would have hoped would have come > onto the scene a bit more loudly. Seems the only download is for Windows. > I'll be watching this one and will give it a try when I can more readily do so > (time and technology-wise). The "come onto the scene a bit more loudly" bit is in the works :-) The architecture works on Windows, Unix and Java platforms. The enterprise server is currently bound to Unix only. If you attend Python UK, I'll give a talk there explaining many of the details. We'll put the talk up as PDF file after the event. -- Marc-Andre Lemburg eGenix.com Professional Python Software directly from the Source (#1, Mar 17 2003) >>> Python/Zope Products & Consulting ... http://www.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ Python UK 2003, Oxford: 15 days left EuroPython 2003, Charleroi, Belgium: 99 days left From rsalz@datapower.com Mon Mar 17 15:23:05 2003 From: rsalz@datapower.com (Rich Salz) Date: Mon, 17 Mar 2003 10:23:05 -0500 Subject: [XML-SIG] API Docs [was SOAP, Web services, hype, and Python] In-Reply-To: <200303170846.48925.mark@easymailings.com> References: <200303170846.48925.mark@easymailings.com> Message-ID: <3E75E859.9080504@datapower.com> > What tool did you use to generate your API docs? It says at the bottom of the homepage:

The API doc pages were automatically generated by using Teud.

From rsalz@datapower.com Mon Mar 17 15:25:18 2003 From: rsalz@datapower.com (Rich Salz) Date: Mon, 17 Mar 2003 10:25:18 -0500 Subject: [XML-SIG] SOAP, Web services, hype, and Python In-Reply-To: <200303170856.09410.mclay@nist.gov> References: <200303162227.02230.mmclay@comcast.net> <200303162237.49789.mark@easymailings.com> <200303170856.09410.mclay@nist.gov> Message-ID: <3E75E8DE.2080603@datapower.com> > It's too bad the SOAP committee continued on past what was done in XML-RPC. > This is a classic example of a committee that was designing a horse and > created a camel. This is not quite the way it worked. SOAP 1.1 was done by a small group of individuals. Your complaint has validity for SOAP 1.2 :) XML RPC was a "pre-release" of SOAP because Dave Winer got tired of waiting for MSFT to allow their folks to sign-off on SOAP. For myself, SOAP 1.1 hits the sweet spot; XML RPC is too limited and SOAP 1.2 is too yucky. /r$ From tpassin@comcast.net Tue Mar 18 00:37:20 2003 From: tpassin@comcast.net (Thomas B. Passin) Date: Mon, 17 Mar 2003 19:37:20 -0500 Subject: [XML-SIG] SOAP, Web services, hype, and Python References: <3E75E0FF.7070206@lemburg.com> Message-ID: <007901c2ece6$890f9c10$6401a8c0@tbp1> [M.-A. Lemburg] > >>I agree that getting everything to work isn't easy, which is one of the > >>reasons why Tim Couper and I have developed the Siena Web Services > >>Architecture (http://www.siena-tech.com/) -- it basically does away > >>with all the complicated stuff and lets programmers think about the > >>services themselves rather than all the logistics that go between the > >>using application and the server. > > > > Very interesting. Another stealthy project I would have hoped would have come > > onto the scene a bit more loudly. Seems the only download is for Windows. > > I'll be watching this one and will give it a try when I can more readily do so > > (time and technology-wise). > > The "come onto the scene a bit more loudly" bit is in the works :-) > > The architecture works on Windows, Unix and Java platforms. The > enterprise server is currently bound to Unix only. If you attend > Python UK, I'll give a talk there explaining many of the details. > We'll put the talk up as PDF file after the event. > It looks very interesting, but how much will it cost (not the demo version, the real thing)? Cheers, Tom P From noreply@sourceforge.net Tue Mar 18 05:48:27 2003 From: noreply@sourceforge.net (SourceForge.net) Date: Mon, 17 Mar 2003 21:48:27 -0800 Subject: [XML-SIG] [ pyxml-Bugs-705416 ] stylesheetReader.py uses wrong exception type Message-ID: Bugs item #705416, was opened at 2003-03-18 00:48 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=106473&aid=705416&group_id=6473 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Thomas Passin (tpassin) Assigned to: Nobody/Anonymous (nobody) Summary: stylesheetReader.py uses wrong exception type Initial Comment: Lines 66-67 of xslt/stylesheetReader.py read XML_PARSE_ERROR = Ft.Lib.Error.XML_PARSE_ERROR except ImportError: However, for current versions of Ft.Lib, which do not have Error, the exception that gets thrown is a different type (AttributeError). Recommend changing to a more general exception type, possibly even Exception. I found this error trying to make the teud package work. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=106473&aid=705416&group_id=6473 From mark@easymailings.com Tue Mar 18 15:48:59 2003 From: mark@easymailings.com (Mark Bucciarelli) Date: Tue, 18 Mar 2003 10:48:59 -0500 Subject: [XML-SIG] Tim Bray on XML Message-ID: <200303181048.59839.mark@easymailings.com> In case you missed today's post on Slashdot ... XML Is Too Hard For Programmers by Tim Bray http://www.tbray.org/ongoing/When/200x/2003/03/16/XML-Prog So, how does he parse xml? Using regexp! Other points: he finds callback (SAX, I guess) painful, and suggests creating a new idiom for stream processing of XML, one that "abstracts away all the XML syntax weirdness, igoring line-breaks, attribute orders, choice of quotemakrs and so on." Mark From faassen@vet.uu.nl Tue Mar 18 17:51:46 2003 From: faassen@vet.uu.nl (Martijn Faassen) Date: Tue, 18 Mar 2003 18:51:46 +0100 Subject: [XML-SIG] Talk at EuroPython 2003? Message-ID: <20030318175146.GA18469@vet.uu.nl> Hi there, I'm organizing the 'Python Frameworks' track for EuroPython 2003, to be held the end of june in Charleroi, Belgium. http://www.europython.org One of the talks I'd like to have on this track (or alternatively, a tutorial) is a talk about PyXML and/or 4Suite. A talk would be 30 or 45 minutes. A tutorial can be up to 3 hours (but could be shorter). Send me a mail if you're interested. Regards, Martijn From uche.ogbuji@fourthought.com Tue Mar 18 19:01:00 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Tue, 18 Mar 2003 12:01:00 -0700 Subject: [XML-SIG] Tim Bray on XML In-Reply-To: Message from Mark Bucciarelli of "Tue, 18 Mar 2003 10:48:59 EST." <200303181048.59839.mark@easymailings.com> Message-ID: > In case you missed today's post on Slashdot ... > > XML Is Too Hard For Programmers > by Tim Bray > > http://www.tbray.org/ongoing/When/200x/2003/03/16/XML-Prog > > So, how does he parse xml? Using regexp! This is a pretty big exaggeration of Tim's point, I think. I didn't read his blog carefully when he posted it, but he's often said on XML-DEV that he used regexp and Perl for some quick and dirty tasks. And who doesn't? Who hasn't done: fgrep "Bucciarelli" my-contact-list.xml ? I hardly think there's any deep insight there for developers. Yes, Tim sometimes goes beyond that, but he's always been very careful to point out that when it's time to do full, general XML parsing, he uses a proper parser, just like anyone else. > Other points: he finds callback (SAX, I guess) painful, and suggests creating > a new idiom for stream processing of XML, one that "abstracts away all the > XML syntax weirdness, igoring line-breaks, attribute orders, choice of > quotemakrs and so on." Of course SAX already does all the abve except for line breaks, which I don't think should be silently canonicalized by a parser, anyway. Yes, SAX is a bit of a pain for anyone who thinks state diagrams are unfunny cartoons. Luckily there are stream-like alternatives: XMLReader in libxslt and .NET, pulldom in Python (though the latter has some warts). Anyway, I've been rolling my eyes at all the doomsday placards being paraded around lately. I take what you might call the elitist position: if XML is too hard for a programmer, he'd perhaps best get out of the profession. Roughly: http://www.oreillynet.com/pub/wlg/2910 -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Universal Business Language (UBL) - http://www-106.ibm.com/developerworks/xml/l ibrary/x-think16.html EXSLT by example - http://www-106.ibm.com/developerworks/library/x-exslt.html The worry about program wizards - http://www.adtmag.com/article.asp?id=7238 Use rdf:about and rdf:ID effectively in RDF/XML - http://www-106.ibm.com/develo perworks/xml/library/x-tiprdfai.html Keep context straight in XSLT - http://www-106.ibm.com/developerworks/xml/libra ry/x-tipcurrent.html Python Generators + DOM - http://www.xml.com/pub/a/2003/01/08/py-xml.html Using SAX for Proper XML Output - http://www.xml.com/pub/a/2003/03/12/py-xml.ht ml SAX filters for flexible processing - http://www-106.ibm.com/developerworks/xml /library/x-tipsaxflex.html From uche.ogbuji@fourthought.com Tue Mar 18 20:33:35 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Tue, 18 Mar 2003 13:33:35 -0700 Subject: [XML-SIG] [PATCH] wsdllib.py In-Reply-To: Message from Mark Bucciarelli of "Mon, 03 Mar 2003 13:30:45 EST." <200303031330.48377.mark@easymailings.com> Message-ID: > On Monday 03 March 2003 12:35 am, Uche Ogbuji wrote: > > > Is there any chance you could put together a patch to update wsdllib.py > > Patch enclosed below (output of diff -u -b). Please review and comment. I just got thinsg organized again on the wsdl4py project and tried reviewing this patch more closely, but it appears to have been munged. For example there's the hunk: > @@ -50,9 +68,25 @@ > g_faultExpression = xpath.Compile('w:fault') > g_portsExpression = xpath.Compile('w:port') > > -def ReadFromStream(stream): > - """Read in a WSDL message from a steam object""" > +class WsdlException(Exception): > + def __init__(self, msg): > + self.msg = msg > + def __str__(self): > + return self.msg > + > + > +def ReadFromStream(stream, uri='file://' + os.getcwd() + os.sep + 'foo'): > + """Read in a WSDL message from a steam object > + > + 4Suite 0.12 requires a URI when parsing xml data, as it is required to > + resolve XIncludes and entities. It is also required for some XSLT (for > + example xsl:include and xsl:import) and RDF.""" > + > ws = Wsdl() > + if DOMLETTE_UNIFICATION: > + dom = Ft.Xml.Domlette.NonvalidatingReader.parseStream(stream, uri) > + ws.fromDom(dom) > + else: > reader = pDomlette.PyExpatReader() ^^^^^ broken indentation > dom = reader.fromStream(stream) > ws.fromDom(dom) > @@ -68,10 +102,17 @@ > def ReadFromUri(uri): > """Read in a WSDL message from a URI""" > st = urllib.urlopen(uri) > - ws = ReadFromStream(st) > + ws = ReadFromStream(st, uri) > st.close() > return ws > > +def getAttributeNSWrapper(node, namespaceprefix, attribute): > + """Newer stuff uses xml.dom.EMPTY_NAMESPACE (None) instead of ''.""" > + > + if not namespaceprefix and DOMLETTE_UNIFICATION: > + return node.getAttributeNS(xml.dom.EMPTY_NAMESPACE, attribute) > + else: > + return node.getAttributeNS(namespaceprefix, attribute) > > class Wsdl: > """This class represents the entire WSDL definition. It can be created > from one of the above Which, of course, results in broken Python. Could you double-check this patch and re-send as an attachment? OK to send just to me. Thanks. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Universal Business Language (UBL) - http://www-106.ibm.com/developerworks/xml/l ibrary/x-think16.html EXSLT by example - http://www-106.ibm.com/developerworks/library/x-exslt.html The worry about program wizards - http://www.adtmag.com/article.asp?id=7238 Use rdf:about and rdf:ID effectively in RDF/XML - http://www-106.ibm.com/develo perworks/xml/library/x-tiprdfai.html Keep context straight in XSLT - http://www-106.ibm.com/developerworks/xml/libra ry/x-tipcurrent.html Python Generators + DOM - http://www.xml.com/pub/a/2003/01/08/py-xml.html Using SAX for Proper XML Output - http://www.xml.com/pub/a/2003/03/12/py-xml.ht ml SAX filters for flexible processing - http://www-106.ibm.com/developerworks/xml /library/x-tipsaxflex.html From uche.ogbuji@fourthought.com Tue Mar 18 20:38:05 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Tue, 18 Mar 2003 13:38:05 -0700 Subject: [XML-SIG] Talk at EuroPython 2003? In-Reply-To: Message from Martijn Faassen of "Tue, 18 Mar 2003 18:51:46 +0100." <20030318175146.GA18469@vet.uu.nl> Message-ID: > Hi there, > > I'm organizing the 'Python Frameworks' track for EuroPython 2003, to > be held the end of june in Charleroi, Belgium. > > http://www.europython.org > > One of the talks I'd like to have on this track (or alternatively, a tutorial) > is a talk about PyXML and/or 4Suite. > > A talk would be 30 or 45 minutes. A tutorial can be up to 3 hours (but > could be shorter). > > Send me a mail if you're interested. I can't be there ( :-( ), but I have some slides (OpenOffice.org Impress format) that I've been working on that anyone could use if they take on a 4Suite talk or tutorial. I'd be happy to help in other ways as well anyone who takes on a PyXML or 4Suite talk. I'll be using some of it at XML Europe. I really do hope to make it to Europython one of these years. I'd wanted o go to PythonUK, but heard about it too late. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Universal Business Language (UBL) - http://www-106.ibm.com/developerworks/xml/l ibrary/x-think16.html EXSLT by example - http://www-106.ibm.com/developerworks/library/x-exslt.html The worry about program wizards - http://www.adtmag.com/article.asp?id=7238 Use rdf:about and rdf:ID effectively in RDF/XML - http://www-106.ibm.com/develo perworks/xml/library/x-tiprdfai.html Keep context straight in XSLT - http://www-106.ibm.com/developerworks/xml/libra ry/x-tipcurrent.html Python Generators + DOM - http://www.xml.com/pub/a/2003/01/08/py-xml.html Using SAX for Proper XML Output - http://www.xml.com/pub/a/2003/03/12/py-xml.ht ml SAX filters for flexible processing - http://www-106.ibm.com/developerworks/xml /library/x-tipsaxflex.html From mark@easymailings.com Tue Mar 18 20:49:35 2003 From: mark@easymailings.com (Mark Bucciarelli) Date: Tue, 18 Mar 2003 15:49:35 -0500 Subject: [XML-SIG] Tim Bray on XML In-Reply-To: References: Message-ID: <200303181549.35608.mark@easymailings.com> On Tuesday 18 March 2003 2:01 pm, Uche Ogbuji wrote: > I hardly think there's any deep insight there for developers. The insight I got was that when you are planning an application that will have to parse _large_ xml files, it's not efficient to have to load the whole tree into memory. This makes good sense and is a common-sense counter to XML-hype. > Yes, Tim > sometimes goes beyond that, but he's always been very careful to point out > that when it's time to do full, general XML parsing, he uses a proper > parser, just like anyone else. That's not what he says in this article. > Yes, SAX is a bit of a pain for anyone who thinks state diagrams are > unfunny cartoons. Luckily there are stream-like alternatives: XMLReader in > libxslt and .NET, pulldom in Python (though the latter has some warts). Someone said M$ got this right in .NET. Would you care to elaborate on the differences between these approaches and SAX? Mark From malcolm@commsecure.com.au Tue Mar 18 23:52:24 2003 From: malcolm@commsecure.com.au (Malcolm Tredinnick) Date: Wed, 19 Mar 2003 10:52:24 +1100 Subject: [XML-SIG] Tim Bray on XML In-Reply-To: <200303181549.35608.mark@easymailings.com> References: <200303181549.35608.mark@easymailings.com> Message-ID: <20030318235224.GA6304@ws14.commsecure.com.au> On Tue, Mar 18, 2003 at 03:49:35PM -0500, Mark Bucciarelli wrote: > On Tuesday 18 March 2003 2:01 pm, Uche Ogbuji wrote: [...] > > Yes, SAX is a bit of a pain for anyone who thinks state diagrams are > > unfunny cartoons. Luckily there are stream-like alternatives: XMLReader in > > libxslt and .NET, pulldom in Python (though the latter has some warts). > > Someone said M$ got this right in .NET. Would you care to elaborate on the > differences between these approaches and SAX? Not sure about the .NET version (and don't really care), but here is some documentation that Daniel Veillard did for the libxml2 version of XMLTextReader. http://www.xmlsoft.org/xmlreader.html Having started to rewrite portions of a moderately complex application that was using SAX to now use XMLTextReader in the past week or so, I would say that I am fairly impressed. Namespace handling and validation are huge benefits for my situation. The programming model itself feels easier to set up, and slightly less work overall than working with a SAX processor. At the end of the day, you still end up doing "stuff" roughly once for each node in the document; the real benefit of the TextReader interface is that you get a whole bunch of information all at once, rather than having to buffer things up (methods like isEmptyElement and Value is what I am thinking about here). However, I may be biased here -- I find SAX pretty comfortable to work with and I use it a fair bit. Cheers, Malcolm -- Honk if you love peace and quiet. From jh@web.de Wed Mar 19 00:56:41 2003 From: jh@web.de (Juergen Hermann) Date: Wed, 19 Mar 2003 01:56:41 +0100 Subject: [XML-SIG] API Docs [was SOAP, Web services, hype, and Python] In-Reply-To: <200303170846.48925.mark@easymailings.com> Message-ID: On=20Mon,=2017=20Mar=202003=2008:46:48=20-0500,=20Mark=20Bucciarelli=20wro= te: >>=20You=20should=20look=20at=20the=20"Python=20Web=20Services"=20project=20= at=20SourceForge, >>=20http://pywebsvcs.sf.net=20,=20and=20its=20pywebsvcs-discuss=20mailing= =20list. > >What=20tool=20did=20you=20use=20to=20generate=20your=20API=20docs? A=20XML/XSLT=20wrapper=20around=20Python'S=20introspection=20modules. See=20http://purl.net/wiki/python/TeudProject Ciao,=20J=FCrgen From uche.ogbuji@fourthought.com Wed Mar 19 03:34:57 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Tue, 18 Mar 2003 20:34:57 -0700 Subject: [XML-SIG] Tim Bray on XML In-Reply-To: Message from Mark Bucciarelli of "Tue, 18 Mar 2003 15:49:35 EST." <200303181549.35608.mark@easymailings.com> Message-ID: > On Tuesday 18 March 2003 2:01 pm, Uche Ogbuji wrote: > > > I hardly think there's any deep insight there for developers. > > The insight I got was that when you are planning an application that will have > to parse _large_ xml files, it's not efficient to have to load the whole tree > into memory. This makes good sense and is a common-sense counter to > XML-hype. > > > Yes, Tim > > sometimes goes beyond that, but he's always been very careful to point out > > that when it's time to do full, general XML parsing, he uses a proper > > parser, just like anyone else. > > That's not what he says in this article. Then I must say he's gone off the deep end. I haven't had time to follow XMLDEV much lately, but I'm pretty confident Simon St. Laurent or Elliotte Harolde would have flamed him to a crisp for claiming such a thing to be legitimate. I may find a moment to go over there and join in the fun. > > Yes, SAX is a bit of a pain for anyone who thinks state diagrams are > > unfunny cartoons. Luckily there are stream-like alternatives: XMLReader in > > libxslt and .NET, pulldom in Python (though the latter has some warts). > > Someone said M$ got this right in .NET. Would you care to elaborate on the > differences between these approaches and SAX? Perhaps I'll have a moment to do so in the near future. For now all I can offer, wich is not much, is my brief article on PullDOM http://www-106.ibm.com/developerworks/xml/library/x-tipulldom.html -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Universal Business Language (UBL) - http://www-106.ibm.com/developerworks/xml/library/x-think16.html EXSLT by example - http://www-106.ibm.com/developerworks/library/x-exslt.html The worry about program wizards - http://www.adtmag.com/article.asp?id=7238 Use rdf:about and rdf:ID effectively in RDF/XML - http://www-106.ibm.com/developerworks/xml/library/x-tiprdfai.html Keep context straight in XSLT - http://www-106.ibm.com/developerworks/xml/library/x-tipcurrent.html Python Generators + DOM - http://www.xml.com/pub/a/2003/01/08/py-xml.html Using SAX for Proper XML Output - http://www.xml.com/pub/a/2003/03/12/py-xml.html SAX filters for flexible processing - http://www-106.ibm.com/developerworks/xml/library/x-tipsaxflex.html From uche.ogbuji@fourthought.com Wed Mar 19 03:49:43 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Tue, 18 Mar 2003 20:49:43 -0700 Subject: [XML-SIG] Tim Bray on XML In-Reply-To: Message from Mark Bucciarelli of "Tue, 18 Mar 2003 15:49:35 EST." <200303181549.35608.mark@easymailings.com> Message-ID: > On Tuesday 18 March 2003 2:01 pm, Uche Ogbuji wrote: > > > I hardly think there's any deep insight there for developers. > > The insight I got was that when you are planning an application that will have > to parse _large_ xml files, it's not efficient to have to load the whole tree > into memory. This makes good sense and is a common-sense counter to > XML-hype. > > > Yes, Tim > > sometimes goes beyond that, but he's always been very careful to point out > > that when it's time to do full, general XML parsing, he uses a proper > > parser, just like anyone else. > > That's not what he says in this article. I just had a bit of a more careful read to see if Tim Bray could realy have said such a thing, and I'm not sure where you got that he did. He said that he uses Perl for output. All very well. He uses Perl n some cases to do read and processing. He doesn't say any particular sort of red/process, but I see no reason to believe he means anything unreasonable. He then goes on to point out that in some cases he does use a full XML parser, as I would expect. Again, I'm not sure how anyone would draw anything particularly special from these thoughts. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Universal Business Language (UBL) - http://www-106.ibm.com/developerworks/xml/library/x-think16.html EXSLT by example - http://www-106.ibm.com/developerworks/library/x-exslt.html The worry about program wizards - http://www.adtmag.com/article.asp?id=7238 Use rdf:about and rdf:ID effectively in RDF/XML - http://www-106.ibm.com/developerworks/xml/library/x-tiprdfai.html Keep context straight in XSLT - http://www-106.ibm.com/developerworks/xml/library/x-tipcurrent.html Python Generators + DOM - http://www.xml.com/pub/a/2003/01/08/py-xml.html Using SAX for Proper XML Output - http://www.xml.com/pub/a/2003/03/12/py-xml.html SAX filters for flexible processing - http://www-106.ibm.com/developerworks/xml/library/x-tipsaxflex.html From uche.ogbuji@fourthought.com Wed Mar 19 03:54:34 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Tue, 18 Mar 2003 20:54:34 -0700 Subject: [XML-SIG] Tim Bray on XML In-Reply-To: Message from Uche Ogbuji of "Tue, 18 Mar 2003 20:49:43 MST." Message-ID: > > On Tuesday 18 March 2003 2:01 pm, Uche Ogbuji wrote: > > > > > I hardly think there's any deep insight there for developers. > > > > The insight I got was that when you are planning an application that will have > > to parse _large_ xml files, it's not efficient to have to load the whole tree > > into memory. This makes good sense and is a common-sense counter to > > XML-hype. > > > > > Yes, Tim > > > sometimes goes beyond that, but he's always been very careful to point out > > > that when it's time to do full, general XML parsing, he uses a proper > > > parser, just like anyone else. > > > > That's not what he says in this article. > > I just had a bit of a more careful read to see if Tim Bray could realy have > said such a thing, and I'm not sure where you got that he did. He said that > he uses Perl for output. All very well. He uses Perl n some cases to do read > and processing. He doesn't say any particular sort of red/process, but I see > no reason to believe he means anything unreasonable. He then goes on to point > out that in some cases he does use a full XML parser, as I would expect. > > Again, I'm not sure how anyone would draw anything particularly special from > these thoughts. Just a disclaimer here: I don't wth to disparage Tim's article, which I think is quite reasonable. My reaction is more to the spin that I felt Mark might be putting on the article, which I thought was a surprisingly intense interpretation of the article. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Universal Business Language (UBL) - http://www-106.ibm.com/developerworks/xml/library/x-think16.html EXSLT by example - http://www-106.ibm.com/developerworks/library/x-exslt.html The worry about program wizards - http://www.adtmag.com/article.asp?id=7238 Use rdf:about and rdf:ID effectively in RDF/XML - http://www-106.ibm.com/developerworks/xml/library/x-tiprdfai.html Keep context straight in XSLT - http://www-106.ibm.com/developerworks/xml/library/x-tipcurrent.html Python Generators + DOM - http://www.xml.com/pub/a/2003/01/08/py-xml.html Using SAX for Proper XML Output - http://www.xml.com/pub/a/2003/03/12/py-xml.html SAX filters for flexible processing - http://www-106.ibm.com/developerworks/xml/library/x-tipsaxflex.html From mark@easymailings.com Wed Mar 19 12:42:52 2003 From: mark@easymailings.com (Mark Bucciarelli) Date: Wed, 19 Mar 2003 07:42:52 -0500 Subject: [XML-SIG] Tim Bray on XML In-Reply-To: References: Message-ID: <200303190742.52459.mark@easymailings.com> On Tuesday 18 March 2003 10:49 pm, Uche Ogbuji wrote: > > On Tuesday 18 March 2003 2:01 pm, Uche Ogbuji wrote: > > > I hardly think there's any deep insight there for developers. > > > > The insight I got was that when you are planning an application that will > > have to parse _large_ xml files, it's not efficient to have to load the > > whole tree into memory. This makes good sense and is a common-sense > > counter to XML-hype. > > > > > Yes, Tim > > > sometimes goes beyond that, but he's always been very careful to point > > > out that when it's time to do full, general XML parsing, he uses a > > > proper parser, just like anyone else. > > > > That's not what he says in this article. > > I just had a bit of a more careful read to see if Tim Bray could realy have > said such a thing, and I'm not sure where you got that he did. The way I read it, the majority of his recent XML work is processing large input streams of XML and that regexp is the best solution he has found. I didn't mean it as doomsday, rather as a data point that xml api's could be simpler. You're right that my reaction was a bit "intense." The opinion he offers jibes with my own experiences and flows counter to XML marketing hype. I've made some decisions and recommendations at work recently that run counter to a similar kind of marketing hype, so I was excited to read his perspecitve. I'm reading up on how libxml2's XmlTextReader does it ... Mark From uche.ogbuji@fourthought.com Wed Mar 19 15:18:46 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Wed, 19 Mar 2003 08:18:46 -0700 Subject: [XML-SIG] Tim Bray on XML In-Reply-To: Message from Mark Bucciarelli of "Wed, 19 Mar 2003 07:42:52 EST." <200303190742.52459.mark@easymailings.com> Message-ID: > > I just had a bit of a more careful read to see if Tim Bray could realy have > > said such a thing, and I'm not sure where you got that he did. > > The way I read it, the majority of his recent XML work is processing large > input streams of XML and that regexp is the best solution he has found. > > I didn't mean it as doomsday, rather as a data point that xml api's could be > simpler. > > You're right that my reaction was a bit "intense." The opinion he offers > jibes with my own experiences and flows counter to XML marketing hype. I've > made some decisions and recommendations at work recently that run counter to > a similar kind of marketing hype, so I was excited to read his perspecitve. Mostly fair enough, except that I'm not sure what you mean by "XML marketing hype". Maybe you mean the hype of some particular company, but I haven't heard of anyone *credible* saying that XML excuses programmers of care about data. The word I've always heard about XML is that it helps good developers do their job better. This does not add up to any magic. Certainly, in my wide consulting in which I've used XML, I've found this claim easily proved. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Universal Business Language (UBL) - http://www-106.ibm.com/developerworks/xml/l ibrary/x-think16.html EXSLT by example - http://www-106.ibm.com/developerworks/library/x-exslt.html The worry about program wizards - http://www.adtmag.com/article.asp?id=7238 Use rdf:about and rdf:ID effectively in RDF/XML - http://www-106.ibm.com/develo perworks/xml/library/x-tiprdfai.html Keep context straight in XSLT - http://www-106.ibm.com/developerworks/xml/libra ry/x-tipcurrent.html Python Generators + DOM - http://www.xml.com/pub/a/2003/01/08/py-xml.html Using SAX for Proper XML Output - http://www.xml.com/pub/a/2003/03/12/py-xml.ht ml SAX filters for flexible processing - http://www-106.ibm.com/developerworks/xml /library/x-tipsaxflex.html From nicogrubert@web.de Thu Mar 20 15:30:19 2003 From: nicogrubert@web.de (Nico Grubert) Date: Thu, 20 Mar 2003 16:30:19 +0100 Subject: [XML-SIG] XML Validator for Python validating .xml file against .xsd file Message-ID: <200303201530.h2KFUJ203285@mailgate5.cinetic.de> Hello, I have created some XML documents which need to be validated against a given .xsd file. I found this page very helpful: http://apps.gotdotnet.com/xmltools/xsdvalidator/ that allows me to do this online. Now, I am wondering, if there is a similiar tool for python which allows me to validate a .xml file against a given .xsd schema file. Is there such a tool available for python ? thanks in advance, best regards, - nico ______________________________________________________________________________ Finger wund tippen beim SMS Schreiben? Schluss damit! Web.de FreeMail - http://freemail.web.de/features/?mc=021148 From ht@cogsci.ed.ac.uk Thu Mar 20 15:34:19 2003 From: ht@cogsci.ed.ac.uk (Henry S. Thompson) Date: 20 Mar 2003 15:34:19 +0000 Subject: [XML-SIG] XML Validator for Python validating .xml file against .xsd file In-Reply-To: <200303201530.h2KFUJ203285@mailgate5.cinetic.de> References: <200303201530.h2KFUJ203285@mailgate5.cinetic.de> Message-ID: "Nico Grubert" writes: > Hello, > > I have created some XML documents which need to be validated against a given .xsd file. > > I found this page very helpful: > http://apps.gotdotnet.com/xmltools/xsdvalidator/ > that allows me to do this online. > > > Now, I am wondering, if there is a similiar tool for python which allows me to validate a .xml file against a given .xsd schema file. > > Is there such a tool available for python ? XSV [1] was the first free XML Schema validator, and it still measures up pretty well against the alternatives [2]. It's written in Python, and available under the GPL. ht [1] http://www.ltg.ed.ac.uk/~ht/xsv-status.html [2] http://www.w3.org/XML/Schema.html#Tools -- Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh Half-time member of W3C Team 2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440 Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk URL: http://www.ltg.ed.ac.uk/~ht/ [mail really from me _always_ has this .sig -- mail without it is forged spam] From gotcha@swing.be Thu Mar 20 15:35:37 2003 From: gotcha@swing.be (Godefroid Chapelle) Date: Thu, 20 Mar 2003 16:35:37 +0100 Subject: [XML-SIG] Last Despaired CFP ;-) - April Zope3 sprint Message-ID: <3E79DFC9.9020108@swing.be> First I want to apologize again for the cross-post, but I am reallly trying to foster some particpation for development of Zope3. As most of you already know, a Zope3 sprint is organized in Louvain-la-Neuve(LLN) Belgium, April 8-11 2003 by BubbleNet offices. Two topics are targetted : I18n and XML integration. Currently, Jim Fulton, Paul Everitt, Martijn Faassen and Pierre-Julien Grizel are confirmed. As there is room for 8 developers in offices and at least one confortable bed free by my house, I issue this last call for participants. Please see http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/LouvainLaNeuveSprint for more details. Do not hesitate to contact one of us. Please contact me ASAP if you want to join us. -- Godefroid Chapelle BubbleNet sprl rue Victor Horta, 18 / 202 1348 Louvain-la-Neuve Belgium Tel + 32 (10) 459901 Mob + 32 (477) 363942 TVA 467 093 008 RC Niv 49849 From jh@web.de Thu Mar 20 18:45:58 2003 From: jh@web.de (Juergen Hermann) Date: Thu, 20 Mar 2003 19:45:58 +0100 Subject: [XML-SIG] XML Validator for Python validating .xml file against .xsd file In-Reply-To: <200303201530.h2KFUJ203285@mailgate5.cinetic.de> Message-ID: On=20Thu,=2020=20Mar=202003=2016:30:19=20+0100,=20Nico=20Grubert=20wrote: >Now,=20I=20am=20wondering,=20if=20there=20is=20a=20similiar=20tool=20for=20= python=20which=20 allows=20me=20to=20validate=20a=20.xml=20file=20against=20a=20given=20.xsd= =20schema=20file. I=20never=20tried=20it=20myself,=20but=20in=20theory=20the=20newest=20PIRX= X=20release=20based=20 on=20Xerces=202.1.0=20should=20be=20able=20to=20validate=20against=20.xsd.= http://pirxx.sourceforge.net/ http://download.sourceforge.net/pirxx/pirxx-1.3.tar.gz Ciao,=20J=FCrgen -- J=FCrgen=20Hermann,=20Developer WEB.DE=20AG,=20http://webde-ag.de/ From nicogrubert@web.de Fri Mar 21 10:11:27 2003 From: nicogrubert@web.de (Nico Grubert) Date: Fri, 21 Mar 2003 11:11:27 +0100 Subject: [XML-SIG] how to use XSV in python to validate an xml file against an xsd schema file Message-ID: <200303211011.h2LABR210155@mailgate5.cinetic.de> hello, i played around with XSV. I have installed it on win2000 and run the XSV f= ile from the command line passing an xml file and and xsd schema file. how can i use XSV in python =3F I tried: """ # validateTestXML.py from XSV.driver import runitAndShow xmlfile =3D "myxmlfile.xml" schemafile =3D "myxsdfile.xsd" res =3D runitAndShow( xmlfile, schemafile ) print res """ but python does not print out anything. how can I print, if the validation= brought errors or not =3F has anybody ever used it directly in python =3F thanks in advance -nico =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F Jetzt 52 verschiedene Briefpapiere f=FCr Ihre E-Mails bei WEB.DE FreeMail - http://freemail.web.de/features/=3Fmc=3D021140 From mark@easymailings.com Fri Mar 21 17:31:39 2003 From: mark@easymailings.com (Mark Bucciarelli) Date: Fri, 21 Mar 2003 12:31:39 -0500 Subject: [XML-SIG] SOAPpy 0.9.8 Message-ID: <200303211231.40013.mark@easymailings.com> Didn't see it mentioned here ... SOAPpy 0.9.8 was released on the 12th. From cstrong@arielpartners.com Fri Mar 21 19:24:57 2003 From: cstrong@arielpartners.com (Craeg K Strong) Date: Fri, 21 Mar 2003 14:24:57 -0500 Subject: [XML-SIG] Advice on how to deal with locking problems using python-wrapped C libs in MT frameworks like Zope/Twisted? Message-ID: <3E7B6709.3050409@arielpartners.com> Hello: I am attempting to plug in Python bindings for C/C++ based XML frameworks like Sablotron, libxslt, and Xalan/C into Zope. I am noticing lockup/timeout behavior whenever the integration framework calls back out to Zope. For example, consider the following XSLT transformer: In this case, libxslt is calling back out to Zope to resolve the relative url "../simple.xsl" and that is when the lockup occurs. I don't have these problems with 4Suite, perhaps because it is pure Python? My guess is that the Python wrappers might be using the Global Interpreter Lock in such a way that Zope gets locked out trying to access the file resource? My question: has anyone else had to deal with such issues? Do you think something like using asyncore or just creating a worker thread for the Python wrapper might make a difference? I am planning on trying these strategies out, myself, I just wanted to see if there was some other poor soul out there who has already dealt with such issues. Thanks very much, --Craeg From martin@v.loewis.de Fri Mar 21 22:17:20 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 21 Mar 2003 23:17:20 +0100 Subject: [XML-SIG] Advice on how to deal with locking problems using python-wrapped C libs in MT frameworks like Zope/Twisted? In-Reply-To: <3E7B6709.3050409@arielpartners.com> References: <3E7B6709.3050409@arielpartners.com> Message-ID: Craeg K Strong writes: > I am noticing lockup/timeout behavior whenever the integration > framework calls back out to Zope. It is crucial to determine whether they are lockup (won't terminate on its own) or timeout (will terminate after some time) problems. > My guess is that the Python wrappers might be using the Global > Interpreter Lock in such a way that Zope gets locked out trying to > access the file resource? If it is a timeout, this likely is not the cause - you would get a deadlock with that, and a deadlock would stay indefinitely. > My question: has anyone else had to deal with such issues? Most certainly. Usually, a slowdown is caused by somebody trying to resolve URLs, contacting remote systems in the process. > Do you think something like using asyncore or just creating a worker > thread for the Python wrapper might make a difference? Uncertain. You should try to understand the problem first. Regards, Martin From uche.ogbuji@fourthought.com Fri Mar 21 22:40:34 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Fri, 21 Mar 2003 15:40:34 -0700 Subject: [XML-SIG] SOAPpy 0.9.8 In-Reply-To: Message from Mark Bucciarelli of "Fri, 21 Mar 2003 12:31:39 EST." <200303211231.40013.mark@easymailings.com> Message-ID: > Didn't see it mentioned here ... SOAPpy 0.9.8 was released on the 12th. Thanks. I wouldn't have known if you hadn't mentioned this. It wasn't even mentioned in the Web Services for Python forums or news section. I did mention it on xmlhack, but I had to spelunk into the CVSWeb in order to figure out what had changed. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Universal Business Language (UBL) - http://www-106.ibm.com/developerworks/xml/l ibrary/x-think16.html EXSLT by example - http://www-106.ibm.com/developerworks/library/x-exslt.html The worry about program wizards - http://www.adtmag.com/article.asp?id=7238 Use rdf:about and rdf:ID effectively in RDF/XML - http://www-106.ibm.com/develo perworks/xml/library/x-tiprdfai.html Keep context straight in XSLT - http://www-106.ibm.com/developerworks/xml/libra ry/x-tipcurrent.html Python Generators + DOM - http://www.xml.com/pub/a/2003/01/08/py-xml.html Using SAX for Proper XML Output - http://www.xml.com/pub/a/2003/03/12/py-xml.ht ml SAX filters for flexible processing - http://www-106.ibm.com/developerworks/xml /library/x-tipsaxflex.html From ht@cogsci.ed.ac.uk Sat Mar 22 11:34:27 2003 From: ht@cogsci.ed.ac.uk (Henry S. Thompson) Date: 22 Mar 2003 11:34:27 +0000 Subject: [XML-SIG] how to use XSV in python to validate an xml file against an xsd schema file In-Reply-To: <200303211011.h2LABR210155@mailgate5.cinetic.de> References: <200303211011.h2LABR210155@mailgate5.cinetic.de> Message-ID: "Nico Grubert" writes: > hello, > > i played around with XSV. I have installed it on win2000 and run the XSV file from the command line passing an xml file and and xsd schema file. > > how can i use XSV in python ? > > I tried: > > """ > # validateTestXML.py > > from XSV.driver import runitAndShow > > xmlfile = "myxmlfile.xml" > schemafile = "myxsdfile.xsd" > > res = runitAndShow( xmlfile, schemafile ) > print res > > """ > > but python does not print out anything. how can I print, if the > validation brought errors or not ? > > has anybody ever used it directly in python ? As its name suggests, runitAndShow does the output itself, but it goes to stderr, so you may have just never seen it. Also note the second argument is a list, so you need to say >>> runitAndShow(xmlfile,[schemafile]) For your purposes, you want to do """ # validateTestXML.py from XSV.driver import runit import sys xmlfile = "myxmlfile.xml" schemafile = "myxsdfile.xsd" res = runit( xmlfile, [schemafile] ) res.printme(sys.stdout) """ -- Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh Half-time member of W3C Team 2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440 Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk URL: http://www.ltg.ed.ac.uk/~ht/ [mail really from me _always_ has this .sig -- mail without it is forged spam] From dug@acanthusfm.co.uk Sun Mar 23 07:02:41 2003 From: dug@acanthusfm.co.uk (dug@acanthusfm.co.uk) Date: Sun, 23 Mar 03 07:02:41 GMT Subject: [XML-SIG] Cell phone antenna boosters. Under ten bucks. qmkbpepajxcbulvgm i Message-ID: This is a multi-part message in MIME format. --DF0C5A05D11_E_F.DF.__5DE Content-Type: text/html Content-Transfer-Encoding: quoted-printable

Many of us, have the annoying problem of our cell phones going in and o= ut of service. This is not a good thing, nobody likes losing service in the middle of an important phone call. There is though, an extremly cheap and effective way to solve this problem= *As seen on TV* "The Cell Phone Antenna Booster". This product will increase your signal by 300% All for under $10.00 To Buy now or read more about our product, CLICK HERE

kinahn b ybgvd ixwrzbycwhka bq vfg jo z --DF0C5A05D11_E_F.DF.__5DE-- From ht@cogsci.ed.ac.uk Sun Mar 23 14:13:55 2003 From: ht@cogsci.ed.ac.uk (Henry S. Thompson) Date: 23 Mar 2003 14:13:55 +0000 Subject: [XML-SIG] how to use XSV in python to validate an xml file against an xsd schema file In-Reply-To: References: <200303211011.h2LABR210155@mailgate5.cinetic.de> Message-ID: ht@cogsci.ed.ac.uk (Henry S. Thompson) writes: > res.printme(sys.stdout) That should have been res[0].printme(sys.stdout) ht -- Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh Half-time member of W3C Team 2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440 Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk URL: http://www.ltg.ed.ac.uk/~ht/ [mail really from me _always_ has this .sig -- mail without it is forged spam] From FYI@mail.com Sun Mar 23 11:06:40 2003 From: FYI@mail.com (Joyce Bryant) Date: Sun, 23 Mar 03 11:06:40 GMT Subject: [XML-SIG] The American Hospital Directory Message-ID: This is a multi-part message in MIME format. ------=_NextPart_000_7ECB_335AF2F5.2E0EE5F Content-Type: text/plain Content-Transfer-Encoding: 7Bit "A most useful tool for anyone in the healthcare field" Tom Livingstone, Pres. AHCA The new 2003 edition of the American Hospital Directory is out! It includes comprehensive and updated information on hospital ownership, beds, employees, discharges, admissions, senior staff listings, specialized services, email addresses and much more. The cost of the directory is $285. To order the American Hospital Directory, please print this email, complete the information below and fax it to 905-751-0199 (tel: 905-751-0919). Infosource Group is a leading information publishing firm with offices in North America and Europe. Name: Title: Organization: Address: City: Postal: Tel: Fax: email: To unsubscribe: Send a blank email to: FYI@mail.com with "Remove" in the subject line. ------=_NextPart_000_7ECB_335AF2F5.2E0EE5F-- From cstrong@arielpartners.com Mon Mar 24 05:17:34 2003 From: cstrong@arielpartners.com (Craeg K Strong) Date: Mon, 24 Mar 2003 00:17:34 -0500 Subject: [XML-SIG] Redhat RPM for PyXML 0.8.2? Message-ID: <3E7E94EE.6030706@arielpartners.com> Hello: My Red Hat 8.0 system comes with PyXML 0.7.1 installed as an RPM. there is also a bunch of printconf stuff that depends on PyXML. Can anyone give me advice on how to upgrade to PyXML 0.8.2? - Is there a redhat RPM available anywhere? - Is there someone I can beg and plead to make one for me :-) - Has someone else gone through the pain of "RPM-hell" and manually updated without losing the ability to print or compromising other system software? Thanks very much in advance, --Craeg From martin@v.loewis.de Mon Mar 24 06:37:44 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 24 Mar 2003 07:37:44 +0100 Subject: [XML-SIG] Redhat RPM for PyXML 0.8.2? In-Reply-To: <3E7E94EE.6030706@arielpartners.com> References: <3E7E94EE.6030706@arielpartners.com> Message-ID: Craeg K Strong writes: > My Red Hat 8.0 system comes with PyXML 0.7.1 installed as an RPM. > there is also a bunch of printconf stuff that depends on PyXML. Can > anyone give me advice on how to upgrade to PyXML 0.8.2? - Is there a > redhat RPM available anywhere? Not that I know of. > - Is there someone I can beg and plead to make one for me :-) You can make it yourself. Unpack the source distribution, and invoke "python setup.py bdist_rpm". > - Has someone else gone through the pain of "RPM-hell" and manually > updated without losing the ability to print or compromising other system > software? I would advise against this. Just build an RPM and install it. Regards, Martin From cstrong@arielpartners.com Mon Mar 24 07:29:04 2003 From: cstrong@arielpartners.com (Craeg K Strong) Date: Mon, 24 Mar 2003 02:29:04 -0500 Subject: [XML-SIG] Advice on how to deal with locking problems using python-wrapped C libs in MT frameworks like Zope/Twisted? In-Reply-To: References: <3E7B6709.3050409@arielpartners.com> Message-ID: <3E7EB3C0.3020205@arielpartners.com> Thanks for responding to my query! Martin v. L=F6wis wrote: >Craeg K Strong writes: > =20 > >>I am noticing lockup/timeout behavior whenever the integration >>framework calls back out to Zope. >> >>It is crucial to determine whether they are lockup (won't terminate on >>its own) or timeout (will terminate after some time) problems. >> =20 >> Pyana 0.8 locks up and never returns.=20 GNOME libxslt 1.0.27 times out after a minute or two. >>My guess is that the Python wrappers might be using the Global >>Interpreter Lock in such a way that Zope gets locked out trying to >>access the file resource? >> =20 >> >If it is a timeout, this likely is not the cause - you would get a >deadlock with that, and a deadlock would stay indefinitely. > Understood. >>My question: has anyone else had to deal with such issues? =20 >> =20 >> >Most certainly. Usually, a slowdown is caused by somebody trying to >resolve URLs, contacting remote systems in the process. > Yes. But these problems are occuring in my unit test suite. All of my=20 unit tests refer to local URLs either absolute "localhost:8080/foo/bar...." or relative URLs=20 "../foo/bar" I get the same results whether I am using real Zope or unit tests via ZopeTestCase. >>Do you think something like using asyncore or just creating a worker >>thread for the Python wrapper might make a difference? >> >>Uncertain. You should try to understand the problem first. >> Yes. Based on the above information, can you suggest a direction of=20 inquiry? I thought about using the python threading primitives so I could invoke=20 the XSLT transformation in another thread and wait for it to complete or timeout, grabbing the=20 (string) result from a known place once it is complete. Do you think this technique might be=20 helpful in either case? Thanks very much, --Craeg From xml-sig@python.org Mon Mar 24 08:29:38 2003 From: xml-sig@python.org (Albert Chin) Date: Mon, 24 Mar 2003 02:29:38 -0600 Subject: [XML-SIG] Using xmlproc to validate Message-ID: <20030324082938.GA40837@spuckler.il.thewrittenword.com> I'd like to install a custom handler to set the path or open file handle of the external DTD specified in my XML file using xmlproc. How do I do this? EntityResolver is in the Todo list for drv_xmlproc.py so I guess the setEntityResolver method is not an option (and, looking at SF, bug #609590). -- albert chin (china@thewrittenword.com) From DWoffers@jenny.ew01.com Sun Mar 23 22:17:13 2003 From: DWoffers@jenny.ew01.com (Free Coffee) Date: Sun, 23 Mar 2003 14:17:13 -0800 (PST) Subject: [XML-SIG] Try Gevalia Kaffe brewed in a FREE 12-cup Coffeemaker. Message-ID: <200303232217.OAA30182@jenny.ew01.com> --MIME_BOUNDARY-25650-0-1048473902 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline GEVALIA KAFFE < http://jenny.ew01.com/m/l?2b9-47k8-4-1khp-lxmah > Gev= alia Kaffe Photo of Coffee Maker Our Guarantee to You: Your satisfaction is unconditionally guaranteed. We You You may cancel your service at any time. Photo of Coffee Cup A special offer for the discriminating coffee drinker. Indulge your passion for coffee. Select two 1/2-lb. packages of smooth, aromatic Gevalia Kaffe for only $14.95, including shipping and handling, and with your initial shipment we'll deliver a 12-cup Automatic Drip Coffeemaker and two matching ceramic mugs as a FREE GIFT. Our elegant 12-cup coffeemaker is available in black, white or green and brews our extraordinary coffees to perfection. The ceramic mugs (with our gold Gevalia logo) come in your choice of colors =97 blue, white, green, burgundy and black. So, take advantage of this exclusive offer from Gevalia for only $14.95 and you'll receive: two 1/2-lb. packages of Gevalia Kaffe, a 12-Cup Automatic Drip Coffeemaker FREE, two matching Ceramic Mugs FREE, a Gevalia Gift Catalog. (Total retail value: $75) It's time to capture your personal taste preferences in every cup with a tradition of excellence that's been more than 100 years in the making. Just < http://jenny.ew01.com/m/l?2b9-47k8-5-1khp-lxmah = > click here to learn more about this special introductory offer from Gevalia. < http://jenny.ew01.com/m/l?2b9-47k8-6-1khp-lxmah > Cli= ck Here To receive your fine Gevalia coffee and this FREE gift. Please Note the Following Restrictions: =95 Offer is only valid for NEW MEMBERS of Gevalia Kaffe and is only open to residents of the U.S., Virgin Islands and Puerto Rico. =95 Limit one Gevalia Kaffe membership per household. =95 Offer is valid while supplies last. Gevalia Kaffe reserves the right to substitute a free gift of equal or greater value when limited supplies are exceeded. =95 Orders are subject to approval. =95 This offer expires You have received this offer as a result of your membership in an opt-in mailing list. Please contact the list directly if you do not wish to receive offers of this type. To unsubscribe, go to: http://jenny.ew01.com/remove?r.DWoffers.0-1375ea5-251c.python.org.-xml-sig= ?r or, send a blank message to: mailto:r.DWoffers.0-1375ea5-251c.python.org.-xml-sig@jenny.ew01.com= --MIME_BOUNDARY-25650-0-1048473902 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline GEVALIA KAFFE
=09
=09 =09=09 =09=09 =09=09 =09 =09 =09=09=09 =09 =09 =09=09 =09=09 =09=09 =09 =09=09
3D"Gevalia=
3D"Photo
3D"Our
3D"Your
3D"We'll
3D"You'll
3D"You
3D"Photo
=09=09=09 =09 =09=09=09=09=09 =09=09=09=09=09 =09=09=09=09=09=09 =09=09=09=09=09=09 =09=09=09 =09=09=09=09=09 =09=09=09=09=09=09 =09=09=09=09=09=09 =09=09=09=09=09 =09=09=09=09=09 =09=09=09=09=09 =09=09 =09=09=09=09=09 =09=09=09=09=09 =09=09=09=09=09 =09=09=09=09=09 =09=09=09=09=09 =09=09=09=09=09 =09=09=09=09=09 =09=09=09=09

A special offer for the discriminating coffee d= rinker.

Indulge your passion for coffee. Select two 1/2-lb. packages of s= mooth, aromatic=20 =09=09=09=09=09=09=09 Gevalia Kaffe for only $14.95, including shipping and = handling, and with your initial=20 =09=09=09=09=09=09=09 shipment we'll deliver a 12-cup Automatic Drip Coffeemaker and two m= atching ceramic mugs =09=09=09=09=09=09=09 as a FREE GIFT.

Our elegant 12-cup coffeemaker is available in black, white or gr= een and brews our=20 =09=09=09=09=09=09=09 extraordinary coffees to perfection. The ceramic mugs (with our gol= d Gevalia logo)=20 =09=09=09=09=09=09=09 come in your choice of colors =97 blue, white, green, burgundy and b= lack.

=09=09=09 =09=09=09=09=09=09=09

So, take advantage of this exclusive offer from= Gevalia=20 for only $14.95 and you'll receive:

two 1/2-lb. packa= ges
of Gevalia Kaffe,
a 12-Cup Automati= c
Drip Coffeemaker FREE,
two matching
C= eramic Mugs FREE,
a Gevalia Gift Ca= talog.
(Total retail value: $75)<= /td> =09=09=09=09=09=09

It's time to capture your personal taste preferences in every cup= with a tradition=20 of excellence that's been more than 100 years in the making. Just click here to learn=20 more about this special introductory offer from Gevalia.

3D"Click
3D"To=
=09
=09 =09=09=09=09=09 =09=09=09=09=09 =09=09=09=09=09 =09=09=09=09=09 =09=09=09=09=09 =09=09=09=09=09 =09=09=09=09=09 =09=09=09=09=09 =09=09=09=09=09 =09=09=09=09=09 =09=09=09=09=09

Please Note the Following Restri= ctions:

=95

Offer is only va= lid for NEW MEMBERS of Gevalia Kaffe and is only open to residents of the U= .S., Virgin Islands and Puerto Rico.

=95

Limit one Gevali= a Kaffe membership per household.

=95

Offer is valid w= hile supplies last. Gevalia Kaffe reserves the right to substitute a free g= ift of equal or greater value when limited supplies are exceeded.

=95

Orders are subje= ct to approval.

=95

This offer expir= es <1 week from mail date.>

You have received this offer as = a result of your membership in an opt-in mailing list. Please contact the l= ist directly if you do not wish to receive offers of this type.

=09=09=09 =09=09=09=09
=09=09=09=09

To unsubscribe from this mailing list: click here
or send a blank message to: r.DWoffers.0-1375ea5-251c= .python.org.-xml-sig@jenny.ew01.com

3D"" --MIME_BOUNDARY-25650-0-1048473902-- From hendry@cs.helsinki.fi Mon Mar 24 09:42:25 2003 From: hendry@cs.helsinki.fi (Kai Hendry) Date: Mon, 24 Mar 2003 11:42:25 +0200 Subject: [XML-SIG] lost Message-ID: <20030324094225.GA1199@cs.helsinki.fi> I am just getting started with XML processing in python, and now I need to do something a little more complicated, and I staring at: http://www.python.org/doc/current/lib/markup.html And wondering what to use! Preferably something within the default python2.2 distribution. Here is something I would like to do, to a piece of XML, with the 'p?' tags: case 1:

we are coming along

case 2: Trouble in

tinseltown

yada
case 1: I want to return: we are coming along ignore the div attr. grab all the words between the tags, no matter what other tags are there. Be nice to know what tags are being ignored. case 2: Trouble in tinseltown yada It ignores the nested p tag (although it would be nice to be notified). So if both case1 and case2 were just one xml file, the procedure would return: we are coming along\nTrouble in tinseltown yada Or a couple of lists... I have been messing around with minidom, but as I intend to parse loads of xml, should I look at sax for speed? The way I had my minidom implementation was with 'xmldoc.getElementsByTagName'. But it does not seem to work, if I use more than one case. Thank you in advance for any pointers, Regards, -Kai Hendry From veillard@redhat.com Mon Mar 24 09:59:00 2003 From: veillard@redhat.com (Daniel Veillard) Date: Mon, 24 Mar 2003 04:59:00 -0500 Subject: [XML-SIG] Advice on how to deal with locking problems using python-wrapped C libs in MT frameworks like Zope/Twisted? In-Reply-To: <3E7EB3C0.3020205@arielpartners.com>; from cstrong@arielpartners.com on Mon, Mar 24, 2003 at 02:29:04AM -0500 References: <3E7B6709.3050409@arielpartners.com> <3E7EB3C0.3020205@arielpartners.com> Message-ID: <20030324045900.K31240@redhat.com> On Mon, Mar 24, 2003 at 02:29:04AM -0500, Craeg K Strong wrote: > Thanks for responding to my query! >=20 > Martin v. L=F6wis wrote: >=20 > >Craeg K Strong writes: > > =20 > > > >>I am noticing lockup/timeout behavior whenever the integration > >>framework calls back out to Zope. > >> > >>It is crucial to determine whether they are lockup (won't terminate o= n > >>its own) or timeout (will terminate after some time) problems. > >> =20 > >> > Pyana 0.8 locks up and never returns.=20 > GNOME libxslt 1.0.27 times out after a minute or two. Well I don't know if the problem is in libxslt, but if you want me to look at the possible problem please follow the guidelines at: http://xmlsoft.org/XSLT/bugs.html thanks, Daniel --=20 Daniel Veillard | Red Hat Network https://rhn.redhat.com/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ From mark@easymailings.com Mon Mar 24 14:23:57 2003 From: mark@easymailings.com (Mark Bucciarelli) Date: Mon, 24 Mar 2003 09:23:57 -0500 Subject: [XML-SIG] Advice on how to deal with locking problems using python-wrapped C libs in MT frameworks like Zope/Twisted? In-Reply-To: <3E7EB3C0.3020205@arielpartners.com> References: <3E7B6709.3050409@arielpartners.com> <3E7EB3C0.3020205@arielpartners.com> Message-ID: <200303240923.58234.mark@easymailings.com> On Monday 24 March 2003 2:29 am, Craeg K Strong wrote: > Martin v. L=F6wis wrote: > >Craeg K Strong writes: > >>I am noticing lockup/timeout behavior whenever the integration > >>framework calls back out to Zope. [...] > >>My question: has anyone else had to deal with such issues? > > > >Most certainly. Usually, a slowdown is caused by somebody trying > > to resolve URLs, contacting remote systems in the process. > > Yes. But these problems are occuring in my unit test suite. All > of my unit tests refer to local URLs > either absolute "localhost:8080/foo/bar...." Does the behavior change if you use 127.0.0.1 instead of localhost? Mark From aron@socrates.berkeley.edu Mon Mar 24 17:18:43 2003 From: aron@socrates.berkeley.edu (Aron Roberts) Date: Mon, 24 Mar 2003 09:18:43 -0800 Subject: [XML-SIG] Another application which reads XBEL Message-ID: Hi, An addition to the "Supporting Software" section of the XML Bookmark Exchange Language home page: Alco Blom's URL Manager Pro now supports reading files in the XBEL format. Release notes for the current version, 3.0.5, mentioning this: http://www.url-manager.com/version300.html Cheers, Aron Roberts Workstation Software Support Group . 221 Evans Hall University of California, Berkeley, CA 94720-3808 USA aron@socrates.berkeley.edu . +1 510-642-5974 . fax 510-643-5385 From cstrong@arielpartners.com Mon Mar 24 17:53:40 2003 From: cstrong@arielpartners.com (Craeg K Strong) Date: Mon, 24 Mar 2003 12:53:40 -0500 Subject: [XML-SIG] Advice on how to deal with locking problems using python-wrapped C libs in MT frameworks like Zope/Twisted? In-Reply-To: <200303240923.58234.mark@easymailings.com> References: <3E7B6709.3050409@arielpartners.com> <3E7EB3C0.3020205@arielpartners.com> <200303240923.58234.mark@easymailings.com> Message-ID: <3E7F4624.3010903@arielpartners.com> Sorry, I was not being specific enough-- actually the URL *is* 127.0.0.1=20 which is the default used by the ZopeTestCase library (a zopish pyunit) Do you think I should try something else? --Craeg Mark Bucciarelli wrote: >On Monday 24 March 2003 2:29 am, Craeg K Strong wrote: > =20 > >>Martin v. L=F6wis wrote: >> =20 >> >>>Craeg K Strong writes: >>> =20 >>> >>>>I am noticing lockup/timeout behavior whenever the integration >>>>framework calls back out to Zope. >>>>[...] >>>> =20 >>>> >>>>My question: has anyone else had to deal with such issues? >>>> =20 >>>> >>>Most certainly. Usually, a slowdown is caused by somebody trying >>>to resolve URLs, contacting remote systems in the process. >>> =20 >>> >>Yes. But these problems are occuring in my unit test suite. All >>of my unit tests refer to local URLs >>either absolute "localhost:8080/foo/bar...." >> =20 >> > >Does the behavior change if you use 127.0.0.1 instead of localhost? > >Mark > > =20 > From cstrong@arielpartners.com Mon Mar 24 18:13:34 2003 From: cstrong@arielpartners.com (Craeg K Strong) Date: Mon, 24 Mar 2003 13:13:34 -0500 Subject: [XML-SIG] Advice on how to deal with locking problems using python-wrapped C libs in MT frameworks like Zope/Twisted? In-Reply-To: <20030324045900.K31240@redhat.com> References: <3E7B6709.3050409@arielpartners.com> <3E7EB3C0.3020205@arielpartners.com> <20030324045900.K31240@redhat.com> Message-ID: <3E7F4ACE.6020609@arielpartners.com> Yes, indeed. The problem, of course, will be to provide a small piece of code and a reasonably efficient scenario to reproduce the problem. Do you have any advice as to how I might go about doing this? For example, if you or another libxslt committer is already a Zope user, it may not be a big deal if I register the bug report and attach a small snippet of python code to reproduce the problem while running inside Zope. If not, it might be more difficult. Is there an alternate, \ possibly more lightweight python framework you would prefer? I can see I am going to have to educate myself on the intricacies of the Python/C API, I can't put this off any longer... :-o ---Craeg Daniel Veillard wrote: >>GNOME libxslt 1.0.27 times out after a minute or two. >> >> > Well I don't know if the problem is in libxslt, but if you want me >to look at the possible problem please follow the guidelines at: > http://xmlsoft.org/XSLT/bugs.html > > thanks, > >Daniel > > > From jh@web.de Mon Mar 24 19:48:44 2003 From: jh@web.de (Juergen Hermann) Date: Mon, 24 Mar 2003 20:48:44 +0100 Subject: [XML-SIG] Advice on how to deal with locking problems using python-wrapped C libs in MT frameworks like Zope/Twisted? In-Reply-To: <3E7F4ACE.6020609@arielpartners.com> Message-ID: On=20Mon,=2024=20Mar=202003=2013:13:34=20-0500,=20Craeg=20K=20Strong=20wro= te: >I=20can=20see=20I=20am=20going=20to=20have=20to=20educate=20myself=20on=20= the=20intricacies=20of=20the=20 >Python/C=20API, >I=20can't=20put=20this=20off=20any=20longer...=20:-o What=20you=20can=20do=20is=20to=20attach=20a=20gdb=20to=20the=20locked=20p= rocess=20and=20then=20do=20a=20"bt".=20 That=20often=20gives=20a=20hint=20when=20you=20have=20problems=20with=20ex= tensions. Ciao,=20J=FCrgen From veillard@redhat.com Mon Mar 24 21:08:17 2003 From: veillard@redhat.com (Daniel Veillard) Date: Mon, 24 Mar 2003 16:08:17 -0500 Subject: [XML-SIG] Advice on how to deal with locking problems using python-wrapped C libs in MT frameworks like Zope/Twisted? In-Reply-To: <3E7F4ACE.6020609@arielpartners.com>; from cstrong@arielpartners.com on Mon, Mar 24, 2003 at 01:13:34PM -0500 References: <3E7B6709.3050409@arielpartners.com> <3E7EB3C0.3020205@arielpartners.com> <20030324045900.K31240@redhat.com> <3E7F4ACE.6020609@arielpartners.com> Message-ID: <20030324160817.Y31240@redhat.com> On Mon, Mar 24, 2003 at 01:13:34PM -0500, Craeg K Strong wrote: > Yes, indeed. The problem, of course, will be to provide a small piece > of code and a > reasonably efficient scenario to reproduce the problem. > > Do you have any advice as to how I might go about doing this? For example, > if you or another libxslt committer is already a Zope user, it may not > be a big deal if > I register the bug report and attach a small snippet of python code to > reproduce > the problem while running inside Zope. If not, it might be more > difficult. Is there an alternate, \ > possibly more lightweight python framework you would prefer? > > I can see I am going to have to educate myself on the intricacies of the > Python/C API, > I can't put this off any longer... :-o Well if you can reproduce it outside of Zope with the default python bindings that would allow me to debug it, a tar or a zip with the XSL/XML/python code reproducing the problem then I start gdb and I can find what's happening :-) Daniel -- Daniel Veillard | Red Hat Network https://rhn.redhat.com/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ From allison@sumeru.stanford.EDU Mon Mar 24 22:28:22 2003 From: allison@sumeru.stanford.EDU (Dennis Allison) Date: Mon, 24 Mar 2003 14:28:22 -0800 (PST) Subject: [XML-SIG] Bug in SAXParseException class Message-ID: It looks to me as if the message has its arguments reversed in PyXML-0.8.2. The diagnostic raised prints End tag for 'resources' seen, but 'garbagetag' expected for XML with the form ...stuff... .....stuff..... where stuff is well-formed. is a tag inserted into the XML for testing purposes. Please respond directly as I do not ordinarily read this list. From martin@v.loewis.de Mon Mar 24 23:36:34 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 25 Mar 2003 00:36:34 +0100 Subject: [XML-SIG] Using xmlproc to validate In-Reply-To: <20030324082938.GA40837@spuckler.il.thewrittenword.com> References: <20030324082938.GA40837@spuckler.il.thewrittenword.com> Message-ID: Albert Chin writes: > I'd like to install a custom handler to set the path or open file > handle of the external DTD specified in my XML file using xmlproc. How > do I do this? If you use SAX, installing an EntityResolver should be sufficient. > EntityResolver is in the Todo list for drv_xmlproc.py so I guess the > setEntityResolver method is not an option (and, looking at SF, bug > #609590). You could, of course, investigate the problem and propose a patch. It is extremely unlikely that anybody else does in the near future. Regards, Martin From martin@v.loewis.de Mon Mar 24 23:39:01 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 25 Mar 2003 00:39:01 +0100 Subject: [XML-SIG] lost In-Reply-To: <20030324094225.GA1199@cs.helsinki.fi> References: <20030324094225.GA1199@cs.helsinki.fi> Message-ID: Kai Hendry writes: > I am just getting started with XML processing in python, and now I need > to do something a little more complicated, and I staring at: > http://www.python.org/doc/current/lib/markup.html > > And wondering what to use! I recommend to set up a SAX content handler. Ignore all startElement and endElement notifications, and only process characters notifications. Regards, Martin From martin@v.loewis.de Mon Mar 24 23:42:10 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 25 Mar 2003 00:42:10 +0100 Subject: [XML-SIG] Bug in SAXParseException class In-Reply-To: References: Message-ID: Dennis Allison writes: > It looks to me as if the message has its arguments reversed in > PyXML-0.8.2. > > The diagnostic raised prints > > End tag for 'resources' seen, but 'garbagetag' expected > > for XML with the form > > ...stuff... .....stuff..... > > where stuff is well-formed. is a tag inserted into > the XML for testing purposes. I'm not sure what the bug is you want to report. What should the message be instead? It says that it sees the end tag for resources, and it does indeed: . It also says that it did not see the end tag for garbagetag, and indeed, there was no end tag for garbagetag. It then says this is an error, and it is indeed. So what is the problem? Regards, Martin From allison@sumeru.stanford.EDU Mon Mar 24 23:55:37 2003 From: allison@sumeru.stanford.EDU (Dennis Allison) Date: Mon, 24 Mar 2003 15:55:37 -0800 (PST) Subject: [XML-SIG] Bug in SAXParseException class In-Reply-To: Message-ID: On a second reading, it is correct. I'd expected =20 illegal or something like that. =20 On 25 Mar 2003, Martin v. [iso-8859-15] L=F6wis wrote: > Dennis Allison writes: >=20 > > It looks to me as if the message has its arguments reversed in=20 > > PyXML-0.8.2. =20 > >=20 > > The diagnostic raised prints=20 > >=20 > > End tag for 'resources' seen, but 'garbagetag' expected > >=20 > > for XML with the form > >=20 > > ...stuff... .....stuff..... > >=20 > > where stuff is well-formed. is a tag inserted into=20 > > the XML for testing purposes. >=20 > I'm not sure what the bug is you want to report. What should the > message be instead? It says that it sees the end tag for resources, > and it does indeed: . It also says that it did not see the > end tag for garbagetag, and indeed, there was no end tag for > garbagetag. It then says this is an error, and it is indeed. >=20 > So what is the problem? >=20 > Regards, > Martin >=20 From martin@v.loewis.de Mon Mar 24 23:57:40 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 25 Mar 2003 00:57:40 +0100 Subject: [XML-SIG] Advice on how to deal with locking problems using python-wrapped C libs in MT frameworks like Zope/Twisted? In-Reply-To: <3E7EB3C0.3020205@arielpartners.com> References: <3E7B6709.3050409@arielpartners.com> <3E7EB3C0.3020205@arielpartners.com> Message-ID: Craeg K Strong writes: > Yes. Based on the above information, can you suggest a direction of > inquiry? I suggest to investigate this with strace. Regards, Martin From uche.ogbuji@fourthought.com Tue Mar 25 01:43:01 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Mon, 24 Mar 2003 18:43:01 -0700 Subject: [XML-SIG] Another application which reads XBEL In-Reply-To: Message from Aron Roberts of "Mon, 24 Mar 2003 09:18:43 PST." Message-ID: > Hi, > > An addition to the "Supporting Software" section of the XML > Bookmark Exchange Language home page: > > Alco Blom's URL Manager Pro now > supports reading files in the XBEL format. Release notes for the > current version, 3.0.5, mentioning this: > > http://www.url-manager.com/version300.html I added this, and made some other doc changes. However, when I tried to commit, it said I have no permissions. I've committed to xml just fine, but I guess I'm locked out of www. Can anyone look into this? Thanks. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Universal Business Language (UBL) - http://www-106.ibm.com/developerworks/xml/l ibrary/x-think16.html EXSLT by example - http://www-106.ibm.com/developerworks/library/x-exslt.html The worry about program wizards - http://www.adtmag.com/article.asp?id=7238 Use rdf:about and rdf:ID effectively in RDF/XML - http://www-106.ibm.com/develo perworks/xml/library/x-tiprdfai.html Keep context straight in XSLT - http://www-106.ibm.com/developerworks/xml/libra ry/x-tipcurrent.html Python Generators + DOM - http://www.xml.com/pub/a/2003/01/08/py-xml.html Using SAX for Proper XML Output - http://www.xml.com/pub/a/2003/03/12/py-xml.ht ml SAX filters for flexible processing - http://www-106.ibm.com/developerworks/xml /library/x-tipsaxflex.html From martin@v.loewis.de Tue Mar 25 07:03:46 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 25 Mar 2003 08:03:46 +0100 Subject: [XML-SIG] Another application which reads XBEL In-Reply-To: References: Message-ID: Uche Ogbuji writes: > I added this, and made some other doc changes. However, when I > tried to commit, it said I have no permissions. I've committed to > xml just fine, but I guess I'm locked out of www. Can anyone look > into this? "This" being your cvs commit problems, or the request of the OP? I just tried to commit, using my regular SF CVS account, and it worked. Are you sure you weren't using an anonymously-checked-out sandbox? Regards, Martin From uche.ogbuji@fourthought.com Tue Mar 25 07:37:37 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Tue, 25 Mar 2003 00:37:37 -0700 Subject: [XML-SIG] Another application which reads XBEL In-Reply-To: Message from martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) of "25 Mar 2003 08:03:46 +0100." Message-ID: > Uche Ogbuji writes: > > > I added this, and made some other doc changes. However, when I > > tried to commit, it said I have no permissions. I've committed to > > xml just fine, but I guess I'm locked out of www. Can anyone look > > into this? > > "This" being your cvs commit problems, or the request of the OP? OP? I don't follow. "this" is my CVS problem. > I just tried to commit, using my regular SF CVS account, and it > worked. Are you sure you weren't using an anonymously-checked-out > sandbox? Nothing so simple: [...] cvs [server aborted]: "commit" requires write access to the repository cvs commit: saving log message in /tmp/cvsVRlXFy [uogbuji@borgia www]$ cat CVS/Root :pserver:uche@cvs.pyxml.sourceforge.net:/cvsroot/pyxml [uogbuji@borgia www]$ cat CVS/Repository www [uogbuji@borgia www]$ -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Universal Business Language (UBL) - http://www-106.ibm.com/developerworks/xml/l ibrary/x-think16.html EXSLT by example - http://www-106.ibm.com/developerworks/library/x-exslt.html The worry about program wizards - http://www.adtmag.com/article.asp?id=7238 Use rdf:about and rdf:ID effectively in RDF/XML - http://www-106.ibm.com/develo perworks/xml/library/x-tiprdfai.html Keep context straight in XSLT - http://www-106.ibm.com/developerworks/xml/libra ry/x-tipcurrent.html Python Generators + DOM - http://www.xml.com/pub/a/2003/01/08/py-xml.html Using SAX for Proper XML Output - http://www.xml.com/pub/a/2003/03/12/py-xml.ht ml SAX filters for flexible processing - http://www-106.ibm.com/developerworks/xml /library/x-tipsaxflex.html From martin@v.loewis.de Tue Mar 25 17:58:42 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 25 Mar 2003 18:58:42 +0100 Subject: [XML-SIG] Another application which reads XBEL In-Reply-To: References: Message-ID: Uche Ogbuji writes: > Nothing so simple: > > [...] > cvs [server aborted]: "commit" requires write access to the repository And CVS_RSH was set to "ssh"? Regards, Martin From uche.ogbuji@fourthought.com Tue Mar 25 18:07:43 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Tue, 25 Mar 2003 11:07:43 -0700 Subject: [XML-SIG] Another application which reads XBEL In-Reply-To: Message from martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) of "25 Mar 2003 18:58:42 +0100." Message-ID: > Uche Ogbuji writes: > > > Nothing so simple: > > > > [...] > > cvs [server aborted]: "commit" requires write access to the repository > > And CVS_RSH was set to "ssh"? Yes, but this shouldn't matter IIRC as the local root overrides the enironment parameters. As a sanity check, I started from scratch: [uogbuji@borgia pyxml2]$ cvs -d :pserver:uche@cvs.pyxml.sourceforge.net:/cvsroo t/pyxml login Logging in to :pserver:uche@cvs.pyxml.sourceforge.net:2401/cvsroot/pyxml CVS password: [uogbuji@borgia pyxml2]$ cvs -d :pserver:uche@cvs.pyxml.sourceforge.net:/cvsroo t/pyxml co www cvs server: Updating www [SNIP] Then I applied the patch and tried to commit again. cvs [server aborted]: "commit" requires write access to the repository cvs commit: saving log message in /tmp/cvsTeydh7 -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Universal Business Language (UBL) - http://www-106.ibm.com/developerworks/xml/l ibrary/x-think16.html EXSLT by example - http://www-106.ibm.com/developerworks/library/x-exslt.html The worry about program wizards - http://www.adtmag.com/article.asp?id=7238 Use rdf:about and rdf:ID effectively in RDF/XML - http://www-106.ibm.com/develo perworks/xml/library/x-tiprdfai.html Keep context straight in XSLT - http://www-106.ibm.com/developerworks/xml/libra ry/x-tipcurrent.html Python Generators + DOM - http://www.xml.com/pub/a/2003/01/08/py-xml.html Using SAX for Proper XML Output - http://www.xml.com/pub/a/2003/03/12/py-xml.ht ml SAX filters for flexible processing - http://www-106.ibm.com/developerworks/xml /library/x-tipsaxflex.html From rsalz@datapower.com Tue Mar 25 18:13:21 2003 From: rsalz@datapower.com (Rich Salz) Date: Tue, 25 Mar 2003 13:13:21 -0500 Subject: [XML-SIG] Another application which reads XBEL In-Reply-To: References: Message-ID: <3E809C41.3070205@datapower.com> > [uogbuji@borgia pyxml2]$ cvs -d :pserver:uche@cvs.pyxml.sourceforge.net:/cvsroo > t/pyxml login shouldn't that be :ext: ? From fdrake@acm.org Tue Mar 25 18:13:18 2003 From: fdrake@acm.org (Fred L. Drake, Jr.) Date: Tue, 25 Mar 2003 13:13:18 -0500 Subject: [XML-SIG] Another application which reads XBEL In-Reply-To: References: <"Message from martin"@v.loewis.de> Message-ID: <16000.39998.812478.656743@grendel.zope.com> Uche Ogbuji writes: > Yes, but this shouldn't matter IIRC as the local root overrides the enironment > parameters. CVS_RSH needs to be right; it the setting for a checkout isn't recorded in the CVS metadata. > As a sanity check, I started from scratch: > > > [uogbuji@borgia pyxml2]$ cvs -d :pserver:uche@cvs.pyxml.sourceforge.net:/cvsroo > t/pyxml login I'm not familiar with using pserver write access on SourceForge. Have you tried using :ext: instead of :pserver:? -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From fdrake@acm.org Tue Mar 25 18:17:23 2003 From: fdrake@acm.org (Fred L. Drake, Jr.) Date: Tue, 25 Mar 2003 13:17:23 -0500 Subject: [XML-SIG] Another application which reads XBEL In-Reply-To: <16000.39998.812478.656743@grendel.zope.com> References: <"Message from martin"@v.loewis.de> <16000.39998.812478.656743@grendel.zope.com> Message-ID: <16000.40243.551016.705290@grendel.zope.com> I wrote: > CVS_RSH needs to be right; it the setting for a checkout isn't > recorded in the CVS metadata. That should be: "...; the CVS_RSH setting for ...". --sigh-- -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From uche.ogbuji@fourthought.com Tue Mar 25 18:20:28 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Tue, 25 Mar 2003 11:20:28 -0700 Subject: [XML-SIG] Another application which reads XBEL In-Reply-To: Message from Rich Salz of "Tue, 25 Mar 2003 13:13:21 EST." <3E809C41.3070205@datapower.com> Message-ID: > > [uogbuji@borgia pyxml2]$ cvs -d :pserver:uche@cvs.pyxml.sourceforge.net:/cvsroo > > t/pyxml login > > shouldn't that be :ext: ? Duh. Thanks. That did the trick. IIRC, I can just wait now for the doupdate scirpt to run, right? I think we should add a www/README that says so and details the schedule. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Universal Business Language (UBL) - http://www-106.ibm.com/developerworks/xml/l ibrary/x-think16.html EXSLT by example - http://www-106.ibm.com/developerworks/library/x-exslt.html The worry about program wizards - http://www.adtmag.com/article.asp?id=7238 Use rdf:about and rdf:ID effectively in RDF/XML - http://www-106.ibm.com/develo perworks/xml/library/x-tiprdfai.html Keep context straight in XSLT - http://www-106.ibm.com/developerworks/xml/libra ry/x-tipcurrent.html Python Generators + DOM - http://www.xml.com/pub/a/2003/01/08/py-xml.html Using SAX for Proper XML Output - http://www.xml.com/pub/a/2003/03/12/py-xml.ht ml SAX filters for flexible processing - http://www-106.ibm.com/developerworks/xml /library/x-tipsaxflex.html From martin@v.loewis.de Tue Mar 25 20:30:59 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 25 Mar 2003 21:30:59 +0100 Subject: [XML-SIG] Another application which reads XBEL In-Reply-To: References: Message-ID: Uche Ogbuji writes: > IIRC, I can just wait now for the doupdate scirpt to run, right? I think we > should add a www/README that says so and details the schedule. That is the theory. It is in my private crontab, and the crontab line is 10 * * * * /home/groups/p/py/pyxml/doupdate Regards, Martin From james.kew@btinternet.com Tue Mar 25 20:33:13 2003 From: james.kew@btinternet.com (James Kew) Date: Tue, 25 Mar 2003 20:33:13 -0000 Subject: [XML-SIG] Re: Using xmlproc to validate References: <20030324082938.GA40837@spuckler.il.thewrittenword.com> Message-ID: "Martin v. Löwis" wrote in message news:m3wuiogwvx.fsf@mira.informatik.hu-berlin.de... > Albert Chin writes: > > > I'd like to install a custom handler to set the path or open file > > handle of the external DTD specified in my XML file using xmlproc. How > > do I do this? > > If you use SAX, installing an EntityResolver should be sufficient. It's not, though, for the validating parser -- you can install an EntityResover, but it won't be called -- hence the SF bug report. > > EntityResolver is in the Todo list for drv_xmlproc.py so I guess the > > setEntityResolver method is not an option (and, looking at SF, bug > > #609590). > > You could, of course, investigate the problem and propose a patch. It > is extremely unlikely that anybody else does in the near future. Nudge received. I don't have a formal patch, but I do have some code at work that fixes up drv_xmlproc.XmlprocDriver at runtime so that it does correctly call EntityResolver. I'll dig it out tomorrow. Should be fairly straightforward to turn into a patch. -- James Kew james.kew@btinternet.com From martin@v.loewis.de Tue Mar 25 21:01:03 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 25 Mar 2003 22:01:03 +0100 Subject: [XML-SIG] Re: Using xmlproc to validate In-Reply-To: References: <20030324082938.GA40837@spuckler.il.thewrittenword.com> Message-ID: "James Kew" writes: > Should be fairly straightforward to turn into a patch. Thanks! Please post it at SF when you are done. Regards, Martin From uche.ogbuji@fourthought.com Tue Mar 25 21:59:02 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Tue, 25 Mar 2003 14:59:02 -0700 Subject: [XML-SIG] Another application which reads XBEL In-Reply-To: Message from martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) of "25 Mar 2003 21:30:59 +0100." Message-ID: > Uche Ogbuji writes: > > > IIRC, I can just wait now for the doupdate scirpt to run, right? I think we > > should add a www/README that says so and details the schedule. > > That is the theory. It is in my private crontab, and the crontab line is > > 10 * * * * /home/groups/p/py/pyxml/doupdate Thanks. The update did work, and I added a README explaining this, so that future folks don't forget. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Universal Business Language (UBL) - http://www-106.ibm.com/developerworks/xml/library/x-think16.html EXSLT by example - http://www-106.ibm.com/developerworks/library/x-exslt.html The worry about program wizards - http://www.adtmag.com/article.asp?id=7238 Use rdf:about and rdf:ID effectively in RDF/XML - http://www-106.ibm.com/developerworks/xml/library/x-tiprdfai.html Keep context straight in XSLT - http://www-106.ibm.com/developerworks/xml/library/x-tipcurrent.html Python Generators + DOM - http://www.xml.com/pub/a/2003/01/08/py-xml.html Using SAX for Proper XML Output - http://www.xml.com/pub/a/2003/03/12/py-xml.html SAX filters for flexible processing - http://www-106.ibm.com/developerworks/xml/library/x-tipsaxflex.html From Gottfried.Ganssauge@HAUFE.DE Wed Mar 26 09:30:27 2003 From: Gottfried.Ganssauge@HAUFE.DE (Gottfried.Ganssauge@HAUFE.DE) Date: Wed, 26 Mar 2003 10:30:27 +0100 Subject: [XML-SIG] Bug with XML file having a doctype declaration Message-ID: <2040C0A1CA23D51181A30050BAAC990274A8C0@berexch.ber.haufemg.com> Consider the following test program (You probably recognize it from a recently fixed bug ...) --------------><---------------------><-------------------------- #! /usr/bin/env python =20 import xml.dom from xml.dom.ext.reader import Sax2 reader =3D Sax2.Reader() doc =3D reader.fromString(""" """) for c in doc.childNodes: if c.nodeType=3D=3Dxml.dom.Node.DOCUMENT_TYPE_NODE: print "public ID: "+c.publicId print "system ID: "+c.systemId --------------><---------------------><-------------------------- When I let this run with PyXML-0.8.2 I get a stack trace: Traceback (most recent call last): File "./saxtest.py", line 21, in ? doc=3Dreader.fromString(""" File "/usr/lib/python2.2/site-packages/_xmlplus/dom/ext/reader/__init__.py", = line 61, in fromString return self.fromStream(stream, ownerDoc) File = "/usr/lib/python2.2/site-packages/_xmlplus/dom/ext/reader/Sax2.py", line 373, in fromStream self.parser.parse(s) File "/usr/lib/python2.2/site-packages/_xmlplus/sax/expatreader.py", = line 107, in parse xmlreader.IncrementalParser.parse(self, source) File "/usr/lib/python2.2/site-packages/_xmlplus/sax/xmlreader.py", = line 123, in parse self.feed(buffer) File "/usr/lib/python2.2/site-packages/_xmlplus/sax/expatreader.py", = line 207, in feed self._parser.Parse(data, isFinal) File "/usr/lib/python2.2/site-packages/_xmlplus/sax/expatreader.py", = line 379, in external_entity_ref self._source.getSystemId() or File "/usr/lib/python2.2/site-packages/_xmlplus/sax/saxutils.py", = line 515, in prepare_input_source f =3D urllib2.urlopen(source.getSystemId()) File "/usr/lib/python2.2/urllib2.py", line 138, in urlopen return _opener.open(url, data) File "/usr/lib/python2.2/urllib2.py", line 320, in open type_ =3D req.get_type() File "/usr/lib/python2.2/urllib2.py", line 224, in get_type raise ValueError, "unknown url type: %s" % self.__original ValueError: unknown url type: zettel.dtd >From this i concluded that the parser wanted to parse the external = subset of my doctype declaration. As I don't need any DTD details within my application I'd like to be able to simply keep that doctypedecl-node = without parsing it further. After digging around in the sources for expatreader I came up with the following workaround: --------------><---------------------><-------------------------- #! /usr/bin/env python =20 from xml.sax.expatreader import \ ExpatParser, \ expat class pyExpatWrapper(ExpatParser): """ Wrapper f=FCr den ExpatParser, der verhindert, dass versucht wird = das externe Subset der DOCTYPE-Spezifikation zu parsen. """ def reset(self): ExpatParser.reset(self) self._parser.SetParamEntityParsing ( expat.XML_PARAM_ENTITY_PARSING_NEVER) import xml.dom from xml.dom.ext.reader import Sax2 reader =3D Sax2.Reader() doc =3D reader.fromString(""" """) for c in doc.childNodes: if c.nodeType=3D=3Dxml.dom.Node.DOCUMENT_TYPE_NODE: print "public ID: "+c.publicId print "system ID: "+c.systemId --------------><---------------------><-------------------------- That way everything works [at least with PyXML-0.8.2, with PyXML-0.7.1 I get=20 public ID: system ID: ] is that the way it's meant to be done? Or is there an easier, less = parser dependant way to achieve my goal? Cheers, =20 Gottfried From Gottfried.Ganssauge@HAUFE.DE Wed Mar 26 09:35:23 2003 From: Gottfried.Ganssauge@HAUFE.DE (Gottfried.Ganssauge@HAUFE.DE) Date: Wed, 26 Mar 2003 10:35:23 +0100 Subject: [XML-SIG] Bug with XML file having a doctype declaration Message-ID: <2040C0A1CA23D51181A30050BAAC990274A8C1@berexch.ber.haufemg.com> Sorry, in the second code example I mangled a line, it must be: reader =3D Sax2.Reader(parser =3D pyExpatWrapper()) Cheers, Gottfried -----Original Message----- From: Ganssauge, Gottfried=20 Sent: Wednesday, March 26, 2003 10:30 AM To: 'xml-sig@python.org' Subject: Bug with XML file having a doctype declaration Consider the following test program (You probably recognize it from a recently fixed bug ...) --------------><---------------------><-------------------------- #! /usr/bin/env python =20 import xml.dom from xml.dom.ext.reader import Sax2 reader =3D Sax2.Reader() doc =3D reader.fromString(""" """) for c in doc.childNodes: if c.nodeType=3D=3Dxml.dom.Node.DOCUMENT_TYPE_NODE: print "public ID: "+c.publicId print "system ID: "+c.systemId --------------><---------------------><-------------------------- When I let this run with PyXML-0.8.2 I get a stack trace: Traceback (most recent call last): File "./saxtest.py", line 21, in ? doc=3Dreader.fromString(""" File "/usr/lib/python2.2/site-packages/_xmlplus/dom/ext/reader/__init__.py", = line 61, in fromString return self.fromStream(stream, ownerDoc) File = "/usr/lib/python2.2/site-packages/_xmlplus/dom/ext/reader/Sax2.py", line 373, in fromStream self.parser.parse(s) File "/usr/lib/python2.2/site-packages/_xmlplus/sax/expatreader.py", = line 107, in parse xmlreader.IncrementalParser.parse(self, source) File "/usr/lib/python2.2/site-packages/_xmlplus/sax/xmlreader.py", = line 123, in parse self.feed(buffer) File "/usr/lib/python2.2/site-packages/_xmlplus/sax/expatreader.py", = line 207, in feed self._parser.Parse(data, isFinal) File "/usr/lib/python2.2/site-packages/_xmlplus/sax/expatreader.py", = line 379, in external_entity_ref self._source.getSystemId() or File "/usr/lib/python2.2/site-packages/_xmlplus/sax/saxutils.py", = line 515, in prepare_input_source f =3D urllib2.urlopen(source.getSystemId()) File "/usr/lib/python2.2/urllib2.py", line 138, in urlopen return _opener.open(url, data) File "/usr/lib/python2.2/urllib2.py", line 320, in open type_ =3D req.get_type() File "/usr/lib/python2.2/urllib2.py", line 224, in get_type raise ValueError, "unknown url type: %s" % self.__original ValueError: unknown url type: zettel.dtd >From this i concluded that the parser wanted to parse the external = subset of my doctype declaration. As I don't need any DTD details within my application I'd like to be able to simply keep that doctypedecl-node = without parsing it further. After digging around in the sources for expatreader I came up with the following workaround: --------------><---------------------><-------------------------- #! /usr/bin/env python =20 from xml.sax.expatreader import \ ExpatParser, \ expat class pyExpatWrapper(ExpatParser): """ Wrapper f=FCr den ExpatParser, der verhindert, dass versucht wird = das externe Subset der DOCTYPE-Spezifikation zu parsen. """ def reset(self): ExpatParser.reset(self) self._parser.SetParamEntityParsing ( expat.XML_PARAM_ENTITY_PARSING_NEVER) import xml.dom from xml.dom.ext.reader import Sax2 reader =3D Sax2.Reader() doc =3D reader.fromString(""" """) for c in doc.childNodes: if c.nodeType=3D=3Dxml.dom.Node.DOCUMENT_TYPE_NODE: print "public ID: "+c.publicId print "system ID: "+c.systemId --------------><---------------------><-------------------------- That way everything works [at least with PyXML-0.8.2, with PyXML-0.7.1 I get=20 public ID: system ID: ] is that the way it's meant to be done? Or is there an easier, less = parser dependant way to achieve my goal? Cheers, =20 Gottfried From hendry@cs.helsinki.fi Wed Mar 26 10:35:35 2003 From: hendry@cs.helsinki.fi (Kai Hendry) Date: Wed, 26 Mar 2003 12:35:35 +0200 Subject: [XML-SIG] Installation Message-ID: <20030326103535.GL837@cs.helsinki.fi> I am trying to work through the XML tutorial, but I have found that xml.saxutils.DefaultHandler does not exist on my python installation at school (a RH installation). However it exists on my Debian machine at home. Ok, so now I would like to get pyxml working at school, following : http://pyxml.sourceforge.net/topics/howto/section-install.html Running in my homedir. However, your README's 'python setup.py install' does not work, as I do not have permission to create dirs and files in anywhere except my homedir. Therefore can you please suggest an option to enable users to install it in their home directory? Regards, -Kai Hendry From jkew@mediabright.co.uk Wed Mar 26 10:44:33 2003 From: jkew@mediabright.co.uk (James Kew) Date: Wed, 26 Mar 2003 10:44:33 -0000 Subject: [XML-SIG] RE: Using xmlproc to validate Message-ID: <0BD8D2EEE11FD611AE530002A5FB844C17CA02@animal.mediabright.co.uk> This is a multi-part message in MIME format. ------_=_NextPart_000_01C2F384.B447B0A8 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="ISO-8859-1" I wrote: > I don't have a formal patch, but I do have some code at work that = fixes up > drv_xmlproc.XmlprocDriver at runtime so that it does correctly call > EntityResolver. I'll dig it out tomorrow. Attached: importing this makes a runtime fix to current PyXML versions. = More in the docstring. SF patch to follow. -- James Kew james.kew@btinternet.com -- This message and any attachments (the "message") is intended solely for = the addressees and is confidential. If you receive this message in error, = please delete it and immediately notify the sender. Any use not in accordance with its purpose, any dissemination or = disclosure, either whole or partial, is prohibed except formal appoval. The E-Mail transmission can not guarantee the integrity of this message. CANAL+TECHNOLOGIES will not therefore be liable for the message if = modified. ------_=_NextPart_000_01C2F384.B447B0A8 Content-Type: application/octet-stream; name="XMLProcFixup.py" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="XMLProcFixup.py" # # BEGIN COPYRIGHT NOTICE # PROJECT MLI # (c) Canal+Technologies 2002 # END COPYRIGHT NOTICE #=20 # BEGIN SOURCE CODE CONTROL INFORMATION # %name: XMLProcFixup.py % # %version: 1 % # %instance: 1 % # END SOURCE CODE CONTROL INFORMATION # # XMLProc parser fixup. # __version__ =3D "%full_filespec: XMLProcFixup.py~1:python:1 %" __doc__ =3D """Fixup the XMLProc SAX2 parser to support the = EntityResolver interface. The current version (PyXML 0.8, 0.8.1, 0.8.2, file version 1.15) of xml.sax.driver2.drv_xmlproc.XmlprocDriver does not fully support setEntityResolver: although an EntityResolver can be set, it is not called during parsing. This module applies runtime patches to the class such that it: * exposes the xmlproc.xmlapp.PubIdResolver methods * registers itself as a pubid_resolver on the underlying xmlval parser * delegates PubId resolution to the current EntityResolver. Note that this does not fully fulfil the required semantics of the EntityResolver interface: the user's EntityResolver.resolveEntity may not return an InputSource. Usage: import this module before using validating SAX2 parsers. """ # We will add and replace methods in = xml.sax.drivers2.drv_xmlproc.XmlprocDriver.=20 import xml.sax.drivers2.drv_xmlproc # Has the source already been patched? if not hasattr(xml.sax.drivers2.drv_xmlproc.XmlprocDriver, = "resolve_doctype_pubid"): def funcToMethod(func, clas, method_name=3DNone): """ Bind a function as a class method. See Python Cookbook (Martelli/Ascher) recipe 5.12. func: Function to bind. clas: Class to bind to. method_name: Name of bound method. Defaults to name of function. """ setattr(clas, method_name or func.__name__, func) # resolve_pubid:=20 def resolve_pubid(self, pubid, sysid): """ Resolve a pubid. This function is bound as the = resolve_pe_pubid, resolve_doctype_pubid, resolve_entity_pubid methods on = XmlprocDriver. """ # Delegate out to the instance's EntityResolver. return self._ent_handler.resolveEntity(pubid, sysid) def prepareParser(self, source): """ Prepare the parser. This function is bound to replace the = existing prepareParser method on XmlprocDriver. We assume the existing prepareParser method is rebound as old_prepareParser. """ # Delegate out to the existing method. self.old_prepareParser(source) # Set the pubid_resolver on the underlying xmlval parser. self._parser.set_pubid_resolver(self) # Add the xmlproc PubIdResolver methods to XmlprocDriver.=20 funcToMethod(resolve_pubid, = xml.sax.drivers2.drv_xmlproc.XmlprocDriver, "resolve_pe_pubid") funcToMethod(resolve_pubid, = xml.sax.drivers2.drv_xmlproc.XmlprocDriver, "resolve_doctype_pubid") funcToMethod(resolve_pubid, = xml.sax.drivers2.drv_xmlproc.XmlprocDriver, "resolve_entity_pubid") # Rebind prepareParser to old_prepareParser. = funcToMethod(xml.sax.drivers2.drv_xmlproc.XmlprocDriver.prepareParser, = xml.sax.drivers2.drv_xmlproc.XmlprocDriver, "old_prepareParser") # Replace prepareParser on XmlprocDriver.=20 funcToMethod(prepareParser, = xml.sax.drivers2.drv_xmlproc.XmlprocDriver) ------_=_NextPart_000_01C2F384.B447B0A8-- From noreply@sourceforge.net Wed Mar 26 11:39:49 2003 From: noreply@sourceforge.net (SourceForge.net) Date: Wed, 26 Mar 2003 03:39:49 -0800 Subject: [XML-SIG] [ pyxml-Patches-709990 ] xmlproc SAX2 driver EntityResolver support Message-ID: Patches item #709990, was opened at 2003-03-26 11:39 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=306473&aid=709990&group_id=6473 Category: xmlproc Group: None Status: Open Resolution: None Priority: 5 Submitted By: James Kew (jkew) Assigned to: Lars Marius Garshol (larsga) Summary: xmlproc SAX2 driver EntityResolver support Initial Comment: Proposed fix for SF bug 609590 -- adds basic EntityResolver support to xml.sax.drivers2.drv_xmlproc.XmlprocDriver. Does not support returning an InputSource from EntityResolver.resolveEntity. Sorry this isn't a diff -- I don't have enough time at the moment to battle through getting CVS etc set up on Windows. diffs from the current CVS head of drv_xmlproc.py (which hasn't changed in 14 months) should be fairly self-evident. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=306473&aid=709990&group_id=6473 From uche.ogbuji@fourthought.com Wed Mar 26 13:31:56 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Wed, 26 Mar 2003 06:31:56 -0700 Subject: [XML-SIG] Bug with XML file having a doctype declaration In-Reply-To: Message from Gottfried.Ganssauge@HAUFE.DE of "Wed, 26 Mar 2003 10:30:27 +0100." <2040C0A1CA23D51181A30050BAAC990274A8C0@berexch.ber.haufemg.com> Message-ID: > #! /usr/bin/env python = > = > from xml.sax.expatreader import \ > ExpatParser, \ > expat > = > class pyExpatWrapper(ExpatParser): > """ > Wrapper f=C3=BCr den ExpatParser, der verhindert, dass versucht wir= d das > externe Subset der DOCTYPE-Spezifikation zu parsen. > """ > def reset(self): > ExpatParser.reset(self) > self._parser.SetParamEntityParsing ( > expat.XML_PARAM_ENTITY_PARSING_NEVER) > import xml.dom > from xml.dom.ext.reader import Sax2 > = > reader =3D Sax2.Reader() > doc =3D reader.fromString(""" > > > > """) > for c in doc.childNodes: > if c.nodeType=3D=3Dxml.dom.Node.DOCUMENT_TYPE_NODE: > print "public ID: "+c.publicId > print "system ID: "+c.systemId > --------------><---------------------><-------------------------- expat.XML_PARAM_ENTITY_PARSING_NEVER should probably be a parameter to th= e = relevant readers. Anyone object if I make a backwards-compatible change = in = this direction? -- = Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Universal Business Language (UBL) - http://www-106.ibm.com/developerworks= /xml/l ibrary/x-think16.html EXSLT by example - http://www-106.ibm.com/developerworks/library/x-exslt.= html The worry about program wizards - http://www.adtmag.com/article.asp?id=3D= 7238 Use rdf:about and rdf:ID effectively in RDF/XML - http://www-106.ibm.com/= develo perworks/xml/library/x-tiprdfai.html Keep context straight in XSLT - http://www-106.ibm.com/developerworks/xml= /libra ry/x-tipcurrent.html Python Generators + DOM - http://www.xml.com/pub/a/2003/01/08/py-xml.html= Using SAX for Proper XML Output - http://www.xml.com/pub/a/2003/03/12/py-= xml.ht ml SAX filters for flexible processing - http://www-106.ibm.com/developerwor= ks/xml /library/x-tipsaxflex.html From uche.ogbuji@fourthought.com Wed Mar 26 13:35:08 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Wed, 26 Mar 2003 06:35:08 -0700 Subject: [XML-SIG] Installation In-Reply-To: Message from Kai Hendry of "Wed, 26 Mar 2003 12:35:35 +0200." <20030326103535.GL837@cs.helsinki.fi> Message-ID: > I am trying to work through the XML tutorial, but I have found that > xml.saxutils.DefaultHandler does not exist on my python installation at > school (a RH installation). However it exists on my Debian machine at > home. What XML tutorial are you talking about? What versions of software are you talking about? > However, your README's 'python setup.py install' does not work, as I do > not have permission to create dirs and files in anywhere except my > homedir. Therefore can you please suggest an option to enable users to > install it in their home directory? "python setup.py install" works just fine, and is prety flexible. If you just type python setup.py install -h You get a ist of the availble optons, which include --prefix, which is probably what you need: python setup.py install --prefix=$HOME/lib Or whatever -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Universal Business Language (UBL) - http://www-106.ibm.com/developerworks/xml/l ibrary/x-think16.html EXSLT by example - http://www-106.ibm.com/developerworks/library/x-exslt.html The worry about program wizards - http://www.adtmag.com/article.asp?id=7238 Use rdf:about and rdf:ID effectively in RDF/XML - http://www-106.ibm.com/develo perworks/xml/library/x-tiprdfai.html Keep context straight in XSLT - http://www-106.ibm.com/developerworks/xml/libra ry/x-tipcurrent.html Python Generators + DOM - http://www.xml.com/pub/a/2003/01/08/py-xml.html Using SAX for Proper XML Output - http://www.xml.com/pub/a/2003/03/12/py-xml.ht ml SAX filters for flexible processing - http://www-106.ibm.com/developerworks/xml /library/x-tipsaxflex.html From uche.ogbuji@fourthought.com Wed Mar 26 14:11:00 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Wed, 26 Mar 2003 07:11:00 -0700 Subject: [XML-SIG] Installation In-Reply-To: Message from Uche Ogbuji of "Wed, 26 Mar 2003 06:35:08 MST." Message-ID: > "python setup.py install" works just fine, and is prety flexible. If you just > type > > python setup.py install -h I did add a note about this to the HOWTO. I also added another heap of XBEL links. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Universal Business Language (UBL) - http://www-106.ibm.com/developerworks/xml/l ibrary/x-think16.html EXSLT by example - http://www-106.ibm.com/developerworks/library/x-exslt.html The worry about program wizards - http://www.adtmag.com/article.asp?id=7238 Use rdf:about and rdf:ID effectively in RDF/XML - http://www-106.ibm.com/develo perworks/xml/library/x-tiprdfai.html Keep context straight in XSLT - http://www-106.ibm.com/developerworks/xml/libra ry/x-tipcurrent.html Python Generators + DOM - http://www.xml.com/pub/a/2003/01/08/py-xml.html Using SAX for Proper XML Output - http://www.xml.com/pub/a/2003/03/12/py-xml.ht ml SAX filters for flexible processing - http://www-106.ibm.com/developerworks/xml /library/x-tipsaxflex.html From martin@v.loewis.de Wed Mar 26 19:04:51 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 26 Mar 2003 20:04:51 +0100 Subject: [XML-SIG] Bug with XML file having a doctype declaration In-Reply-To: References: Message-ID: Uche Ogbuji writes: > expat.XML_PARAM_ENTITY_PARSING_NEVER should probably be a parameter to the > relevant readers. Anyone object if I make a backwards-compatible change in > this direction? Yes. I cannot believe that a patch to simply replace XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE with XML_PARAM_ENTITY_PARSING_NEVER will be backwards compatible; this setting was specifically introduced to fix a bug. If you want to make it optional, you should use a SAX feature instead. Regards, Martin From martin@v.loewis.de Wed Mar 26 19:05:37 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 26 Mar 2003 20:05:37 +0100 Subject: [XML-SIG] Bug with XML file having a doctype declaration In-Reply-To: <2040C0A1CA23D51181A30050BAAC990274A8C0@berexch.ber.haufemg.com> References: <2040C0A1CA23D51181A30050BAAC990274A8C0@berexch.ber.haufemg.com> Message-ID: Gottfried.Ganssauge@HAUFE.DE writes: > is that the way it's meant to be done? Or is there an easier, less parser > dependant way to achieve my goal? Yes, you should install an entity resolver, which resolves all external references to empty files. Regards, Martin From uche.ogbuji@fourthought.com Thu Mar 27 00:38:16 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Wed, 26 Mar 2003 17:38:16 -0700 Subject: [XML-SIG] Bug with XML file having a doctype declaration In-Reply-To: Message from martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) of "26 Mar 2003 20:04:51 +0100." Message-ID: > Uche Ogbuji writes: > > > expat.XML_PARAM_ENTITY_PARSING_NEVER should probably be a parameter to the > > relevant readers. Anyone object if I make a backwards-compatible change in > > this direction? > > Yes. I cannot believe that a patch to simply replace > XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE with > XML_PARAM_ENTITY_PARSING_NEVER will be backwards compatible; I agree. Of course I never proposed such a simplistic patch. I proposed to make it an init parameter. > this setting was specifically introduced to fix a bug. > > If you want to make it optional, you should use a SAX feature instead. Makes sense. If I get around to this, I shall do it this way. Thanks. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Universal Business Language (UBL) - http://www-106.ibm.com/developerworks/xml/l ibrary/x-think16.html EXSLT by example - http://www-106.ibm.com/developerworks/library/x-exslt.html The worry about program wizards - http://www.adtmag.com/article.asp?id=7238 Use rdf:about and rdf:ID effectively in RDF/XML - http://www-106.ibm.com/develo perworks/xml/library/x-tiprdfai.html Keep context straight in XSLT - http://www-106.ibm.com/developerworks/xml/libra ry/x-tipcurrent.html Python Generators + DOM - http://www.xml.com/pub/a/2003/01/08/py-xml.html Using SAX for Proper XML Output - http://www.xml.com/pub/a/2003/03/12/py-xml.ht ml SAX filters for flexible processing - http://www-106.ibm.com/developerworks/xml /library/x-tipsaxflex.html From administrateur@dgse.org Thu Mar 27 09:25:03 2003 From: administrateur@dgse.org (administrateur.dgse.org) Date: Thu, 27 Mar 2003 10:25:03 +0100 Subject: [XML-SIG] (no subject) Message-ID: Soldiers of Peace International Association 178, rue Garibaldi 69003 LYON France Phone 33.(0)4.78.95.45.03 Fax : 33(0)4.78.60.32.98 Association régie par la loi de 1901, enregistrée à la Préfecture du Rhône sous le n°1/25636 e-mail : A.I.S.P.@wanadoo.fr Lyon, March 24, 2003 Madam, Mister The International association of the Soldiers of Peace, ONG near the Economic and Social Council of the United Nations, which I have the honor to chair, saw with difficulty the events which proceed at the present time. Those recall with pain to its members the situations which they lived in ex-Yugoslavia, in Lebanon, in Rwanda. The situation of despair which is the daily bread of these populations cannot be tolerated. In order to reduce the sufferings of the Iraqi people, our ONG is mobilized to bring of the humanitarian aid of first urgency to the populations taken refuge and moved Iraqi in agreement with the international law and keeping effects of advertisement. This help will be conveyed by terrestrial way via Turkey. Since more than one week we mobilize ourselves for the organization of these convoys. We already found a conveyor, places of storage and men available and ready to leave. Bonds with food banks and the world of the distribution are weaving itself. Our positioning is done on the long term and the highest authorities of our State, like those European and onusiennes were alerted and support our initiative. To remain most independent possible, we also request your assistance since the collaboration of each one will enable us to carry out this mission as soon as possible. For this reason, we would like that you inform the population of this action and the possibility that it has to take part in it by providing him our co-ordinates. Moreover, we propose with those wishing to financially contribute to the realization of this project to support us by depositing their gifts, deductible from tax, on the account n° 1328768L038 of the establishment n° 20041/01007 with the order of the A.I.S.P. Thank you for your assistance, with the service of the respect of the populations touched hard by these strike military. Laurent ATTAR-BAYROU President of the A.I.S.P. HUMANITARIAN AID IN IRAQ The A.I.S.P is mobilized for the routing of humane convoys bound for the moved or taken refuge Iraqi populations. We propose the plan to you which we follow to concretize the most quickly and effectively possible this project. The two phases here exposed translate our will of engagement on the long term. In addition, we specify that changes can provide following the evolution of the topicality. FIRST PHASE: - We here will present to you how the A.I.S.P will be mobilized for this operation: - constitution of a cell crisis of 4 people with her headquarters located in Lyon with the head office of the ONG. - aiming work near the media of the partnerships or their supports to forward information to the public opinion. - mobilization of all energies such as the reprocessed students, employees and, the companies, etc. - work near authorities onusiennes such as the HCR, FAO and the secretariat-general in order to obtain information on the needs for the Iraqi civil populations taken refuge and moved as well as the essential information with the good routing of the humane convoys. - work near the food power stations, of the factories manufacturing of the food products or other kits which we will be able to convoy. - work with the companies of transport and conditioning - search for places of storage and recovery of food products - opening of an account to receive gifts deductible from tax - clothes industry and effective preparation of the convoys. SECOND PHASE: It then will be a question of setting up coordinators for: - distribution of the humanitarian aids - the management of the needs for the refugee camps - the demobilization of combatants and the installation of security and mineclearing operations. Soldiers of Peace International Association 178, rue Garibaldi 69003 LYON France Phone 33.(0)4.78.95.45.03 Fax : 33(0)4.78.60.32.98 Association régie par la loi de 1901, enregistrée à la Préfecture du Rhône sous le n°1/25636 e-mail : A.I.S.P.@wanadoo.fr Laurent ATTAR-BAYROU Président de l’A.I.S.P. Lyon, le 24 mars 2003 Madame, Monsieur L’Association Internationale des Soldats de la Paix, ONG auprès du Conseil Economique et Social des Nations Unies, que j’ai l’honneur de présider, vit difficilement les événements qui se déroulent à l’heure actuelle. Ceux-ci rappellent avec douleur à ses membres les situations qu’ils ont vécues en ex-Yougoslavie, au Liban, au Rwanda. La situation de désespoir qui est le pain quotidien de ces populations ne peut être tolérée. Afin d’alléger les souffrances du peuple irakien, notre ONG se mobilise pour amener de l’aide humanitaire de première urgence aux populations réfugiées et déplacées Irakiennes en accord avec le droit international et se gardant des effets d’annonce. Cette aide sera acheminée par voie terrestre via la Turquie. Depuis plus d’une semaine nous nous mobilisons pour l’organisation de ces convois. Nous avons déjà trouvé un transporteur, des lieux de stockage et des hommes disponibles et prêt à partir. Des liens avec des banques alimentaires et le monde de la distribution sont en train de se tisser. Notre positionnement se fait sur le long terme et les plus hautes autorités de notre Etat, ainsi que celles européennes et onusiennes ont été alertées et soutiennent notre initiative. Pour rester le plus indépendants possible, nous sollicitons également votre aide puisque la collaboration de chacun nous permettra d’effectuer cette mission le plus rapidement possible. A ce titre, nous aimerions que vous informiez la population de cette action et la possibilité qu'elle a d'y participer en lui fournissant nos coordonnées. De plus, nous proposons à ceux désirant contribuer financièrement à la réalisation de ce projet de nous soutenir en déposant leurs dons, déductibles d’impôt, sur le compte n° 1328768L038 de l'établissement n° 20041/01007 à l'ordre de l'A.I.S.P. Merci de votre aide, au service du respect des populations durement touchées par ces frappes militaires. Laurent ATTAR-BAYROU Président de l’A.I.S.P. AIDE HUMANITAIRE EN IRAK L’ A.I.S.P se mobilise pour l’acheminement de convois humanitaires à destination des populations irakiennes déplacées ou réfugiées. Nous vous proposons le plan que nous suivons pour concrétiser le plus rapidement et efficacement possible ce projet. Les deux phases ici exposées traduisent notre volonté d’engagement sur le long terme. D’autre part, nous précisons que des changements peuvent subvenir suite à l’évolution de l’actualité. PREMIERE PHASE : Nous allons ici vous présenter comment l’A.I.S.P va se mobiliser pour cette opération : - constitution d’une cellule crise de 4 personnes avec son poste de commandement situé à Lyon au siège de l’ONG. - travail auprès des médias visant des partenariats ou leurs soutiens pour faire parvenir l’information à l’opinion publique. - mobilisation de toutes les énergies tels que les étudiants, les employés et retraités, les sociétés, etc. - travail auprès d’autorités onusiennes tel que le HCR, FAO et le secrétariat général afin d’obtenir des informations sur les besoins des populations civiles irakiennes réfugiées et déplacées ainsi que les renseignements indispensables au bon acheminement des convois humanitaires. - travail auprès des centrales alimentaires, des usines fabriquant des denrées ou d’autres kits que nous pourrons convoyer. - travail avec les sociétés de transport et de conditionnement - recherche de lieux de stockage et de récupération de denrées - ouverture d’un compte pour recevoir des dons déductibles d’impôt - confection et préparation effective des convois. DEUXIEME PHASE : Il va ensuite s’agir de mettre en place des coordinateurs pour : - la distribution des aides humanitaires - la gestion des besoins des camps de réfugiés - la démobilisation de combattants et la mise en place d’opérations de déminage et de sécurisation. Sébastien JANVIER Directeur Adjoint et Administrateur www.dgse.org Ce courriel est CONFIDENTIEL et protégé. L'expéditeur ne renonce pas aux droits et obligations qui s'y rapportent. Toute diffusion, utilisation ou copie de ce message ou des renseignements qu'il contient par une personne autre que le (les) destinataire(s) désigné(s) est interdite. Si vous recevez ce courriel par erreur, veuillez m'en aviser immédiatement, par retour de courriel ou par un autre moyen. The information in this e-mail and any attachments is CONFIDENTIAL and may be PRIVILEGED. If you are not the intended recipient, please destroy this message, delete any copies held on your system and notify the sender immediately. You should not retain, copy or use this e-mail for any purpose, nor disclose all or any part of its content to any other person. C O N F I D E N T I A L From fdrake@acm.org Thu Mar 27 16:06:03 2003 From: fdrake@acm.org (Fred L. Drake, Jr.) Date: Thu, 27 Mar 2003 11:06:03 -0500 Subject: [XML-SIG] _ inserted into built-ins Message-ID: <16003.8555.593244.342261@grendel.zope.com> Currently, the symbol "_" is inserted into the built-in namespace (indirectly) in five different places in PyXML, but it looks like the insertion into the built-in namespace is not intentional. The following modules define and use _ for I18N support: - xml.dom.MessageSource - xml.xpath.CoreFunctions - xml.xpath.MessageSource - xml.xslt.MessageSource - xml.xslt.XPatternParserBase In each case, the module either calls gettext.install() or defines a module-local _ function if either gettext can't be imported or the message catalogs can't be found; in that case _ is only defined locally and not inserted into the built-in namespace. Insertion of _ into built-ins can easily mask errors in unrelated code, and should generally be avoided for library-specific message catalogs. I'd like to create a single definition of _ in the xml.FtCore module (since _ is being defined for the '4Suite' domain), and import that in each of the modules that use it. Are there any objections to this? -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From fred@zope.com Thu Mar 27 16:42:06 2003 From: fred@zope.com (Fred L. Drake, Jr.) Date: Thu, 27 Mar 2003 11:42:06 -0500 Subject: [XML-SIG] _ inserted into built-ins In-Reply-To: <16003.8555.593244.342261@grendel.zope.com> References: <16003.8555.593244.342261@grendel.zope.com> Message-ID: <16003.10718.711673.581409@grendel.zope.com> Fred L. Drake, Jr. writes: > Insertion of _ into built-ins can easily mask errors in unrelated > code, and should generally be avoided for library-specific message > catalogs. I'd like to create a single definition of _ in the > xml.FtCore module (since _ is being defined for the '4Suite' domain), > and import that in each of the modules that use it. Looking at this further, there is only one set of message catalogs, and that's for the xml.dom package. Each package currently looks in itself for catalogs. The .po file there contains only DOM-related messages. Perhaps the others should simply define empty _ functions to use for I18N marking, but not actually mess with gettext. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From martin@v.loewis.de Thu Mar 27 18:34:40 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 27 Mar 2003 19:34:40 +0100 Subject: [XML-SIG] _ inserted into built-ins In-Reply-To: <16003.10718.711673.581409@grendel.zope.com> References: <16003.8555.593244.342261@grendel.zope.com> <16003.10718.711673.581409@grendel.zope.com> Message-ID: "Fred L. Drake, Jr." writes: > Perhaps the others should simply define empty _ functions to use for > I18N marking, but not actually mess with gettext. It may be that my import of 4XSLT is incomplete, i.e. that the 4Suite code does have a sensible message catalog. Regards, Martin From martin@v.loewis.de Thu Mar 27 18:33:48 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 27 Mar 2003 19:33:48 +0100 Subject: [XML-SIG] _ inserted into built-ins In-Reply-To: <16003.8555.593244.342261@grendel.zope.com> References: <16003.8555.593244.342261@grendel.zope.com> Message-ID: "Fred L. Drake, Jr." writes: > Are there any objections to this? I'm completely in favour of not modifying the builtins, and have _ module-local in all cases. Regards, Martin From mark@easymailings.com Thu Mar 27 21:10:41 2003 From: mark@easymailings.com (Mark Bucciarelli) Date: Thu, 27 Mar 2003 16:10:41 -0500 Subject: [XML-SIG] Uninstalling pyxml Fixes Crash Message-ID: <200303271610.41642.mark@easymailings.com> I know there was a really long and involved thread on this list recently about pyxml and _xmlplus. I just fixed a crash by uninstalling pyxml, and I'd like to make sure I understand what happened. "All of a sudden" I started getting a SAXParseException when accessing a SOAP method, code that previously had worked just fine. The error message said that SAX could not resolve an external entity in the DTD. I realized I had installed pyxml in the interim, and remembering the thread here, I tried uninstalling it. Voila, the code works fine. In a nutshell, is this what happened? Pyxml libraries take precedence over the "core" libraries and behave differently? In my particular case, the core libraries parse the DTD correctly and pyxml library does not? I'm glad I subscribe here, because this kind of error would have been _really_ hard to debug without having read that thread. From my perspective, it is completely unexpected that an installing an "third-party" library over-rides a core library--hence, a bug. Mark From fdrake@acm.org Thu Mar 27 22:30:14 2003 From: fdrake@acm.org (Fred L. Drake, Jr.) Date: Thu, 27 Mar 2003 17:30:14 -0500 Subject: [XML-SIG] _ inserted into built-ins In-Reply-To: References: <16003.8555.593244.342261@grendel.zope.com> Message-ID: <16003.31606.806131.933188@grendel.zope.com> Martin v. L=F6wis writes: > I'm completely in favour of not modifying the builtins, and have _ > module-local in all cases. I've committed changes so PyXML 0.8.3 won't modify the __builtin__ module. I think the approach I took should work nicely to isolate the compatibility issues that had been handled in several places as well. -Fred --=20 Fred L. Drake, Jr. PythonLabs at Zope Corporation From martin@v.loewis.de Fri Mar 28 00:10:50 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 28 Mar 2003 01:10:50 +0100 Subject: [XML-SIG] Uninstalling pyxml Fixes Crash In-Reply-To: <200303271610.41642.mark@easymailings.com> References: <200303271610.41642.mark@easymailings.com> Message-ID: Mark Bucciarelli writes: > In a nutshell, is this what happened? Pyxml libraries take precedence > over the "core" libraries and behave differently? Yes. > In my particular case, the core libraries parse the DTD correctly > and pyxml library does not? No. The core libraries would fail to read the DTD at all. This was reported as a bug, and fixed in PyXML (and will be fixed in Python 2.3 as well). Regards, Martin From martin@v.loewis.de Fri Mar 28 00:13:33 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 28 Mar 2003 01:13:33 +0100 Subject: [XML-SIG] _ inserted into built-ins In-Reply-To: <16003.31606.806131.933188@grendel.zope.com> References: <16003.8555.593244.342261@grendel.zope.com> <16003.31606.806131.933188@grendel.zope.com> Message-ID: "Fred L. Drake, Jr." writes: > I've committed changes so PyXML 0.8.3 won't modify the __builtin__ > module. I think the approach I took should work nicely to isolate the > compatibility issues that had been handled in several places as well. Unfortunately, it is likely that any changes made to PyXML's 4XSLT will get lost when I get around to incorporating a more recent 4XSLT into PyXML. Regards, Martin From uche.ogbuji@fourthought.com Fri Mar 28 01:30:28 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Thu, 27 Mar 2003 18:30:28 -0700 Subject: [XML-SIG] 4Suite 1.0a1 released Message-ID: <3E83A5B4.2030902@fourthought.com> 4Suite has started down the path to 1.0 with today's release of 1.0 alpha 1, now available from Sourceforge and ftp.4suite.org. 4Suite is a comprehensive platform for XML and RDF processing, with base libraries and a server framework. It is implemented in Python and C, and provides Python and XSLT APIs, Web and command line interfaces. For general information, see: http://4suite.org http://uche.ogbuji.net/tech/4Suite/ http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/pyxml-akara For the files, see: ftp://ftp.4suite.org/pub/4Suite/ Sources: ftp://ftp.4suite.org/pub/4Suite/4Suite-1.0a1.tar.gz Windows installer: ftp://ftp.4suite.org/pub/4Suite/4Suite-1.0a1.win32-py2.1.exe ftp://ftp.4suite.org/pub/4Suite/4Suite-1.0a1.win32-py2.2.exe Windows zip: ftp://ftp.4suite.org/pub/4Suite/4Suite-1.0a1.zip You can also get the files on Sourceforge: https://sourceforge.net/projects/foursuite/ https://sourceforge.net/project/showfiles.php?group_id=39954 IMPORTANT alpha release notes ----------------------------- If you have built a 4Suite repository using an older version of 4Suite, you will probably have to make adjustments for this new release. If you used 0.12.0a3, or a more recent verson, then it should suffice to recompile all stylesheets for each repsitory instance: 4ss_manager recompile In any case, see the following document for more details: http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/backup There may still be problems for Mac OS X builds, although there have now been many success reports followign the discussion at: http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/osx -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Use internal references in XML vocabularies - http://www-106.ibm.com/developerworks/xml/library/x-tipvocab.html Universal Business Language (UBL) - http://www-106.ibm.com/developerworks/xml/library/x-think16.html EXSLT by example - http://www-106.ibm.com/developerworks/library/x-exslt.html The worry about program wizards - http://www.adtmag.com/article.asp?id=7238 Use rdf:about and rdf:ID effectively in RDF/XML - http://www-106.ibm.com/developerworks/xml/library/x-tiprdfai.html Keep context straight in XSLT - http://www-106.ibm.com/developerworks/xml/library/x-tipcurrent.html Using SAX for Proper XML Output - http://www.xml.com/pub/a/2003/03/12/py-xml.html SAX filters for flexible processing - http://www-106.ibm.com/developerworks/xml/library/x-tipsaxflex.html From uche.ogbuji@fourthought.com Fri Mar 28 05:52:21 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Thu, 27 Mar 2003 22:52:21 -0700 Subject: [XML-SIG] _ inserted into built-ins In-Reply-To: Message from martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) of "28 Mar 2003 01:13:33 +0100." Message-ID: > "Fred L. Drake, Jr." writes: > > > I've committed changes so PyXML 0.8.3 won't modify the __builtin__ > > module. I think the approach I took should work nicely to isolate the > > compatibility issues that had been handled in several places as well. > > Unfortunately, it is likely that any changes made to PyXML's 4XSLT > will get lost when I get around to incorporating a more recent 4XSLT > into PyXML. I'll try to port Fred's changes into 4Suite before the next release so that this is not an issue. I've been meaning to give that l10n code a tweak for a while, and whose example would be better to follow than Fred's. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Use internal references in XML vocabularies - http://www-106.ibm.com/developerw orks/xml/library/x-tipvocab.html Universal Business Language (UBL) - http://www-106.ibm.com/developerworks/xml/l ibrary/x-think16.html EXSLT by example - http://www-106.ibm.com/developerworks/library/x-exslt.html The worry about program wizards - http://www.adtmag.com/article.asp?id=7238 Use rdf:about and rdf:ID effectively in RDF/XML - http://www-106.ibm.com/develo perworks/xml/library/x-tiprdfai.html Keep context straight in XSLT - http://www-106.ibm.com/developerworks/xml/libra ry/x-tipcurrent.html Using SAX for Proper XML Output - http://www.xml.com/pub/a/2003/03/12/py-xml.ht ml SAX filters for flexible processing - http://www-106.ibm.com/developerworks/xml /library/x-tipsaxflex.html From fred@zope.com Fri Mar 28 06:32:40 2003 From: fred@zope.com (Fred L. Drake, Jr.) Date: Fri, 28 Mar 2003 01:32:40 -0500 Subject: [XML-SIG] _ inserted into built-ins In-Reply-To: References: <"Message from martin"@v.loewis.de> Message-ID: <16003.60552.3278.175219@grendel.zope.com> Uche Ogbuji writes: > I'll try to port Fred's changes into 4Suite before the next release so that > this is not an issue. I've been meaning to give that l10n code a tweak for a > while, and whose example would be better to follow than Fred's. Well, I think the changes I made are at least reasonable, but I wouldn't trust it without review! You can't take it too seriously since I'm one of those mono-lingual American bigots. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From uche.ogbuji@fourthought.com Fri Mar 28 15:11:59 2003 From: uche.ogbuji@fourthought.com (Uche Ogbuji) Date: Fri, 28 Mar 2003 08:11:59 -0700 Subject: [XML-SIG] Installation In-Reply-To: <20030328142124.GL2354@cs.helsinki.fi> References: <20030326103535.GL837@cs.helsinki.fi> <20030328142124.GL2354@cs.helsinki.fi> Message-ID: <3E84663F.2060908@fourthought.com> Kai Hendry wrote: >Is it wise to encourage my school's admins to install an RPM of XML >python tools? Esp. that to make use of the DefaultHandler in SAX. > >Can you recommend ones made specifically for RH based systems? > >Regards, >-Kai Hendry > > >On Wed, Mar 26, 2003 at 06:35:08 -0700, Uche Ogbuji wrote: > > >>python setup.py install --prefix=$HOME/lib >> >> Please ask such questions on the XML-SIG mailing list. Not only can others help as well as I can, but the discussion can also help others. Personally, I do not recommend any stock RPMs of Linux just because I'm always wary of what versions they use and what patches they throw in. I would recomemend building an RPM yourself for the sysadmin using the downloaded package: ./setup.py install bdist_rpm The created RPM should be in the "dist" directory. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Use internal references in XML vocabularies - http://www-106.ibm.com/developerworks/xml/library/x-tipvocab.html Universal Business Language (UBL) - http://www-106.ibm.com/developerworks/xml/library/x-think16.html EXSLT by example - http://www-106.ibm.com/developerworks/library/x-exslt.html The worry about program wizards - http://www.adtmag.com/article.asp?id=7238 Use rdf:about and rdf:ID effectively in RDF/XML - http://www-106.ibm.com/developerworks/xml/library/x-tiprdfai.html Keep context straight in XSLT - http://www-106.ibm.com/developerworks/xml/library/x-tipcurrent.html Using SAX for Proper XML Output - http://www.xml.com/pub/a/2003/03/12/py-xml.html SAX filters for flexible processing - http://www-106.ibm.com/developerworks/xml/library/x-tipsaxflex.html From martin@v.loewis.de Fri Mar 28 17:34:57 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 28 Mar 2003 18:34:57 +0100 Subject: [XML-SIG] Installation In-Reply-To: <3E84663F.2060908@fourthought.com> References: <20030326103535.GL837@cs.helsinki.fi> <20030328142124.GL2354@cs.helsinki.fi> <3E84663F.2060908@fourthought.com> Message-ID: Uche Ogbuji writes: > >Is it wise to encourage my school's admins to install an RPM of XML > >python tools? Esp. that to make use of the DefaultHandler in SAX. For that very reason, it is not wise. I would discourage the use of the DefaultHandler class. Instead, subclass your handler from those interface classes that you really mean to implement. Regards, Martin From ramiro@labtie.mmt.upc.es Fri Mar 28 19:11:46 2003 From: ramiro@labtie.mmt.upc.es (Ramiro Alba Queipo) Date: 28 Mar 2003 20:11:46 +0100 Subject: [XML-SIG] Newbie question -> adding a node from an external file Message-ID: <1048878706.740.5.camel@mundo.cttc.org> Helllo everybody: I would like to use the addChild method to inserting a node from another document but it trigers an error when I try it. Can anyone give me some insight about how to perform this?. I am not subscribed to the list so please make a Cc: to my e-mail address. Thanks in advance. Regards -- Ramiro Alba Queipo CTTC From fdrake@acm.org Fri Mar 28 19:44:19 2003 From: fdrake@acm.org (Fred L. Drake, Jr.) Date: Fri, 28 Mar 2003 14:44:19 -0500 Subject: [XML-SIG] Newbie question -> adding a node from an external file In-Reply-To: <1048878706.740.5.camel@mundo.cttc.org> References: <1048878706.740.5.camel@mundo.cttc.org> Message-ID: <16004.42515.737495.320174@grendel.zope.com> Ramiro Alba Queipo writes: > I would like to use the addChild method to inserting a node from another > document but it trigers an error when I try it. Can anyone give me some > insight about how to perform this? I'm just guessing that you're using the DOM and mean the appendChild() method. If not, you'll need to be specific about what youre doing. If the nodes are from different documents, it's entirely reasonable to get an exception: the DOM is specified to do so. Some DOM implementations are more permissive than others, but you really should be expecting an exception if more than one document is involved. Since you didn't tell us what exception you got, though, I can't tell if that's what's happening. You also didn't mention which DOM implementation you're using. If you need more help, you're going to need to tell us more about what you're doing and what behaviour you're actually seeing. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From and-xml@doxdesk.com Sat Mar 29 15:34:24 2003 From: and-xml@doxdesk.com (Andrew Clover) Date: Sat, 29 Mar 2003 15:34:24 +0000 Subject: [XML-SIG] Working around problems in older DOM implementations Message-ID: <20030329153424.GA32543@doxdesk.com> Afternoon, I'm working on a DOM-based application which I want to be compatible with as much of the installed base of Python DOM implementations as possible. I'm using DOM Level 2 Namespace-aware Core methods only, with an importer layer that fixes up known bugs in widely-deployed DOMs. I've checked minidom from Python 2.1 and 4DOM from PyXML 0.6.6 so far, and added workarounds for the following problems: - minidom: no native importNode support - minidom: insertBefore/appendChild/replaceChild with DocumentFragment Node fails to insert all new children due to destructive list iteration - minidom: attributes in no namespace get '' namespaceURI instead of None. Elements and attributes in no namespace get '' prefix instead of None. - 4DOM: elements and attributes in no namespace get '' namespaceURI and prefix instead of None. - 4DOM: localName of xmlns="..." declarations is '' instead of 'xmlns'. Are there any other known problems with common DOMs I ought to be looking out for? cheers, -- Andrew Clover mailto:and@doxdesk.com http://www.doxdesk.com/ From martin@v.loewis.de Sat Mar 29 16:13:17 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 29 Mar 2003 17:13:17 +0100 Subject: [XML-SIG] Working around problems in older DOM implementations In-Reply-To: <20030329153424.GA32543@doxdesk.com> References: <20030329153424.GA32543@doxdesk.com> Message-ID: Andrew Clover writes: > I'm using DOM Level 2 Namespace-aware Core methods only, with an importer > layer that fixes up known bugs in widely-deployed DOMs. I've checked minidom > from Python 2.1 and 4DOM from PyXML 0.6.6 so far, and added workarounds for > the following problems: > > - minidom: no native importNode support You should use PyXML; minidom has importNode support. > - minidom: insertBefore/appendChild/replaceChild with DocumentFragment > Node fails to insert all new children due to destructive list iteration That appears to be fixed in PyXML as well. > - minidom: attributes in no namespace get '' namespaceURI instead of None. > Elements and attributes in no namespace get '' prefix instead of None. Can't reproduce this with PyXML. > Are there any other known problems with common DOMs I ought to be looking > out for? Most certainly. However, it is better to fix the bugs instead of listing them. Please make bug reports for any bugs you find. Regards, Martin From ramiro@labtie.mmt.upc.es Sat Mar 29 16:22:48 2003 From: ramiro@labtie.mmt.upc.es (ramiro@labtie.mmt.upc.es) Date: Sat, 29 Mar 2003 17:22:48 +0100 (CET) Subject: [XML-SIG] Re: Newbie question -> adding a node from an external file Message-ID: <20030329162248.33C471BE91@batch.cttc.org> Fred writes: > Ramiro Alba Queipo writes: > > I would like to use the addChild method to inserting a node from another > > document but it trigers an error when I try it. Can anyone give me some > > insight about how to perform this? > > I'm just guessing that you're using the DOM and mean the appendChild() > method. If not, you'll need to be specific about what youre doing. > If the nodes are from different documents, it's entirely reasonable to > get an exception: the DOM is specified to do so. Some DOM > implementations are more permissive than others, but you really should > be expecting an exception if more than one document is involved. > Since you didn't tell us what exception you got, though, I can't tell > if that's what's happening. You also didn't mention which DOM > implementation you're using. > If you need more help, you're going to need to tell us more about what > you're doing and what behaviour you're actually seeing. Sorry about the undefinition Fred, I'll try to be as specific as posible. I am using 0.8.2 version and the situation is the following: I have the following document document (current.xml): ------------------------------------------------------------------------ Thu, 27 Mar 2003 22:27:11 Linux ramiro buzzn 3.5.6 2.95.4 ldd (GNU libc) 2.2.5 2.4.20-k7 LAM 6.5.8/MPI 2 C++/ROMIO - Indiana University 2.2.1 ------------------------------------------------------------------------- I want to insert it in the following one (history.xml) each time I want to save a new result: ------------------------------------------------------------------------------ What I have tried is: #!/usr/bin/python -u import sys, os, string from xml.dom.ext.reader import Sax2 from xml import xpath from xml.dom.ext import Print, PrettyPrint # create Reader object reader = Sax2.Reader() # Current input = open("current.xml", "r") result = reader.fromStream(input) input.close() input = open("history.xml", "r") doc = reader.fromStream(input) input.close() node = xpath.Evaluate('/result', result.documentElement) doc.appendChild(node[0]) output = open("kk.xml", "w") PrettyPrint(doc,output) output.close() ------------------------------------------------------------------------------ And the exception is: Traceback (most recent call last): File "./mail.py", line 21, in ? doc.appendChild(node[0]) File "/usr/lib/python2.2/site-packages/_xmlplus/dom/Document.py", line 222, in appendChild self._4dom_addSingle(newChild) File "/usr/lib/python2.2/site-packages/_xmlplus/dom/Document.py", line 287, in _4dom_addSingle self._4dom_validateNode(node) File "/usr/lib/python2.2/site-packages/_xmlplus/dom/FtNode.py", line 387, in _4dom_validateNode raise WrongDocumentErr() xml.dom.WrongDocumentErr: Node is from a different document ------------------------------------------------------------------------------- This agrees with what you are saying above. The question is: 1) How can I manage to doit with python-xml dom? 2) If the answer is I can not, what are the alternatives (xslt?) Thank you very much for your answer From martin@v.loewis.de Sat Mar 29 23:40:38 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 30 Mar 2003 00:40:38 +0100 Subject: [XML-SIG] Re: Newbie question -> adding a node from an external file In-Reply-To: <20030329162248.33C471BE91@batch.cttc.org> References: <20030329162248.33C471BE91@batch.cttc.org> Message-ID: ramiro@labtie.mmt.upc.es writes: > 1) How can I manage to doit with python-xml dom? You should use importNode. Regards, Martin From and-xml@doxdesk.com Sun Mar 30 00:43:22 2003 From: and-xml@doxdesk.com (Andrew Clover) Date: Sun, 30 Mar 2003 00:43:22 +0000 Subject: [XML-SIG] Working around problems in older DOM implementations In-Reply-To: References: <20030329153424.GA32543@doxdesk.com> Message-ID: <20030330004322.GA4563@doxdesk.com> Martin v. Loewis wrote: > Most certainly. However, it is better to fix the bugs instead of > listing them. Please make bug reports for any bugs you find. The bugs I have found appear to be fixed in 0.8.x so are no longer of much interest to PyXML developers. However, I would like my software to be compatible with older versions of PyXML and in particular with the minidoms supplied as standard with the various Python releases. I know many users will be unwilling or incapable to change their XML packages. Are there any resources on compatibility with older'n'buggier releases, or must I install and test each one? -- Andrew Clover mailto:and@doxdesk.com http://www.doxdesk.com/ From martin@v.loewis.de Sun Mar 30 01:51:35 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 30 Mar 2003 03:51:35 +0200 Subject: [XML-SIG] Working around problems in older DOM implementations In-Reply-To: <20030330004322.GA4563@doxdesk.com> References: <20030329153424.GA32543@doxdesk.com> <20030330004322.GA4563@doxdesk.com> Message-ID: Andrew Clover writes: > Are there any resources on compatibility with older'n'buggier releases, or > must I install and test each one? You could study the CVS log files to see what changes have been made, and when. It is probably easier, and more reliable, to test your software with the systems you want to use. Regards, Martin From cstrong@arielpartners.com Sun Mar 30 20:53:10 2003 From: cstrong@arielpartners.com (Craeg K Strong) Date: Sun, 30 Mar 2003 15:53:10 -0500 Subject: [XML-SIG] Advice on how to deal with locking problems using python-wrapped C libs in MT frameworks like Zope/Twisted? In-Reply-To: References: <3E7B6709.3050409@arielpartners.com> <3E7EB3C0.3020205@arielpartners.com> Message-ID: <3E875936.3080701@arielpartners.com> Thanks for the great suggestion! =20 The following output is generated using strace with Zope 2.6.1, Python 2.1, libxslt 1.0.27 on Red Hat Linux 8.0: ... stat64("http://127.0.0.1:55068/testFolder_1_/arielpartners/propfolder/foo= /properties",=20 0xbfffd57c) =3D -1 ENOENT (No such file or directory) gettimeofday({1049056912, 152558}, NULL) =3D 0 getpid() =3D 12061 open("/etc/resolv.conf", O_RDONLY) =3D 11 fstat64(11, {st_mode=3DS_IFREG|0644, st_size=3D110, ...}) =3D 0 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,=20 -1, 0) =3D 0x40316000 read(11, "; generated by /sbin/dhclient-sc"..., 4096) =3D 110 read(11, "", 4096) =3D 0 close(11) =3D 0 munmap(0x40316000, 4096) =3D 0 socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) =3D 11 fcntl64(11, F_GETFL) =3D 0x2 (flags O_RDWR) fcntl64(11, F_SETFL, O_RDWR|O_NONBLOCK) =3D 0 connect(11, {sin_family=3DAF_INET, sin_port=3Dhtons(55068),=20 sin_addr=3Dinet_addr("127.0.0.1")}}, 16) =3D -1 EINPROGRESS (Operation no= w=20 in progress) select(12, NULL, [11], NULL, {60, 0}) =3D 1 (out [11], left {60, 0}) getsockopt(11, SOL_SOCKET, SO_ERROR, [0], [4]) =3D 0 send(11, "GET /testFolder_1_/arielpartners"..., 88, 0) =3D 88 brk(0) =3D 0x8b4d000 brk(0x8b5d000) =3D 0x8b5d000 recv(11, 0x8b4cfd8, 4096, 0) =3D -1 EAGAIN (Resource=20 temporarily unavailable) select(12, [11], NULL, NULL, {60, 0}) =3D 0 (Timeout) =20 <=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D LENGTHY TIMEOUT HAPPEN= S HERE recv(11, 0x8b4cfd8, 4096, 0) =3D -1 EAGAIN (Resource=20 temporarily unavailable) select(12, [11], NULL, NULL, {60, 0}) =3D 0 (Timeout) =20 <=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D AND AGAIN HERE kill(12063, SIGRTMIN) =3D 0 rt_sigprocmask(SIG_SETMASK, NULL, [RTMIN], 8) =3D 0 rt_sigsuspend([] --- SIGRTMIN (Unknown signal 32) --- <... rt_sigsuspend resumed> ) =3D -1 EINTR (Interrupted system = call) sigreturn() =3D ? (mask now [RTMIN]) close(11) =3D 0 kill(12063, SIGRTMIN) =3D 0 write(2, "^\n\n", 3^ ) =3D 3 write(2, "FAIL", 4FAIL)=20 .... lots of messages follow to print out the errors When libxslt tries to resolve the relative URL, a request is going out=20 to grab: http://127.0.0.1:55068/testFolder_1_/arielpartners/propfolder/foo/propert= ies which ends up coming back in to Zope. Zope is multi-threaded, so why shouldn't that be able to return successfully? Is libxslt-python somehow holding on to the GIL or-- maybe it is still in the middle of the "read" call and is therefore holding a lock on that resource? Thanks in advance, --Craeg Martin v. L=F6wis wrote: >Craeg K Strong writes: > =20 > >>Yes. Based on the above information, can you suggest a direction of >>inquiry? >> =20 >> > >I suggest to investigate this with strace. > >Regards, >Martin > =20 > From martin@v.loewis.de Sun Mar 30 21:26:46 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 30 Mar 2003 23:26:46 +0200 Subject: [XML-SIG] Advice on how to deal with locking problems using python-wrapped C libs in MT frameworks like Zope/Twisted? In-Reply-To: <3E875936.3080701@arielpartners.com> References: <3E7B6709.3050409@arielpartners.com> <3E7EB3C0.3020205@arielpartners.com> <3E875936.3080701@arielpartners.com> Message-ID: Craeg K Strong writes: > When libxslt tries to resolve the relative URL, a request is going out > to grab: > > http://127.0.0.1:55068/testFolder_1_/arielpartners/propfolder/foo/properties > > which ends up coming back in to Zope. Zope is multi-threaded, so why > shouldn't that be able to return successfully? Is libxslt-python somehow > holding on to the GIL or-- maybe it is still in the middle of the "read" > call and is therefore holding a lock on that resource? One would have to know a lot of internal details here that you probably have to investigate yourself, unless you can find some Zope-and-libxslt guru. Here are some theories: 1. Zope is not responding since it considers the request incomplete One would have to study the 88 bytes request data (use -s2000 on strace) to determine whether the request is complete - yet Zope may *still* waiting for more data for some reason (e.g. a bug). 2. Zope is not configured to process more than one request. It accepts the connection only since this is in the listen backlog; it doesn't actually read the data - not because it couldn't, but because it does not want to. 3. The GIL is held while libxslt makes this request. If I think long enough, I can come up with more consistent theories :-) Which of these are plausible, I don't know; most likely, the real reason would not give a plausible theory. What mechanism in libxslt does make the callback? Is that Python code, or code implemented in libxslt itself? Regards, Martin From veillard@redhat.com Sun Mar 30 21:29:47 2003 From: veillard@redhat.com (Daniel Veillard) Date: Sun, 30 Mar 2003 16:29:47 -0500 Subject: [XML-SIG] Advice on how to deal with locking problems using python-wrapped C libs in MT frameworks like Zope/Twisted? In-Reply-To: <3E875936.3080701@arielpartners.com>; from cstrong@arielpartners.com on Sun, Mar 30, 2003 at 03:53:10PM -0500 References: <3E7B6709.3050409@arielpartners.com> <3E7EB3C0.3020205@arielpartners.com> <3E875936.3080701@arielpartners.com> Message-ID: <20030330162947.R31240@redhat.com> On Sun, Mar 30, 2003 at 03:53:10PM -0500, Craeg K Strong wrote: > sin_addr=inet_addr("127.0.0.1")}}, 16) = -1 EINPROGRESS (Operation now > in progress) > select(12, NULL, [11], NULL, {60, 0}) = 1 (out [11], left {60, 0}) > getsockopt(11, SOL_SOCKET, SO_ERROR, [0], [4]) = 0 > send(11, "GET /testFolder_1_/arielpartners"..., 88, 0) = 88 > brk(0) = 0x8b4d000 > brk(0x8b5d000) = 0x8b5d000 > recv(11, 0x8b4cfd8, 4096, 0) = -1 EAGAIN (Resource > temporarily unavailable) > select(12, [11], NULL, NULL, {60, 0}) = 0 (Timeout) > <================ LENGTHY TIMEOUT HAPPENS HERE > recv(11, 0x8b4cfd8, 4096, 0) = -1 EAGAIN (Resource > temporarily unavailable) > select(12, [11], NULL, NULL, {60, 0}) = 0 (Timeout) > <================ AND AGAIN HERE > kill(12063, SIGRTMIN) = 0 > rt_sigprocmask(SIG_SETMASK, NULL, [RTMIN], 8) = 0 > rt_sigsuspend([] > --- SIGRTMIN (Unknown signal 32) --- > <... rt_sigsuspend resumed> ) = -1 EINTR (Interrupted system call) > sigreturn() = ? (mask now [RTMIN]) > close(11) = 0 > kill(12063, SIGRTMIN) = 0 > write(2, "^\n\n", 3^ > > ) = 3 > write(2, "FAIL", 4FAIL) > > .... lots of messages follow to print out the errors > > When libxslt tries to resolve the relative URL, a request is going out > to grab: > > http://127.0.0.1:55068/testFolder_1_/arielpartners/propfolder/foo/properties > > which ends up coming back in to Zope. Zope is multi-threaded, so why > shouldn't that be able to return successfully? Is libxslt-python somehow > holding on to the GIL or-- maybe it is still in the middle of the "read" > call and is therefore holding a lock on that resource? Hum, libxslt does a direct recv() on the socket then a select wait if data is not available. Theorically another thread should be able to make the read() process and write back unlocking the select with data to read. However, why go through the OS and suffer such synchronization and threading overhead. Simply install a resolver for libxml2/libxslt and when an http resource to the local host and port is required provide the data directly and return the file or the resulting string. See python/tests/resolver.py in libxml2 source or docs to see how to install a resolver. Daniel -- Daniel Veillard | Red Hat Network https://rhn.redhat.com/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ From veillard@redhat.com Sun Mar 30 21:30:59 2003 From: veillard@redhat.com (Daniel Veillard) Date: Sun, 30 Mar 2003 16:30:59 -0500 Subject: [XML-SIG] Advice on how to deal with locking problems using python-wrapped C libs in MT frameworks like Zope/Twisted? In-Reply-To: ; from martin@v.loewis.de on Sun, Mar 30, 2003 at 11:26:46PM +0200 References: <3E7B6709.3050409@arielpartners.com> <3E7EB3C0.3020205@arielpartners.com> <3E875936.3080701@arielpartners.com> Message-ID: <20030330163059.S31240@redhat.com> On Sun, Mar 30, 2003 at 11:26:46PM +0200, Martin v. L=F6wis wrote: > What mechanism in libxslt does make the callback? Is that Python code, > or code implemented in libxslt itself? In libxslt as I posted but that can be overriden. Daniel --=20 Daniel Veillard | Red Hat Network https://rhn.redhat.com/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ From cstrong@arielpartners.com Sun Mar 30 21:33:10 2003 From: cstrong@arielpartners.com (Craeg K Strong) Date: Sun, 30 Mar 2003 16:33:10 -0500 Subject: [XML-SIG] Advice on how to deal with locking problems using python-wrapped C libs in MT frameworks like Zope/Twisted? In-Reply-To: References: <3E7B6709.3050409@arielpartners.com> <3E7EB3C0.3020205@arielpartners.com> <3E875936.3080701@arielpartners.com> Message-ID: <3E876296.9020303@arielpartners.com> See below: Martin v. L=F6wis wrote: >Craeg K Strong writes: > =20 > >>When libxslt tries to resolve the relative URL, a request is going out >>to grab: >> >>http://127.0.0.1:55068/testFolder_1_/arielpartners/propfolder/foo/prope= rties >> >>which ends up coming back in to Zope. Zope is multi-threaded, so why >>shouldn't that be able to return successfully? Is libxslt-python someh= ow >>holding on to the GIL or-- maybe it is still in the middle of the "read= " >>call and is therefore holding a lock on that resource? >> =20 >> > >One would have to know a lot of internal details here that you >probably have to investigate yourself, unless you can find some >Zope-and-libxslt guru. Here are some theories: > >1. Zope is not responding since it considers the request incomplete > One would have to study the 88 bytes request data (use -s2000 on > strace) to determine whether the request is complete - yet Zope > may *still* waiting for more data for some reason (e.g. a bug). >2. Zope is not configured to process more than one request. It accepts > the connection only since this is in the listen backlog; it doesn't > actually read the data - not because it couldn't, but because it > does not want to. >3. The GIL is held while libxslt makes this request. > >If I think long enough, I can come up with more consistent theories :-) >Which of these are plausible, I don't know; most likely, the real >reason would not give a plausible theory. > >What mechanism in libxslt does make the callback? Is that Python code, >or code implemented in libxslt itself? > I am not sure. The callback is probably in C code. However, the GIL=20 may have been locked before that by the Python wrapper. libxslt-python may=20 employ that strategy-- lock GIL, descend into C code, return, unlock GIL. I don't=20 really know... Are there some specified questions to ask Daniel? Thanks, --Craeg > >Regards, >Martin > =20 > --=20 Craeg K Strong, General Partner Ariel Partners LLC http://www.arielpartners.com voice 781-647-2425 fax 781-647-9690 NOTICE: This message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies -- including electronic copies -- of the original message. From martin@v.loewis.de Mon Mar 31 04:53:54 2003 From: martin@v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Mon, 31 Mar 2003 06:53:54 +0200 Subject: [XML-SIG] Advice on how to deal with locking problems using python-wrapped C libs in MT frameworks like Zope/Twisted? In-Reply-To: <20030330163059.S31240@redhat.com> References: <3E7B6709.3050409@arielpartners.com> <3E7EB3C0.3020205@arielpartners.com> <3E875936.3080701@arielpartners.com> <20030330163059.S31240@redhat.com> Message-ID: <3E87C9E2.7080507@v.loewis.de> Daniel Veillard schrieb: >>What mechanism in libxslt does make the callback? Is that Python code, >>or code implemented in libxslt itself? > > > In libxslt as I posted but that can be overriden. That probably explains the deadlock: I assume libxslt is holding the GIL when that happens? Regards, Martin From veillard@redhat.com Mon Mar 31 09:24:38 2003 From: veillard@redhat.com (Daniel Veillard) Date: Mon, 31 Mar 2003 04:24:38 -0500 Subject: [XML-SIG] Advice on how to deal with locking problems using python-wrapped C libs in MT frameworks like Zope/Twisted? In-Reply-To: <3E87C9E2.7080507@v.loewis.de>; from martin@v.loewis.de on Mon, Mar 31, 2003 at 06:53:54AM +0200 References: <3E7B6709.3050409@arielpartners.com> <3E7EB3C0.3020205@arielpartners.com> <3E875936.3080701@arielpartners.com> <20030330163059.S31240@redhat.com> <3E87C9E2.7080507@v.loewis.de> Message-ID: <20030331042438.V31240@redhat.com> On Mon, Mar 31, 2003 at 06:53:54AM +0200, "Martin v. L=F6wis" wrote: > Daniel Veillard schrieb: > >>What mechanism in libxslt does make the callback? Is that Python code= , > >>or code implemented in libxslt itself? > >=20 > >=20 > > In libxslt as I posted but that can be overriden. >=20 > That probably explains the deadlock: I assume libxslt is holding the GI= L > when that happens? No idea what the GIL is, I don't take nor release any lock at the C or python level. Daniel --=20 Daniel Veillard | Red Hat Network https://rhn.redhat.com/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ From mal@lemburg.com Mon Mar 31 09:35:35 2003 From: mal@lemburg.com (M.-A. Lemburg) Date: Mon, 31 Mar 2003 11:35:35 +0200 Subject: [XML-SIG] Advice on how to deal with locking problems using python-wrapped C libs in MT frameworks like Zope/Twisted? In-Reply-To: <20030331042438.V31240@redhat.com> References: <3E7B6709.3050409@arielpartners.com> <3E7EB3C0.3020205@arielpartners.com> <3E875936.3080701@arielpartners.com> <20030330163059.S31240@redhat.com> <3E87C9E2.7080507@v.loewis.de> <20030331042438.V31240@redhat.com> Message-ID: <3E880BE7.4040103@lemburg.com> Daniel Veillard wrote: > On Mon, Mar 31, 2003 at 06:53:54AM +0200, "Martin v. L=F6wis" wrote: >=20 >>Daniel Veillard schrieb: >> >>>>What mechanism in libxslt does make the callback? Is that Python code= , >>>>or code implemented in libxslt itself? >>> >>> >>> In libxslt as I posted but that can be overriden. >> >>That probably explains the deadlock: I assume libxslt is holding the GI= L >>when that happens? >=20 > No idea what the GIL is, I don't take nor release any lock at the C o= r > python level. The GIL is the global Python interpreter lock. A Python extension can release it whenever long running IO will happen. When using callbacks you have to watch out though because releasing the GIL can cause the interpreter to call back into your extension, so that'll have to be thread safe. Here's an example of how to release the GIL in C: Py_BEGIN_ALLOW_THREADS; /* Call into some C lib */ Py_END_ALLOW_THREADS; --=20 Marc-Andre Lemburg eGenix.com Professional Python Software directly from the Source (#1, Mar 31 2003) >>> Python/Zope Products & Consulting ... http://www.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ Python UK 2003, Oxford: one day left EuroPython 2003, Charleroi, Belgium: 85 days left From veillard@redhat.com Mon Mar 31 10:09:20 2003 From: veillard@redhat.com (Daniel Veillard) Date: Mon, 31 Mar 2003 05:09:20 -0500 Subject: [XML-SIG] Advice on how to deal with locking problems using python-wrapped C libs in MT frameworks like Zope/Twisted? In-Reply-To: <3E880BE7.4040103@lemburg.com>; from mal@lemburg.com on Mon, Mar 31, 2003 at 11:35:35AM +0200 References: <3E7B6709.3050409@arielpartners.com> <3E7EB3C0.3020205@arielpartners.com> <3E875936.3080701@arielpartners.com> <20030330163059.S31240@redhat.com> <3E87C9E2.7080507@v.loewis.de> <20030331042438.V31240@redhat.com> <3E880BE7.4040103@lemburg.com> Message-ID: <20030331050920.W31240@redhat.com> On Mon, Mar 31, 2003 at 11:35:35AM +0200, M.-A. Lemburg wrote: > Daniel Veillard wrote: > > No idea what the GIL is, I don't take nor release any lock at the C or > > python level. > > The GIL is the global Python interpreter lock. A Python extension Urghhh, > can release it whenever long running IO will happen. When using > callbacks you have to watch out though because releasing the GIL > can cause the interpreter to call back into your extension, > so that'll have to be thread safe. Seems rather that the Python interpreter itself is not reentrant ! > Here's an example of how to release the GIL in C: > > Py_BEGIN_ALLOW_THREADS; > /* Call into some C lib */ > Py_END_ALLOW_THREADS; Hum, of course I assume it's an expensive operation. As a result I can't generate it for all calls to libxml2 or libxslt, and which call need it or not need to be manually selected, it's not something which can be automated. As a result it's a request for enhancement of my Python bindings but since it requires going over the full set of entry point manually, and an update of the bindings generator don't expect it to be done quickly. Daniel -- Daniel Veillard | Red Hat Network https://rhn.redhat.com/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ From nicogrubert@web.de Mon Mar 31 11:52:09 2003 From: nicogrubert@web.de (Nico Grubert) Date: Mon, 31 Mar 2003 13:52:09 +0200 Subject: [XML-SIG] Re: how to use XSV in python to validate an xml file against an xsd schema file Message-ID: <200303311152.h2VBq9q27850@mailgate5.cinetic.de> hello henry, thank you for your posting. Unfortunately, I do not know exactly what I have to do with the line " res[0].printme(sys.stdout) " you mentioned in your posting. What I am trying is: - run the 'validateTestXML.py' to validate "myxmlfile.xml" against the "myxsdfile.xsd" XSD schema file - write the result into a variable 'res' to see, if error(s) ocurred or not What's wrong in my short script below ( 'validateTestXML.py' )? - Is it right, that I call the method 'runitAndShow()' to to validate "myxmlfile.xml" against the "myxsdfile.xsd" XSD schema file ? - How do I get a result if the validation returned errors or not ? -nico > hello, > > i played around with XSV. I have installed it on win2000 and run the XSV file from the command line passing an xml file and and xsd schema file. > > how can i use XSV in python ? > > I tried: > > """ > # validateTestXML.py > > from XSV.driver import runitAndShow > > xmlfile = "myxmlfile.xml" > schemafile = "myxsdfile.xsd" > > res = runitAndShow( xmlfile, schemafile ) > print res > > """ > > but python does not print out anything. how can I print, if the validation brought errors or not ? > > has anybody ever used it directly in python ? > > > > thanks in advance > > -nico ############################################# > ht@cogsci.ed.ac.uk (Henry S. Thompson) writes: > > > > > res.printme(sys.stdout) > > That should have been > > res[0].printme(sys.stdout) > > ht > -- ______________________________________________________________________________ Finger wund tippen beim SMS Schreiben? Schluss damit! Web.de FreeMail - http://freemail.web.de/features/?mc=021148 From mark@easymailings.com Mon Mar 31 16:54:03 2003 From: mark@easymailings.com (Mark Bucciarelli) Date: Mon, 31 Mar 2003 11:54:03 -0500 Subject: [XML-SIG] Uninstalling pyxml Fixes Crash In-Reply-To: References: <200303271610.41642.mark@easymailings.com> Message-ID: <200303311154.03195.mark@easymailings.com> On Thursday 27 March 2003 7:10 pm, Martin v. L=F6wis wrote: > Mark Bucciarelli writes: > > In a nutshell, is this what happened? Pyxml libraries take > > precedence over the "core" libraries and behave differently? > > Yes. > > > In my particular case, the core libraries parse the DTD correctly > > and pyxml library does not? > > No. The core libraries would fail to read the DTD at all. This was > reported as a bug, and fixed in PyXML (and will be fixed in Python > 2.3 as well). So it's either a bug in the DTD or the PyXML version I'm using. Is there such a thing as an on-line DTD validator? I didn't find one=20 on google. Lacking that, I guess I need to download another SOAP=20 client that reads the DTD and see if the SOAP call works. Is there=20 one client that is preferred over another for this task; for example,=20 a reference standard implementation? Mark From martin@v.loewis.de Mon Mar 31 21:44:12 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 31 Mar 2003 23:44:12 +0200 Subject: [XML-SIG] Uninstalling pyxml Fixes Crash In-Reply-To: <200303311154.03195.mark@easymailings.com> References: <200303271610.41642.mark@easymailings.com> <200303311154.03195.mark@easymailings.com> Message-ID: Mark Bucciarelli writes: > > No. The core libraries would fail to read the DTD at all. This was > > reported as a bug, and fixed in PyXML (and will be fixed in Python > > 2.3 as well). > > So it's either a bug in the DTD or the PyXML version I'm using. Might be neither - nor: It just might fail to locate the DTD. You haven't provided enough detail to tell. Regards, Martin From martin@v.loewis.de Mon Mar 31 21:46:45 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 31 Mar 2003 23:46:45 +0200 Subject: [XML-SIG] Advice on how to deal with locking problems using python-wrapped C libs in MT frameworks like Zope/Twisted? In-Reply-To: <20030331050920.W31240@redhat.com> References: <3E7B6709.3050409@arielpartners.com> <3E7EB3C0.3020205@arielpartners.com> <3E875936.3080701@arielpartners.com> <20030330163059.S31240@redhat.com> <3E87C9E2.7080507@v.loewis.de> <20030331042438.V31240@redhat.com> <3E880BE7.4040103@lemburg.com> <20030331050920.W31240@redhat.com> Message-ID: Daniel Veillard writes: > Seems rather that the Python interpreter itself is not reentrant ! Correct. People agree that this is a good thing, given the alternatives. Regards, Martin From mark@easymailings.com Mon Mar 31 21:41:21 2003 From: mark@easymailings.com (Mark Bucciarelli) Date: Mon, 31 Mar 2003 16:41:21 -0500 Subject: [XML-SIG] Uninstalling pyxml Fixes Crash In-Reply-To: References: <200303271610.41642.mark@easymailings.com> <200303311154.03195.mark@easymailings.com> Message-ID: <200303311641.21403.mark@easymailings.com> On Monday 31 March 2003 4:44 pm, Martin v. L=F6wis wrote: > Mark Bucciarelli writes: > > > No. The core libraries would fail to read the DTD at all. This > > > was reported as a bug, and fixed in PyXML (and will be fixed in > > > Python 2.3 as well). > > > > So it's either a bug in the DTD or the PyXML version I'm using. > > Might be neither - nor: It just might fail to locate the DTD. You > haven't provided enough detail to tell. I was able to wget the dtd and the included dtd. The SAXParserError=20 gave a line and column number that pointed to an entity reference. =20 The SAXParserError was unable to resolve entity, so that seemed to=20 jibe. :) Anything else that might be helpful? Mark From martin@v.loewis.de Mon Mar 31 23:12:44 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 01 Apr 2003 01:12:44 +0200 Subject: [XML-SIG] Uninstalling pyxml Fixes Crash In-Reply-To: <200303311641.21403.mark@easymailings.com> References: <200303271610.41642.mark@easymailings.com> <200303311154.03195.mark@easymailings.com> <200303311641.21403.mark@easymailings.com> Message-ID: Mark Bucciarelli writes: > > Might be neither - nor: It just might fail to locate the DTD. You > > haven't provided enough detail to tell. > > I was able to wget the dtd and the included dtd. The SAXParserError > gave a line and column number that pointed to an entity reference. > The SAXParserError was unable to resolve entity, so that seemed to > jibe. :) Anything else that might be helpful? Yes, an exact citation of the XML and DTD, perhaps in form of a minimal example. Regards, Martin