From noreply at sourceforge.net Tue Nov 4 06:10:03 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Nov 4 06:10:09 2003 Subject: [XML-SIG] [ pyxml-Bugs-835638 ] xmlproc does no call ContentHandler.setDocumentLocator Message-ID: Bugs item #835638, was opened at 2003-11-04 12:10 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=106473&aid=835638&group_id=6473 Category: SAX Group: None Status: Open Resolution: None Priority: 7 Submitted By: J?rgen Hermann (jhermann) Assigned to: Nobody/Anonymous (nobody) Summary: xmlproc does no call ContentHandler.setDocumentLocator Initial Comment: PyXML version 0.8.3 The SAX2 driver for xmlproc does no call ContentHandler.setDocumentLocator, the following diff fixes this: Diff for _xmlplus/sax/drivers2/drv_xmlproc.py @@ -181,6 +181,7 @@ def set_locator(self, locator): self._locator = locator + self._cont_handler.setDocumentLocator(self) def doc_start(self): self._cont_handler.startDocument() ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=106473&aid=835638&group_id=6473 From sbadaoui at uni-select.com Tue Nov 4 10:21:22 2003 From: sbadaoui at uni-select.com (Samir Badaoui) Date: Tue Nov 4 10:21:11 2003 Subject: [XML-SIG] Problem PyXML installation Message-ID: Hi, I am trying to install PyXML-0.8.1 under my AIX 4.3.3 box. I have installed the binary distribution of Python2.2 I downloaded the source distribution of PyXML-0.8.1 I compiled it successfully with the command 'python setup.py build' But when I want to install it with 'python setup.py install' command, I get the following error : ------------- distutils.errors.DistutilsPlatformError: invalid Python installation: unable to open /opt/freeware/lib/python2.2/config/Makefile (No such file or directory) ------------ Effectively, I don't have the Makefile in my python2.2/config directory. Can you please Help me with this ?? Thanks in advance Samir Badaoui Database Administrator Uni-Select Phone : (450) 641-2119 Ext 5785 (450) 449-7300 Ext 5911 Fax : (450) 641-6986 sbadaoui@uni-select.com From martin at v.loewis.de Tue Nov 4 17:00:39 2003 From: martin at v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: Tue Nov 4 17:01:01 2003 Subject: [XML-SIG] Problem PyXML installation In-Reply-To: References: Message-ID: "Samir Badaoui" writes: > I am trying to install PyXML-0.8.1 under my AIX 4.3.3 box. > I have installed the binary distribution of Python2.2 It appears that the binary distributions is incomplete, as it lacks the Makefile. You should either install the missing parts as well, or build Python from source. Regards, Martin From mike at skew.org Tue Nov 4 17:32:28 2003 From: mike at skew.org (Mike Brown) Date: Tue Nov 4 17:32:27 2003 Subject: [XML-SIG] Problem PyXML installation In-Reply-To: "from Martin v. L_wis at Nov 4, 2003 11:00:39 pm" Message-ID: <200311042232.hA4MWSEe071603@chilled.skew.org> Martin v. L_wis wrote: > "Samir Badaoui" writes: > > > I am trying to install PyXML-0.8.1 under my AIX 4.3.3 box. > > I have installed the binary distribution of Python2.2 > > It appears that the binary distributions is incomplete, as it lacks > the Makefile. You should either install the missing parts as well, or > build Python from source. I'd also suggest building PyXML 0.8.3, not 0.8.1. From KSBeattie at lbl.gov Tue Nov 4 19:35:02 2003 From: KSBeattie at lbl.gov (Keith Beattie) Date: Tue Nov 4 19:35:47 2003 Subject: [XML-SIG] fr/LC_MESSAGES/4suite.mo or 4Suite.mo ? Message-ID: <3FA845B6.3090003@lbl.gov> In building and installing from the current cvs, install looks for fr/LC_MESSAGE/4Suite.mo when there is a 4suite.mo (no upper 'S') in that dir. Putting in a symlink solves the problem for me but it appears that 4suite.mo should be renamed to 4Suite.mo. ksb -- // Keith S. Beattie Secure Grid Technologies Group \\ // KSBeattie@lbl.gov Distributed Systems Department \\ // http://dsd.lbl.gov/~ksb Computational Research Division \\ // Lawrence Berkeley Laboratory \\ From rz at webde-ag.de Wed Nov 5 03:32:29 2003 From: rz at webde-ag.de (Robert Zimmermann) Date: Wed Nov 5 03:32:37 2003 Subject: [XML-SIG] Python module for VoiceXML Message-ID: <74ADFA8C453ED611A71E00508BBBA135897F6E@exchange1.cinetic.de> Hi, I'm looking for a python module or package, which deals with VoiceXML. Does someone know something about such a python project? thanks, robert From frederic.gobry at smartdata.ch Thu Nov 6 11:35:55 2003 From: frederic.gobry at smartdata.ch (Frederic Gobry) Date: Thu Nov 6 11:36:05 2003 Subject: [XML-SIG] composite documents Message-ID: <20031106163555.GA1162@rhin> Hi, I wondered what the best solution would be to solve the following problem: I've two families of XML documents my application generates. The first one (let's call it the Schema, even if it's a plain XML document) can be saved standalone, or as part of the second (the Data). I've a xml.sax.handler.ContentHandler derived class to parse the Schema, and I would like to somehow reuse it in the content handler of the Data parser. Is it possible, easy, not a good idea ? Thanks for your enlighted comments :-) Fr?d?ric -- Fr?d?ric Gobry SMARTDATA http://www.smartdata.ch/ PGP: 5B44F4A5 Lausanne - Switzerland +41 21 693 84 98 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://mail.python.org/pipermail/xml-sig/attachments/20031106/e90e7120/attachment.bin From roman at interview-machine.com Thu Nov 6 13:42:00 2003 From: roman at interview-machine.com (roman@interview-machine.com) Date: Thu Nov 6 13:42:17 2003 Subject: [XML-SIG] composite documents In-Reply-To: <20031106163555.GA1162@rhin> References: <20031106163555.GA1162@rhin> Message-ID: <33280.217.187.88.99.1068144120.squirrel@interview-machine.com> Hi, > I've a xml.sax.handler.ContentHandler derived class to parse the > Schema, and I would like to somehow reuse it in the content handler of > the Data parser. Is it possible, easy, not a good idea ? I think, that should not be too hard to implement. If - in the data parser - you come to the 'embedded' schema part, you only have to forward all SAX events to the schema parser instance. Set a flag in your data parser when the schema part begins and delete the flag if it end, and in all event handlers, forward the event to the schema parser, if that flag is set. Regards, Roman -- http://interview-machine.com/soap/ From faassen at vet.uu.nl Fri Nov 7 18:41:36 2003 From: faassen at vet.uu.nl (Martijn Faassen) Date: Fri Nov 7 18:41:48 2003 Subject: [XML-SIG] Fastest SAX parser in PyXML In-Reply-To: References: <20030923211302.GA58471@spuckler.il.thewrittenword.com> <20030924040121.T23863@redhat.com> Message-ID: <20031107234136.GA5190@vet.uu.nl> Lars Marius Garshol wrote: > IMHO xml.parsers.expat shouldn't exist, and there should only be a SAX > driver for expat implemented in C. I guess what we're lacking is the > manpower to do that. As long as you don't hide it before all applications stop depending on it. I am glad the expat situation finally has been reaching some sanity and doesn't get imported from all over the place in subtly incompatible ways in Python land, and if you get rid of this import, there'll we go again. :) But of course it's true it'd be nice if everything were using the SAX interface. Regards, Martijn From Alexandre.Fayolle at logilab.fr Sun Nov 9 13:00:26 2003 From: Alexandre.Fayolle at logilab.fr (Alexandre Fayolle) Date: Sun Nov 9 13:01:29 2003 Subject: [XML-SIG] composite documents In-Reply-To: <20031106163555.GA1162@rhin> References: <20031106163555.GA1162@rhin> Message-ID: <20031109180026.GA536@calvin> On Thu, Nov 06, 2003 at 05:35:55PM +0100, Frederic Gobry wrote: > Hi, > > I wondered what the best solution would be to solve the following > problem: > > I've two families of XML documents my application generates. The first > one (let's call it the Schema, even if it's a plain XML document) can > be saved standalone, or as part of the second (the Data). > > I've a xml.sax.handler.ContentHandler derived class to parse the > Schema, and I would like to somehow reuse it in the content handler of > the Data parser. Is it possible, easy, not a good idea ? Here's a nice XML parsing trick: you're allowed to change the ContentHandler of a Sax reader during parsing (e.g. during a startElement callback). So you can have the DataContentHandler register the SchemaContentHandler during parsing and the SchemaContentHandler register the DataContentHandler back when the Schema has been parsed. -- 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 petri.savolainen at iki.fi Wed Nov 12 19:47:03 2003 From: petri.savolainen at iki.fi (Petri Savolainen) Date: Thu Nov 13 19:48:21 2003 Subject: [XML-SIG] Re: XML Objectify.. how to iterate through child tags? In-Reply-To: <00ef01c39e66$3deab2b0$8d411dc6@ms.aliaswavefront.com> References: <00ef01c39e66$3deab2b0$8d411dc6@ms.aliaswavefront.com> Message-ID: <3FB2D487.8030706@iki.fi> If I remember correctly, gnosis xml pkg sort of wraps the iterator api around xml container elements. So you can simply say "for element in test". No need for special ".childnode" accessor; just think of test as a list [a,b,c]. Hth, Petri Terence Lo wrote: > Say I have an xml file (test.xml) that contains: > > > aaa > bbb > ccc > > > source = XML_Objectify('test.xml').make_instance() > > How do I dynamically iterate through the children tags and values of ? > > I'd like to do something similar to what DOM does, (ie. childnode[0], > childnode[1].. etc) > > Is this possible? Anyone know? Any help would be greatly appreciated. > > Thanks in advance. > t > > > > _______________________________________________ > XML-SIG maillist - XML-SIG@python.org > http://mail.python.org/mailman/listinfo/xml-sig > From kamel.hamard at ericsson.com Fri Nov 14 10:28:52 2003 From: kamel.hamard at ericsson.com (Kamel Hamard (QC/EMC)) Date: Fri Nov 14 10:36:37 2003 Subject: [XML-SIG] A Python Question Message-ID: <2DBF697D5B36014ABA46E66A96107DA07206C4@lmc37.lmc.ericsson.se> Hi, Python version: 2.2 I'm getting the error bellow when I try to use the module sched. AttributeError: 'module' object has no attribute 'scheduler' I took the following example from the python reference library: import time import sched s = sched.scheduler(time.time, time.sleep) def print_time(): print "From print_time", time.time() def print_some_times(): print time.time() s.enter(5, 1, print_time, ()) s.enter(10, 1, print_time, ()) s.run() print time.time() Do you have any idea why? Kamel Thanks From fredrik at pythonware.com Fri Nov 14 14:37:22 2003 From: fredrik at pythonware.com (Fredrik Lundh) Date: Fri Nov 14 14:39:35 2003 Subject: [XML-SIG] Re: A Python Question References: <2DBF697D5B36014ABA46E66A96107DA07206C4@lmc37.lmc.ericsson.se> Message-ID: Kamel Hamard wrote: > Python version: 2.2 this is the XML-SIG, "a forum for discussion and implementation of tools to make Python an excellent choice for XML processing." for general Python questions, see the "Got a Python problem or question?" section on this page: http://www.python.org/Help.html > I'm getting the error bellow when I try to use the module sched. > > AttributeError: 'module' object has no attribute 'scheduler' > > I took the following example from the python reference library: you probably named your test program "sched.py". that's a bad idea; Python will import your program instead of the library module with the same name. From noreply at sourceforge.net Sun Nov 16 06:02:38 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Sun Nov 16 06:02:42 2003 Subject: [XML-SIG] [ pyxml-Bugs-843101 ] dom toxml raises exception with xmlns='' Message-ID: Bugs item #843101, was opened at 2003-11-16 12:02 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=106473&aid=843101&group_id=6473 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Fabio Forno (sciasbat) Assigned to: Nobody/Anonymous (nobody) Summary: dom toxml raises exception with xmlns='' Initial Comment: If I parse am xml document wich at some points resets the default namespace to the empty string, i.e. doc=minidom.parseString("") then, if I try to convert it back to xml with doc.toxml() I get this exception: File "", line 1, in ? File "/usr/lib/python2.3/site-packages/_xmlplus/dom/minidom.py", line 47, in toxml return self.toprettyxml("", "", encoding) File "/usr/lib/python2.3/site-packages/_xmlplus/dom/minidom.py", line 59, in toprettyxml self.writexml(writer, "", indent, newl, encoding) File "/usr/lib/python2.3/site-packages/_xmlplus/dom/minidom.py", line 1739, in writexml node.writexml(writer, indent, addindent, newl) File "/usr/lib/python2.3/site-packages/_xmlplus/dom/minidom.py", line 816, in writexml _write_data(writer, attrs[a_name].value) File "/usr/lib/python2.3/site-packages/_xmlplus/dom/minidom.py", line 304, in _write_data data = data.replace("&", "&").replace("<", "<") AttributeError: 'NoneType' object has no attribute 'replace' ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=106473&aid=843101&group_id=6473 From derekfountain at yahoo.co.uk Tue Nov 18 00:38:53 2003 From: derekfountain at yahoo.co.uk (Derek Fountain) Date: Tue Nov 18 00:37:31 2003 Subject: [XML-SIG] Relationship between xml and pyxml Message-ID: <200311181338.53307.derekfountain@yahoo.co.uk> I'm new to Python, and was examining the options I have for XML work in the language. I've had a quick look at the standard 'xml' package which comes with the language and established that it's the basic, minimum-fit stuff - non validating parser with Level 1 (plus a bit) DOM and SAX2. I then moved on to looking at PyXML, which does a lot more - validating parser, Level 2 DOM, etc. I was puzzled by the way the pyxml package is installed by my SUSE LINUX system. It seems that the __init__.py package loader for the the xml package checks to see if pyxml can be loaded, and if so, loads it. Since pyxml contains modules called 'dom', 'sax' and so on, as far as I can see, 'pyxml' will override the standard 'xml' package. Have I got that right? Does PyXML claim to be a source compatible superset of the standard xml package, which is transparently used if it's available? -- > eatapple core dump From martin at v.loewis.de Tue Nov 18 01:13:17 2003 From: martin at v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: Tue Nov 18 01:13:23 2003 Subject: [XML-SIG] Relationship between xml and pyxml In-Reply-To: <200311181338.53307.derekfountain@yahoo.co.uk> References: <200311181338.53307.derekfountain@yahoo.co.uk> Message-ID: Derek Fountain writes: > Have I got that right? Yes. > Does PyXML claim to be a source compatible superset of the standard > xml package, which is transparently used if it's available? Yes. Regards, Martin From derekfountain at yahoo.co.uk Tue Nov 18 01:26:14 2003 From: derekfountain at yahoo.co.uk (Derek Fountain) Date: Tue Nov 18 01:24:52 2003 Subject: [XML-SIG] Relationship between xml and pyxml In-Reply-To: References: <200311181338.53307.derekfountain@yahoo.co.uk> Message-ID: <200311181426.14189.derekfountain@yahoo.co.uk> > > Have I got that right? > > Yes. > > > Does PyXML claim to be a source compatible superset of the standard > > xml package, which is transparently used if it's available? > > Yes. Excellent! And I mean both the technology is excellent, as is the fact I understood first time what was going on. :o) -- > eatapple core dump From derekfountain at yahoo.co.uk Tue Nov 18 01:41:53 2003 From: derekfountain at yahoo.co.uk (Derek Fountain) Date: Tue Nov 18 01:40:32 2003 Subject: [XML-SIG] Choice of XML packages Message-ID: <200311181441.53684.derekfountain@yahoo.co.uk> I've had a look at the 'xml' package, and the 'pyxml' package, and was just starting a look at the 'libxml2' based package. Are there any other 'mainstream' XML packages I should be looking at while I'm doing this Python/XML research? -- > eatapple core dump From derekfountain at yahoo.co.uk Tue Nov 18 02:16:23 2003 From: derekfountain at yahoo.co.uk (Derek Fountain) Date: Tue Nov 18 02:14:59 2003 Subject: [XML-SIG] Choice of XML packages In-Reply-To: <3FB9C4A2.7050503@elegalpublishing.com> References: <200311181441.53684.derekfountain@yahoo.co.uk> <3FB9C4A2.7050503@elegalpublishing.com> Message-ID: <200311181516.23010.derekfountain@yahoo.co.uk> On Tuesday 18 November 2003 15:05, Mark Brand wrote: > i will get in first > http://www.4suite.org/index.xhtml OK, I'll look into that one. But isn't there a great deal of this package in PyXML? The names 4Suite and Forethought Inc. kept cropping up in the documentation to PyXML IIRC. What's the relationship there? And are there any other packages to look at? I'd like to be able to say I researched all avenues. -- > eatapple core dump From derekfountain at yahoo.co.uk Tue Nov 18 02:33:02 2003 From: derekfountain at yahoo.co.uk (Derek Fountain) Date: Tue Nov 18 02:34:03 2003 Subject: [XML-SIG] Choice of XML packages In-Reply-To: <200311181516.23010.derekfountain@yahoo.co.uk> References: <200311181441.53684.derekfountain@yahoo.co.uk> <3FB9C4A2.7050503@elegalpublishing.com> <200311181516.23010.derekfountain@yahoo.co.uk> Message-ID: <200311181533.02123.derekfountain@yahoo.co.uk> > OK, I'll look into that one. But isn't there a great deal of this package > in PyXML? The names 4Suite and Forethought Inc. kept cropping up in the > documentation to PyXML IIRC. What's the relationship there? OK, the 4Suite UNIX HOWTO answers that one... :o) Still interested in any other XML package recommendations though. -- > eatapple core dump From mike at skew.org Tue Nov 18 03:07:23 2003 From: mike at skew.org (Mike Brown) Date: Tue Nov 18 03:07:30 2003 Subject: [XML-SIG] Choice of XML packages In-Reply-To: <200311181516.23010.derekfountain@yahoo.co.uk> "from Derek Fountain at Nov 18, 2003 03:16:23 pm" Message-ID: <200311180807.hAI87NFN020425@chilled.skew.org> Derek Fountain wrote: > On Tuesday 18 November 2003 15:05, Mark Brand wrote: > > i will get in first > > http://www.4suite.org/index.xhtml > > OK, I'll look into that one. But isn't there a great deal of this package in > PyXML? The names 4Suite and Forethought Inc. kept cropping up in the > documentation to PyXML IIRC. What's the relationship there? http://4suite.org/docs/timeline.html (maybe just skim it from the bottom up). In short: Some shared developers, some shared code. Fourthought's DOM, XPath, XSLT, RDF and ODS implementations were all open-source add-ons to PyXML. Fourthought's fully-Python DOM Level 1 implementation, 4DOM, became part of PyXML 0.6.0, and by 0.6.4, 4DOM's maintenance was fully handed off to the PyXML team. Fourthought's XPath and XSLT code was based on extensions to PyXML's minidom, and at one point was incorporated into PyXML as xml.xpath and xml.xslt. However, major API changes and the emergence of Fourthought's C-based, XPath-optimized "Domlette" resulted in the rapid obsolescence of this code, and the decreasing interest in undertaking the ever-more-daunting task of bringing it up-to-date. 4Suite was/is just the name for all of Fourthought's XML/RDF/ODS tools, although after the 4Suite 0.11.1 release a little over 2 years ago, the PyXML dependency was lifted, and the tools were all distributed in one package (so 4Suite is more of a single product now, although its components are still usable somewhat independently). > And are there any other packages to look at? I'd like to be able to say I > researched all avenues. > In general, if you want to experiment with XPath, XSLT, and RDF processing in Python, 4Suite is state of the art, and has interesting integration features, especially if you're interested in building web-based knowledge-management applications with RDF and XSLT with no glue code. Other options that I know people are using with much success are Pyana (a Python wrapper for Xalan) and the libxml2/libxslt Python modules that wrap Daniel Veillard's XML/XSLT C libs for GNOME, which are of course very speedy. All are in fairly active development. All have bugs, too. :) -Mike (one of the 4Suite developers / Fourthought consultants) From walter at livinglogic.de Tue Nov 18 05:45:15 2003 From: walter at livinglogic.de (=?ISO-8859-1?Q?Walter_D=F6rwald?=) Date: Tue Nov 18 05:45:35 2003 Subject: [XML-SIG] Choice of XML packages In-Reply-To: <200311181533.02123.derekfountain@yahoo.co.uk> References: <200311181441.53684.derekfountain@yahoo.co.uk> <3FB9C4A2.7050503@elegalpublishing.com> <200311181516.23010.derekfountain@yahoo.co.uk> <200311181533.02123.derekfountain@yahoo.co.uk> Message-ID: <3FB9F83B.5040609@livinglogic.de> Derek Fountain wrote: >>OK, I'll look into that one. But isn't there a great deal of this package >>in PyXML? The names 4Suite and Forethought Inc. kept cropping up in the >>documentation to PyXML IIRC. What's the relationship there? > > > OK, the 4Suite UNIX HOWTO answers that one... :o) > > Still interested in any other XML package recommendations though. http://www.xml.com/lpt/a/2003/09/10/py.html gives a good overview. Bye, Walter D?rwald From derekfountain at yahoo.co.uk Tue Nov 18 05:53:41 2003 From: derekfountain at yahoo.co.uk (Derek Fountain) Date: Tue Nov 18 05:52:22 2003 Subject: [XML-SIG] Choice of XML packages In-Reply-To: <200311180807.hAI87NFN020425@chilled.skew.org> References: <200311180807.hAI87NFN020425@chilled.skew.org> Message-ID: <200311181853.41663.derekfountain@yahoo.co.uk> > Fourthought's DOM, XPath, XSLT, RDF and ODS implementations were all > open-source add-ons to PyXML. OK, thanks for the information. All this certainly makes for a much more convincing XML story than Perl or Tcl seem to be currently offering. PyXML now say the 4DOM DOM implementation is up to DOM Level 2 specification. Great stuff! > Fourthought's XPath and XSLT code was based on extensions to PyXML's > minidom, and at one point was incorporated into PyXML as xml.xpath and > xml.xslt. However, major API changes and the emergence of Fourthought's > C-based, XPath-optimized "Domlette" resulted in the rapid obsolescence of > this code, and the decreasing interest in undertaking the > ever-more-daunting task of bringing it up-to-date. This is the bit I'm still not quite clear on. PyXML still carries xml.xslt and xml.xpath, which, you say, are obsolete. Fine. So, if I want to work with XPATH and XSLT (which I do, especially XPATH) what are my choices? One option seems to be to use the obsolete code, which doesn't sound like a particularly good idea, except for the fact that most Linux distros ship with PyXML. At least my code would work easily on the user's machine. The other, technically superior option, is to use the latest 4Suite code, but this means my users need to install a package which the Linux distros don't seem to carry (unless things have changed in this respect in the last round of distro updates). I'm also a bit nervous of this "install PyXML with the --without-xpath and --without-xslt options" thing, which I suspect most Linux distros aren't going to do. I'm pretty sure my SuSE-8.1 didn't use those switches, so I'm wondering what the impact is of installing 4Suite on this box - or any of my almost-randomly-configured user's boxen. >From what I've read, things appear to be in a bit of a limbo state regarding xpath and xslt, and I'm not quite sure which way to move forward here. -- > eatapple core dump From derekfountain at yahoo.co.uk Tue Nov 18 06:08:52 2003 From: derekfountain at yahoo.co.uk (Derek Fountain) Date: Tue Nov 18 06:07:28 2003 Subject: [XML-SIG] Choice of XML packages In-Reply-To: <3FB9F83B.5040609@livinglogic.de> References: <200311181441.53684.derekfountain@yahoo.co.uk> <200311181533.02123.derekfountain@yahoo.co.uk> <3FB9F83B.5040609@livinglogic.de> Message-ID: <200311181908.52464.derekfountain@yahoo.co.uk> > http://www.xml.com/lpt/a/2003/09/10/py.html gives a good overview. That's a great link, thanks! -- > eatapple core dump From rsalz at datapower.com Tue Nov 18 06:47:40 2003 From: rsalz at datapower.com (Rich Salz) Date: Tue Nov 18 06:47:43 2003 Subject: [XML-SIG] Choice of XML packages In-Reply-To: <200311181533.02123.derekfountain@yahoo.co.uk> Message-ID: > Still interested in any other XML package recommendations though. See pywebsvcs.sf.net -- Rich Salz Chief Security Architect DataPower Technology http://www.datapower.com XS40 XML Security Gateway http://www.datapower.com/products/xs40.html XML Security Overview http://www.datapower.com/xmldev/xmlsecurity.html From Alexandre.Fayolle at logilab.fr Tue Nov 18 07:11:29 2003 From: Alexandre.Fayolle at logilab.fr (Alexandre Fayolle) Date: Tue Nov 18 07:11:38 2003 Subject: [XML-SIG] Choice of XML packages In-Reply-To: <200311181853.41663.derekfountain@yahoo.co.uk> References: <200311180807.hAI87NFN020425@chilled.skew.org> <200311181853.41663.derekfountain@yahoo.co.uk> Message-ID: <20031118121129.GC7479@calvin> On Tue, Nov 18, 2003 at 06:53:41PM +0800, Derek Fountain wrote: > This is the bit I'm still not quite clear on. PyXML still carries xml.xslt and > xml.xpath, which, you say, are obsolete. Fine. So, if I want to work with > XPATH and XSLT (which I do, especially XPATH) what are my choices? If you want to use XSLT, forget pyxml: xml.xslt is broken and does not work. xml.xpath on the other hands works pretty well with 4DOM and minidom (which are part of pyxml). There's no need to worry about namespace clashes, because 4Suites module live in the Ft package. -- 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 fdrake at acm.org Tue Nov 18 08:12:01 2003 From: fdrake at acm.org (Fred L. Drake, Jr.) Date: Tue Nov 18 08:12:12 2003 Subject: [XML-SIG] Choice of XML packages In-Reply-To: <200311181441.53684.derekfountain@yahoo.co.uk> References: <200311181441.53684.derekfountain@yahoo.co.uk> Message-ID: <16314.6817.654886.639877@grendel.zope.com> Derek Fountain writes: > Are there any other 'mainstream' XML packages I should be looking > at while I'm doing this Python/XML research? 4Suite: www.4suite.org -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From derekfountain at yahoo.co.uk Wed Nov 19 00:49:20 2003 From: derekfountain at yahoo.co.uk (Derek Fountain) Date: Wed Nov 19 00:47:47 2003 Subject: [XML-SIG] Choice of XML packages In-Reply-To: <20031118121129.GC7479@calvin> References: <200311180807.hAI87NFN020425@chilled.skew.org> <200311181853.41663.derekfountain@yahoo.co.uk> <20031118121129.GC7479@calvin> Message-ID: <200311191349.20561.derekfountain@yahoo.co.uk> On Tuesday 18 November 2003 20:11, Alexandre Fayolle wrote: > On Tue, Nov 18, 2003 at 06:53:41PM +0800, Derek Fountain wrote: > > This is the bit I'm still not quite clear on. PyXML still carries > > xml.xslt and xml.xpath, which, you say, are obsolete. Fine. So, if I want > > to work with XPATH and XSLT (which I do, especially XPATH) what are my > > choices? > > If you want to use XSLT, forget pyxml: xml.xslt is broken and does not > work. xml.xpath on the other hands works pretty well with 4DOM and > minidom (which are part of pyxml). > > There's no need to worry about namespace clashes, because 4Suites module > live in the Ft package. Yes, I uninstalled the old PyXML which came with my Linux distro and built the latest from source, with the flags as recommended by the 4Suite documentation. I then installed 4Suite on top and everything seems OK, at least so far. I also contacted a friend who's running SUSE LINUX 9.0 and he says python-4suite is included in that distro. Since that's my favoured one, and most other Linux distros will follow the lead anyway, I think I have my answer: ensure the user is running a recent Linux distro, then PyXML and 4Suite between them should do everything I want. :o) Thanks to all who offered advice. -- > eatapple core dump From gsantonja at yahoo.fr Thu Nov 20 06:01:13 2003 From: gsantonja at yahoo.fr (=?iso-8859-1?q?Gabriel=20Santonja?=) Date: Thu Nov 20 06:01:33 2003 Subject: [XML-SIG] cross compiling PyXML on Yopy (Strong Arm) Message-ID: <20031120110114.55777.qmail@web10706.mail.yahoo.com> Hello, I'am trying to crosscompil PyXml on a strong arm. But the arm-linux-gcc compiler isn't use instead of gcc. I can cross compil the expat module directly. So : - How can i install PyXml with crosscompiling?. This question would : - Is expat the only module i must compile with a C compiler?. if yes can I use my own cross compiled expat?. - Can i deploy minidom module only with a python ?. Cordialy Gabriel Santonja gsantonja@yahoo.fr ___________________________________________________________ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en fran?ais ! Yahoo! Mail : http://fr.mail.yahoo.com From gsantonja at yahoo.fr Thu Nov 20 06:01:40 2003 From: gsantonja at yahoo.fr (=?iso-8859-1?q?Gabriel=20Santonja?=) Date: Thu Nov 20 06:01:45 2003 Subject: [XML-SIG] cross compiling PyXML on Yopy (Strong Arm) Message-ID: <20031120110140.13670.qmail@web10704.mail.yahoo.com> Hello, I'am trying to crosscompil PyXml on a strong arm. But the arm-linux-gcc compiler isn't use instead of gcc. I can cross compil the expat module directly. So : - How can i install PyXml with crosscompiling?. This question would probably resolve my problem : - Is expat the only module i must compile with a C compiler?. if yes can I use my own cross compiled expat?. - Can i deploy minidom module only with a python ?. Cordialy Gabriel Santonja gsantonja@yahoo.fr ___________________________________________________________ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en fran?ais ! Yahoo! Mail : http://fr.mail.yahoo.com From martin at v.loewis.de Thu Nov 20 14:54:27 2003 From: martin at v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: Thu Nov 20 14:55:03 2003 Subject: [XML-SIG] cross compiling PyXML on Yopy (Strong Arm) In-Reply-To: <20031120110114.55777.qmail@web10706.mail.yahoo.com> References: <20031120110114.55777.qmail@web10706.mail.yahoo.com> Message-ID: Gabriel Santonja writes: > - How can i install PyXml with crosscompiling?. You should manually perform all build steps. Just look at what would normally be compiled by gcc, and use a different compiler instead, manually. Alternatively, arrange that the cross-compiler is called "gcc". > - Is expat the only module i must compile with a C > compiler?. if yes can I use my own cross compiled > expat?. No, and perhaps. It also compiles extensions/boolean.c and extensions/sgmlop.c; for using expat, you have to change the build process even more. > - Can i deploy minidom module only with a python ?. I don't understand the question. If you ask whether you need Python for the process of deploying: certainly not. A tar file would do as well. Regards, Martin From david.gaya at terra.es Tue Nov 25 08:00:30 2003 From: david.gaya at terra.es (David Gaya) Date: Tue Nov 25 07:04:13 2003 Subject: [XML-SIG] UnicodeError: ASCII encoding error: ordinal not in range(128) Message-ID: <200311251400.30820.david.gaya@terra.es> Hi, I'm quite new in python but I see it has good support for XML. I'm trying to modify an XML file using DOM. My script is the following: from xml.dom import minidom xmldoc = minidom.parse('slide.xml') bitmaplist = xmldoc.getElementsByTagName('Bitmap') for bitmap in bitmaplist: cdata = bitmap.firstChild bitmap.removeChild(cdata) print xmldoc.toxml() I got the following error: UnicodeError: ASCII encoding error: ordinal not in range(128) This is because xml file contains some strings like: Instead of 'print xmldoc.toxml()' I've tryed s = xmldoc.toxml() print s.encode('UTF-8') But then  is encoded in a single character. Does anybody know how can I print (or save) back the modified document keeping the  format ? Thanks very much David From larsga at garshol.priv.no Tue Nov 25 08:43:08 2003 From: larsga at garshol.priv.no (Lars Marius Garshol) Date: Tue Nov 25 08:43:13 2003 Subject: [XML-SIG] UnicodeError: ASCII encoding error: ordinal not in range(128) In-Reply-To: <200311251400.30820.david.gaya@terra.es> References: <200311251400.30820.david.gaya@terra.es> Message-ID: * David Gaya | | Instead of 'print xmldoc.toxml()' I've tryed | s = xmldoc.toxml() | print s.encode('UTF-8') | But then  is encoded in a single character. | Does anybody know how can I print (or save) back the modified document | keeping the  format ? Why do you want to do that? The document means the same regardless of which way the character is encoded. -- Lars Marius Garshol, Ontopian GSM: +47 98 21 55 50 From fredrik at pythonware.com Tue Nov 25 09:04:55 2003 From: fredrik at pythonware.com (Fredrik Lundh) Date: Tue Nov 25 09:06:09 2003 Subject: [XML-SIG] Re: UnicodeError: ASCII encoding error: ordinal not inrange(128) References: <200311251400.30820.david.gaya@terra.es> Message-ID: David Gaya wrote: > UnicodeError: ASCII encoding error: ordinal not in range(128) note that this is generated by the print statement, not the XML library. > Instead of 'print xmldoc.toxml()' I've tryed > s = xmldoc.toxml() > print s.encode('UTF-8') > But then  is encoded in a single character. > Does anybody know how can I print (or save) back the modified document > keeping the  format ? if you're using Python 2.3, you can use the "xmlcharrefreplace" error handler: print xmldoc.toxml().encode("ascii", "xmlcharrefreplace") the toxml method takes an encoding attribute, but that doesn't do anything even remotely useful in this case: print xmldoc.toxml(encoding='us-ascii') Traceback (most recent call last): | snip | File "C:\python23\lib\xml\dom\minidom.py", line 303, in _write_data writer.write(data) File "C:\python23\lib\codecs.py", line 178, in write data, consumed = self.encode(object, self.errors) UnicodeEncodeError: 'ascii' codec can't encode character u'\uf7fa' in position 0: ordinal not in range(128) (footnote/plug: compare this with elementtree's write method: from elementtree import ElementTree xmldoc = ElementTree.parse('slide.xml') xmldoc.write(sys.stdout, encoding="us-ascii") ) From roman at 248112.vserver.de Tue Nov 25 11:15:47 2003 From: roman at 248112.vserver.de (roman@248112.vserver.de) Date: Tue Nov 25 11:17:44 2003 Subject: [XML-SIG] Equivalence test for DOM Nodes? Message-ID: <33786.217.187.88.88.1069776947.squirrel@interview-machine.com> Hi list, Is there a utility function or something to recursivly compare two DOM Nodes for equivalence? For instance: foo foo can be considered equivalent. I need a function, which takes two DOM Nodes and completely compares them for equivalence. If there is such a function somewhere (maybe in one of the DOM implementations?) I don't need to write it for myself... Thanks in advance, Roman -- SOAP for Python http://interview-machine.com/soap/ From larsga at garshol.priv.no Tue Nov 25 11:26:41 2003 From: larsga at garshol.priv.no (Lars Marius Garshol) Date: Tue Nov 25 11:26:44 2003 Subject: [XML-SIG] Equivalence test for DOM Nodes? In-Reply-To: <33786.217.187.88.88.1069776947.squirrel@interview-machine.com> References: <33786.217.187.88.88.1069776947.squirrel@interview-machine.com> Message-ID: * roman@248112.vserver.de | | Is there a utility function or something to recursivly compare two DOM | Nodes for equivalence? The trouble with that is that there's no definition of what is required for two XML fragments to be the same. XML just doesn't have any notion of identity for elements. So while there might be such a method you couldn't really trust it to be The One True Element Comparison Method. Not that such a thing wouldn't be nice to have... :-( -- Lars Marius Garshol, Ontopian GSM: +47 98 21 55 50 From roman at interview-machine.com Tue Nov 25 11:26:25 2003 From: roman at interview-machine.com (Roman Kennke) Date: Tue Nov 25 11:28:20 2003 Subject: [XML-SIG] Equivalence test for DOM Nodes? Message-ID: <33826.217.187.88.88.1069777585.squirrel@interview-machine.com> Hi list, Is there a utility function or something to recursivly compare two DOM Nodes for equivalence? For instance: foo foo can be considered equivalent. I need a function, which takes two DOM Nodes and completely compares them for equivalence. If there is such a function somewhere (maybe in one of the DOM implementations?) I don't need to write it for myself... Thanks in advance, Roman -- SOAP for Python http://interview-machine.com/soap/ From roman at interview-machine.com Tue Nov 25 12:19:12 2003 From: roman at interview-machine.com (Roman Kennke) Date: Tue Nov 25 12:21:09 2003 Subject: [XML-SIG] Equivalence test for DOM Nodes? In-Reply-To: References: <33786.217.187.88.88.1069776947.squirrel@interview-machine.com> Message-ID: <33948.217.187.88.88.1069780752.squirrel@interview-machine.com> > > * roman@248112.vserver.de > | > | Is there a utility function or something to recursivly compare two DOM > | Nodes for equivalence? > > The trouble with that is that there's no definition of what is > required for two XML fragments to be the same. XML just doesn't have > any notion of identity for elements. > > So while there might be such a method you couldn't really trust it to > be The One True Element Comparison Method. Not that such a thing > wouldn't be nice to have... :-( That's obviously true. There is no such standard. I need this, to implement some test cases and want to compare plain XML documents for equivalence, not equality or identity. Equivalent Nodes should meet the following conditions (there are more, but these are the most important): 1. Their (DOM) Node type must be the same. 2. for Elements: - each attribute in one element exists and has the same value in the other element and vice versa - both elements have the same namespace URI (but may have different prefixes) - both elements have the same name - the child elements must be the equivalent (recursion), with adjacent Text Nodes beeing put together. 3. Text Nodes are equivalent, if they have the same data. There may be an option to the function, which specifies, if whitespace is significant or not. 4. The other Node types are pretty straightforward, and since I don't need them, I don't really care about them. If nobody has implemented such a function yet, I think I will do it. Cheers, Roman -- SOAP for Python http://interview-machine.com From and at doxdesk.com Tue Nov 25 14:05:30 2003 From: and at doxdesk.com (Andrew Clover) Date: Tue Nov 25 14:23:19 2003 Subject: [XML-SIG] Equivalence test for DOM Nodes? In-Reply-To: <33948.217.187.88.88.1069780752.squirrel@interview-machine.com> References: <33786.217.187.88.88.1069776947.squirrel@interview-machine.com> <33948.217.187.88.88.1069780752.squirrel@interview-machine.com> Message-ID: <20031125190530.GA31338@doxdesk.com> Roman Kennke wrote: > There is no such standard. Ah! Actually there is, for values 'x' of standard where 'x' is equal to a Candidate Recommendation anyway. See Node.isEqualNode in DOM Level 3 Core: http://www.w3.org/TR/2003/CR-DOM-Level-3-Core-20031107/core.html#Node3-isEqualNode This is not yet widely supported; the only Python implementation I know of that supports it is my own: http://www.doxdesk.com/software/py/pxdom.html isEqualNode has not been thoroughly tested (for one thing, there is not yet any Level 3 Test Suite), but it seems to work for the simple cases I have thrown at it. Note pxdom 0.8 is based on the previous Working Draft (June); there have been some changes between then and the current Candidate Recommendation. pxdom 0.9 will be released shortly to track changes to CR. (And fix a few L3 bugs. And implement a few more of its optional features.) -- Andrew Clover mailto:and@doxdesk.com http://www.doxdesk.com/ From roman at interview-machine.com Tue Nov 25 15:31:48 2003 From: roman at interview-machine.com (Roman Kennke) Date: Tue Nov 25 15:35:56 2003 Subject: [XML-SIG] Equivalence test for DOM Nodes? In-Reply-To: <20031125190530.GA31338@doxdesk.com> References: <33786.217.187.88.88.1069776947.squirrel@interview-machine.com><33948.217.187.88.88.1069780752.squirrel@interview-machine.com> <20031125190530.GA31338@doxdesk.com> Message-ID: <34274.217.187.88.88.1069792308.squirrel@interview-machine.com> > Roman Kennke wrote: > >> There is no such standard. > > Ah! Actually there is, for values 'x' of standard where 'x' is equal to a > Candidate Recommendation anyway. See Node.isEqualNode in DOM Level 3 Core: > > http://www.w3.org/TR/2003/CR-DOM-Level-3-Core-20031107/core.html#Node3-isEqualNode I quickly read over this. It seems to check for strict identity. For example, two elements are equal (according to this spec), if their namespaceURI, localName _and_ prefix are equal. I need a more relaxed interpretation of equal, where the prefix is not considered. In fact, I need this kind of comparison for the SOAP 1.2 testsuite. I think, it does not matter if an element is named or as long as env and soap refer to the same namespaceURI. Cheers, Roman --- SOAP for Python http://interview-machine.com/soap/ From fredrik at pythonware.com Tue Nov 25 15:55:27 2003 From: fredrik at pythonware.com (Fredrik Lundh) Date: Tue Nov 25 15:55:46 2003 Subject: [XML-SIG] Re: Equivalence test for DOM Nodes? References: <33786.217.187.88.88.1069776947.squirrel@interview-machine.com><33948.217.187.88.88.1069780752.squirrel@interview-machine.com><20031125190530.GA31338@doxdesk.com> <34274.217.187.88.88.1069792308.squirrel@interview-machine.com> Message-ID: Roman Kennke wrote: > I need a more relaxed interpretation of equal, where the prefix is not > considered. In fact, I need this kind of comparison for the SOAP 1.2 > testsuite. I think, it does not matter if an element is named > or as long as env and soap refer to the same > namespaceURI. fwiw, the following ElementTree snippet does what you want: from elementtree.ElementTree import XML, tostring def normalize(a): # get rid of whitespace for i in a.getiterator(): if i.text: i.text = i.text.strip() i.tail = None def compare(a, b): # normalize and compare serializations normalize(a) normalize(b) return tostring(a) == tostring(b) # # tree ways to describe the same thing a = XML("""\ """) b = XML("""\ """) c = XML("""\ """) >>> compare(a, b) 1 >>> compare(a, c) 1 >>> compare(b, c) 1 you may want to make the "normalize" function a bit more selective (e.g. by preserving whitespace inside soap:Body subelements, etc) for downloads and more info, see: http://effbot.org/downloads#elementtree From mike at skew.org Tue Nov 25 18:49:51 2003 From: mike at skew.org (Mike Brown) Date: Tue Nov 25 18:49:52 2003 Subject: [XML-SIG] Equivalence test for DOM Nodes? In-Reply-To: <33826.217.187.88.88.1069777585.squirrel@interview-machine.com> "from Roman Kennke at Nov 25, 2003 05:26:25 pm" Message-ID: <200311252349.hAPNnpst048672@chilled.skew.org> Roman Kennke wrote: > Hi list, > > Is there a utility function or something to recursivly compare two DOM > Nodes for equivalence? For instance: > > > > foo > > I think you meant to bind 'x' and 'y' prefixes there, not 'a' and 'b'. If you didn't, the documents definitely aren't equivalent :) > > > foo > > > Try the Ft.Xml.Lib.TreeCompare module in 4Suite. We use it in our test suites. I have just added doc strings to it. It is namespace aware and works with minidom as well as Domlette. As of today, I made it support optionally ignoring namespace declarations, so it will work with your example. Either use current 4Suite from CVS, or it should be safe to just plop the new TreeCompare.py into your distribution if you've already got one of the 4Suite 1.0 alphas installed. s1 = """ foo """ s2 = """ foo """ from Ft.Xml.Lib.TreeCompare import NodeCompare, TreeCompare # use Domlette, which TreeCompare uses by default if not TreeCompare(s1, s2, ignoreNsDecls=1): print "they are equal!" # use minidom, so bypass TreeCompare and use NodeCompare directly from xml.dom.minidom import parseString mdoc1 = parseString(s1) mdoc2 = parseString(s2) if NodeCompare(mdoc1, mdoc2, ignoreNsDecls=1): print "they are equal!" -Mike From mike at skew.org Tue Nov 25 19:09:58 2003 From: mike at skew.org (Mike Brown) Date: Tue Nov 25 19:10:00 2003 Subject: [XML-SIG] Equivalence test for DOM Nodes? In-Reply-To: <200311252349.hAPNnpst048672@chilled.skew.org> "from Mike Brown at Nov 25, 2003 04:49:51 pm" Message-ID: <200311260009.hAQ09wQk048781@chilled.skew.org> Sorry, here's the link to the new TreeCompare.py if you want to try swapping it in on top of 4Suite 1.0a3 instead of getting it with CVS: http://cvs.4suite.org/cgi-bin/viewcvs.cgi/~checkout~/4Suite/Ft/Xml/Lib/TreeCompare.py?rev=1.23 From walter at livinglogic.de Wed Nov 26 07:06:48 2003 From: walter at livinglogic.de (=?ISO-8859-1?Q?Walter_D=F6rwald?=) Date: Wed Nov 26 07:06:54 2003 Subject: [XML-SIG] Re: UnicodeError: ASCII encoding error: ordinal not inrange(128) In-Reply-To: References: <200311251400.30820.david.gaya@terra.es> Message-ID: <3FC49758.2040408@livinglogic.de> Fredrik Lundh wrote: > David Gaya wrote: > >>UnicodeError: ASCII encoding error: ordinal not in range(128) > > note that this is generated by the print statement, not the XML library. > >>Instead of 'print xmldoc.toxml()' I've tryed >> s = xmldoc.toxml() >> print s.encode('UTF-8') >>But then  is encoded in a single character. >>Does anybody know how can I print (or save) back the modified document >>keeping the  format ? > > if you're using Python 2.3, you can use the "xmlcharrefreplace" > error handler: > > print xmldoc.toxml().encode("ascii", "xmlcharrefreplace") > > > > > But this will escape characters even inside comments or processing instructions. > the toxml method takes an encoding attribute, but that doesn't do > anything even remotely useful in this case: > > print xmldoc.toxml(encoding='us-ascii') > > Traceback (most recent call last): > | snip | > File "C:\python23\lib\xml\dom\minidom.py", line 303, in _write_data > writer.write(data) > File "C:\python23\lib\codecs.py", line 178, in write > data, consumed = self.encode(object, self.errors) > UnicodeEncodeError: 'ascii' codec can't encode character u'\uf7fa' in position > 0: ordinal not in range(128) PyXML's xml.sax.saxutils.XMLGenerator will do the correct thing (i.e. escape characters in text nodes, but raise an error for unencodable characters elsewhere. Are there any plans to add the same functionality to minidom? Bye, Walter D?rwald From fredrik at pythonware.com Wed Nov 26 07:35:10 2003 From: fredrik at pythonware.com (Fredrik Lundh) Date: Wed Nov 26 07:35:17 2003 Subject: [XML-SIG] Re: Re: UnicodeError: ASCII encoding error: ordinal notinrange(128) References: <200311251400.30820.david.gaya@terra.es> <3FC49758.2040408@livinglogic.de> Message-ID: Walter Dörwald wrote: > > if you're using Python 2.3, you can use the "xmlcharrefreplace" > > error handler: > > > > print xmldoc.toxml().encode("ascii", "xmlcharrefreplace") > > > > > > > > > > > > But this will escape characters even inside comments or processing > instructions. which may or may not be a problem, depending on the application. From roman at interview-machine.com Wed Nov 26 08:12:05 2003 From: roman at interview-machine.com (Roman Kennke) Date: Wed Nov 26 08:14:19 2003 Subject: [XML-SIG] Equivalence test for DOM Nodes? In-Reply-To: <200311252349.hAPNnpst048672@chilled.skew.org> References: <33826.217.187.88.88.1069777585.squirrel@interview-machine.com>"from Roman Kennke at Nov 25, 2003 05:26:25 pm" <200311252349.hAPNnpst048672@chilled.skew.org> Message-ID: <33323.217.187.89.152.1069852325.squirrel@interview-machine.com> > Roman Kennke wrote: >> Hi list, >> >> Is there a utility function or something to recursivly compare two DOM >> Nodes for equivalence? For instance: >> >> >> >> foo >> >> > > I think you meant to bind 'x' and 'y' prefixes there, not 'a' and 'b'. > If you didn't, the documents definitely aren't equivalent :) oops. ;-) > Try the Ft.Xml.Lib.TreeCompare module in 4Suite. We use it in our test > suites. > I have just added doc strings to it. It is namespace aware and works with > minidom as well as Domlette. I'm gonna check this out. Cheers, Roman -- SOAP for Python http://interview-machine.com/soap/ From martin at v.loewis.de Wed Nov 26 14:30:35 2003 From: martin at v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: Wed Nov 26 14:54:03 2003 Subject: [XML-SIG] Re: UnicodeError: ASCII encoding error: ordinal not inrange(128) In-Reply-To: <3FC49758.2040408@livinglogic.de> References: <200311251400.30820.david.gaya@terra.es> <3FC49758.2040408@livinglogic.de> Message-ID: Walter D?rwald writes: > Are there any plans to add the same functionality to minidom? It's certainly a bug that you cannot use arbitrary encodings in the presence of "unsupported" characters in PCDATA, and there is also the plan to fix all bugs. However, contributions are welcome. Contributors should consider that minidom needs to work back to Python 2.0. It might be acceptable if versions before 2.2 would raise an exception. Regards, Martin From roman at interview-machine.com Thu Nov 27 03:07:32 2003 From: roman at interview-machine.com (Roman Kennke) Date: Thu Nov 27 03:10:01 2003 Subject: [XML-SIG] supress DTD reading Message-ID: <32819.217.187.89.10.1069920452.squirrel@interview-machine.com> Hi there again, When I'm trying to parse an XML document into DOM, is there a way to tell the parser, that it may not read an internal or external DTD? Nevertheless, I would like to have it mentioned in Document.doctype, so I can see, _that_ there is a DTD(-reference). How to do that? (When I try this with xml.dom.reader.Sax2.Reader with the following XML doc: foo I get an exception: ValueError: unknown url type: env.dtd Roman From roman at interview-machine.com Thu Nov 27 05:25:21 2003 From: roman at interview-machine.com (Roman Kennke) Date: Thu Nov 27 05:27:51 2003 Subject: [XML-SIG] supress DTD reading In-Reply-To: <32819.217.187.89.10.1069920452.squirrel@interview-machine.com> References: <32819.217.187.89.10.1069920452.squirrel@interview-machine.com> Message-ID: <33370.217.187.89.10.1069928721.squirrel@interview-machine.com:443> > (When I try this with xml.dom.reader.Sax2.Reader with the following XML > doc: > > > > > > > foo > > > > > I get an exception: > > ValueError: unknown url type: env.dtd I suppose, this does not mean, that it the parser tried to read the DTD, but it tried to parse the url and found, that it is not valid. I wonder, if this is correct, IMO the URL is valid -- as a relative URL to the Base URI of the referencing Document? Cheers, Roman -- SOAP for Python http://interview-machine.com/soap/ From tpassin at comcast.net Thu Nov 27 10:37:01 2003 From: tpassin at comcast.net (Thomas B. Passin) Date: Thu Nov 27 10:35:28 2003 Subject: [XML-SIG] supress DTD reading In-Reply-To: <33370.217.187.89.10.1069928721.squirrel@interview-machine.com:443> References: <32819.217.187.89.10.1069920452.squirrel@interview-machine.com> <33370.217.187.89.10.1069928721.squirrel@interview-machine.com:443> Message-ID: <3FC61A1D.5010400@comcast.net> Roman Kennke wrote: >>(When I try this with xml.dom.reader.Sax2.Reader with the following XML >>doc: >> >> >> >> ... >>I get an exception: >> >>ValueError: unknown url type: env.dtd > > > I suppose, this does not mean, that it the parser tried to read the DTD, > but it tried to parse the url and found, that it is not valid. It probably tried to parse the "[]" and did not like it. Cheers, Tom P From roman at interview-machine.com Thu Nov 27 12:39:28 2003 From: roman at interview-machine.com (Roman Kennke) Date: Thu Nov 27 12:42:03 2003 Subject: [XML-SIG] supress DTD reading In-Reply-To: <3FC61A1D.5010400@comcast.net> References: <32819.217.187.89.10.1069920452.squirrel@interview-machine.com><33370.217.187.89.10.1069928721.squirrel@interview-machine.com:443> <3FC61A1D.5010400@comcast.net> Message-ID: <33808.217.187.89.10.1069954768.squirrel@interview-machine.com:443> Hi, >>>(When I try this with xml.dom.reader.Sax2.Reader with the following XML >>>doc: >>> >>> >>> >>> ... >>>I get an exception: >>> >>>ValueError: unknown url type: env.dtd >> >> >> I suppose, this does not mean, that it the parser tried to read the DTD, >> but it tried to parse the url and found, that it is not valid. > > It probably tried to parse the "[]" and did not like it. Is this not legal? However, 'unknow url type: env.dtd' sounds like it has something to do with the url 'env.dtd' ;-) Roman -- SOAP for Python http://interview-machine.com/soap/ From tpassin at comcast.net Thu Nov 27 14:17:57 2003 From: tpassin at comcast.net (Thomas B. Passin) Date: Thu Nov 27 14:15:37 2003 Subject: [XML-SIG] supress DTD reading In-Reply-To: <33808.217.187.89.10.1069954768.squirrel@interview-machine.com:443> References: <32819.217.187.89.10.1069920452.squirrel@interview-machine.com><33370.217.187.89.10.1069928721.squirrel@interview-machine.com:443> <3FC61A1D.5010400@comcast.net> <33808.217.187.89.10.1069954768.squirrel@interview-machine.com:443> Message-ID: <3FC64DE5.3060903@comcast.net> Roman Kennke wrote: >> >>It probably tried to parse the "[]" and did not like it. > > > Is this not legal? However, 'unknow url type: env.dtd' sounds like it has > something to do with the url 'env.dtd' ;-) No, it is legal to just have whitespace (or nothing) there, I just speculated that maybe the particular parser, whatever it was, did not like it being blank. But that has probably been defacto tested hundreds of times, so probably would not be a problem. Cheers, Tom P From martin at v.loewis.de Thu Nov 27 14:17:42 2003 From: martin at v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: Thu Nov 27 14:18:21 2003 Subject: [XML-SIG] supress DTD reading In-Reply-To: <32819.217.187.89.10.1069920452.squirrel@interview-machine.com> References: <32819.217.187.89.10.1069920452.squirrel@interview-machine.com> Message-ID: "Roman Kennke" writes: > When I'm trying to parse an XML document into DOM, is there a way to tell > the parser, that it may not read an internal or external DTD? Yes: You need to create a SAX parser, and disable external general entities, and external parameter entities. Regards, Martin From morillas at posta.unizar.es Fri Nov 28 18:50:21 2003 From: morillas at posta.unizar.es (luis miguel morillas) Date: Fri Nov 28 18:35:50 2003 Subject: [XML-SIG] xsl stylesheets for docbook Message-ID: <20031128235021.GA3342@marmota> Hi, I have got some docbook-xml docs and I need to generate on the fly HTML docs. I've written this script [1], but I've got some warnings [2] an the task takes too long. Can I produce html quicker whith 4suite python modules?. Could please anybody explain me the meaning of the warnings? The tool we are writting is here [3] [1] from Ft.Xml.Xslt import Processor from Ft.Xml import InputSource from Ft.Lib import Uri def creaHtml(stringDocXml): docXsl='/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/html/docbook.xsl' processor=Processor.Processor() sheet=InputSource.DefaultFactory.fromUri(Uri.OsPathToUri(docXsl)) source=InputSource.DefaultFactory.fromString(stringDocXml) processor.appendStylesheet(sheet) return processor.run(source) [2] /usr/lib/python2.3/site-packages/Ft/Xml/Xslt/StylesheetHandler.py:594: UserWarning: No implementation available for extension element (u'http://nwalsh.com/xslt/ext/com.nwalsh.saxon.TextFactory', u'insertfile'). Fallback will be effected. warnings.warn("No implementation available for extension" [3] http://155.210.19.185:8000/ -- Luis Miguel From veillard at redhat.com Sat Nov 29 02:30:51 2003 From: veillard at redhat.com (Daniel Veillard) Date: Sat Nov 29 02:31:18 2003 Subject: [XML-SIG] xsl stylesheets for docbook In-Reply-To: <20031128235021.GA3342@marmota> References: <20031128235021.GA3342@marmota> Message-ID: <20031129073051.GC23634@redhat.com> On Sat, Nov 29, 2003 at 12:50:21AM +0100, luis miguel morillas wrote: > Hi, > > I have got some docbook-xml docs and I need to generate on the fly HTML docs. > I've written this script [1], but I've got some warnings [2] an the task takes too long. try the libxml2/libxslt bindings for python [1] . Make sure you have the DocBook DTDs available locally, preferably in the machine XML Catalogs [2]. Daniel [1] http://xmlsoft.org/XSLT/python.html [2] http://xmlsoft.org/catalog.html -- 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 noreply at sourceforge.net Sat Nov 29 08:10:23 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Sat Nov 29 08:10:29 2003 Subject: [XML-SIG] [ pyxml-Patches-851136 ] Wrong exit status from xvcmd.py Message-ID: Patches item #851136, was opened at 2003-11-29 14:10 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=306473&aid=851136&group_id=6473 Category: xmlproc Group: None Status: Open Resolution: None Priority: 5 Submitted By: Per Cederqvist (ceder) Assigned to: Lars Marius Garshol (larsga) Summary: Wrong exit status from xvcmd.py Initial Comment: The demo/xmlproc/xvcmd.py program is a very useful utility. It has one flaw: the exit status is always 0, even when it finds an error in a document. The enclosed patch changes the exit status to 1 if at least one warning was produced, and 2 if at least one error was produced. This makes it possible to run xvcmd.py from make to validate the input first, and then process it using other non-validating XML-processing software. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=306473&aid=851136&group_id=6473 From noreply at sourceforge.net Sat Nov 29 13:36:35 2003 From: noreply at sourceforge.net (SourceForge.net) Date: Sat Nov 29 13:36:39 2003 Subject: [XML-SIG] [ pyxml-Patches-851255 ] 4DOM TreeWalker loops - fix Message-ID: Patches item #851255, was opened at 2003-11-29 18:36 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=306473&aid=851255&group_id=6473 Category: DOM Group: None Status: Open Resolution: None Priority: 5 Submitted By: Andrew Clover (bobince) Assigned to: Nobody/Anonymous (nobody) Summary: 4DOM TreeWalker loops - fix Initial Comment: Patch for issue mentioned on c.l.py. When nextNode() reaches the end and returns None, it leaves the currentNode pointing at the root node of the walker, instead of ensuring it is unchanged. A further call will therefore begin the walk all over again. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=306473&aid=851255&group_id=6473