From martin at v.loewis.de Tue Feb 6 22:34:43 2007 From: martin at v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Tue, 06 Feb 2007 22:34:43 +0100 Subject: [XML-SIG] Where is the xml.dom.ext package in current pythondistributions? .ext documentation? In-Reply-To: <45A61B0B.5030908@gmx.net> References: <1168445227.45a50f2b7e5b1@webmail.nd.edu> <45A61B0B.5030908@gmx.net> Message-ID: <45C8F473.2030708@v.loewis.de> Anastasios Hatzis schrieb: > I was so sure that PyXML was already part of the Python distribution. > Unfortunately I can't remember where I this from. A few days ago an > OpenSwarm user brought my attention to the same issue Paul mentioned so > I realized it needs to be installed extra. > > Has PyXML ever been part of the official Python distribution or were > there plans once to do so? > > Probably I'm just getting old and muddle-headed. Parts of PyXML were integrated into Python 2.0, namely xml.dom, xml.sax, and pyexpat. Other parts were never considered for inclusion, for various reasons. Regards, Martin From martin at v.loewis.de Tue Feb 6 22:36:15 2007 From: martin at v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Tue, 06 Feb 2007 22:36:15 +0100 Subject: [XML-SIG] Where is the xml.dom.ext package in current python distributions? In-Reply-To: <1168638875.45a8039b8ef99@webmail.nd.edu> References: <1168525079.45a64717ce9be@webmail.nd.edu> <17831.53590.646422.252915@gargle.gargle.HOWL> <1168638875.45a8039b8ef99@webmail.nd.edu> Message-ID: <45C8F4CF.7070209@v.loewis.de> Paul R Brenner schrieb: > Thanks for the reply Dieter. Working with heterogenous distributed systems > proves to me time and again that there are more software/hardware variations > than I could imagine. The machines without xml.dom.ext are machines one which I > can compute (Condor) but have only local temporary storage so I'll need to find > a way to pass the module along with my distributed job. Alternatively, rewrite your code to not use the PrettyPrint function. Instead, use minidom, and its to_xml function. Regards, Martin From martin at v.loewis.de Wed Feb 7 10:54:33 2007 From: martin at v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Wed, 07 Feb 2007 10:54:33 +0100 Subject: [XML-SIG] Where is the xml.dom.ext package in current pythondistributions? .ext documentation? In-Reply-To: <45C99F4E.3020302@hatzis.de> References: <1168445227.45a50f2b7e5b1@webmail.nd.edu> <45A61B0B.5030908@gmx.net> <45C8F473.2030708@v.loewis.de> <45C99F4E.3020302@hatzis.de> Message-ID: <45C9A1D9.4060903@v.loewis.de> Anastasios Hatzis schrieb: >> Parts of PyXML were integrated into Python 2.0, namely xml.dom, >> xml.sax, and pyexpat. Other parts were never considered for inclusion, >> for various reasons. >> > > Martin, thank you for your notice. I wonder if the mentioned parts are > developed as "forks". Do you know if there are any differences between > those parts in recent Python and in PyXML distributions? When I still maintained PyXML, I kept the Python copy and the PyXML copy of the code synchronized. Now that PyXML is not maintained anymore, the Python copy is more recent. This primarily means that it has more bugs fixed. So in a sense, it is not a fork, but the development continues within the Python core. Regards, Martin From ah at hatzis.de Wed Feb 7 10:43:42 2007 From: ah at hatzis.de (Anastasios Hatzis) Date: Wed, 07 Feb 2007 10:43:42 +0100 Subject: [XML-SIG] Where is the xml.dom.ext package in current pythondistributions? .ext documentation? In-Reply-To: <45C8F473.2030708@v.loewis.de> References: <1168445227.45a50f2b7e5b1@webmail.nd.edu> <45A61B0B.5030908@gmx.net> <45C8F473.2030708@v.loewis.de> Message-ID: <45C99F4E.3020302@hatzis.de> Martin v. L?wis wrote: ... > > Parts of PyXML were integrated into Python 2.0, namely xml.dom, > xml.sax, and pyexpat. Other parts were never considered for inclusion, > for various reasons. > Martin, thank you for your notice. I wonder if the mentioned parts are developed as "forks". Do you know if there are any differences between those parts in recent Python and in PyXML distributions? Regards, Anastasios From ah at hatzis.de Wed Feb 7 13:53:07 2007 From: ah at hatzis.de (Anastasios Hatzis) Date: Wed, 07 Feb 2007 13:53:07 +0100 Subject: [XML-SIG] Where is the xml.dom.ext package in current pythondistributions? .ext documentation? In-Reply-To: <45C9A1D9.4060903@v.loewis.de> References: <1168445227.45a50f2b7e5b1@webmail.nd.edu> <45A61B0B.5030908@gmx.net> <45C8F473.2030708@v.loewis.de> <45C99F4E.3020302@hatzis.de> <45C9A1D9.4060903@v.loewis.de> Message-ID: <45C9CBB3.6050906@hatzis.de> Martin v. L?wis wrote: > Anastasios Hatzis schrieb: > >>> Parts of PyXML were integrated into Python 2.0, namely xml.dom, >>> xml.sax, and pyexpat. Other parts were never considered for inclusion, >>> for various reasons. >>> >> >> Martin, thank you for your notice. I wonder if the mentioned parts are >> developed as "forks". Do you know if there are any differences between >> those parts in recent Python and in PyXML distributions? > > When I still maintained PyXML, I kept the Python copy and the PyXML > copy of the code synchronized. Now that PyXML is not maintained anymore, > the Python copy is more recent. This primarily means that it has more > bugs fixed. > Good to know for migration. The reason for switching to Python is just to reduce system requirements of my tool. The prototype works fine with PyXML, though. Is the xml.dom entirely -with all subpackages/modules- available under the same package in Python? Currently I use from PyXML particularily these features: # (1) for reading/parsing data from XML: from xml.dom.ext.reader import Sax2 # (2) for building/manipulating DOM tree: from xml.dom.DOMImplementation import implementation # (3) for serializing data to XML: from xml.dom.ext import PrettyPrint AFAIK, I can replace (2) with the respective features in Python, seem to have still the same structure and names, at least those I use. I guess (3) can be replaced by a to_xml() method (?) I noticed somewhere, but I need to look again. There is just (1) which leaves me with some doubt and head-ache what to do. I wonder which Python lib would be the appropriate replacement for the Sax2 reader. Nota bene, that I was confused by the name "SAX" since I use it as described here: http://pyxml.sourceforge.net/topics/howto/node18.html in order to get a DOM tree from the XML file which I can than walk through - I don't care the events... but I thought SAX is event-driven?!? However, I need to switch to a tree-based XML parser alternative on Python distribution. Regards, Anastasios From martin at v.loewis.de Wed Feb 7 22:06:34 2007 From: martin at v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Wed, 07 Feb 2007 22:06:34 +0100 Subject: [XML-SIG] Where is the xml.dom.ext package in current pythondistributions? .ext documentation? In-Reply-To: <45C9CBB3.6050906@hatzis.de> References: <1168445227.45a50f2b7e5b1@webmail.nd.edu> <45A61B0B.5030908@gmx.net> <45C8F473.2030708@v.loewis.de> <45C99F4E.3020302@hatzis.de> <45C9A1D9.4060903@v.loewis.de> <45C9CBB3.6050906@hatzis.de> Message-ID: <45CA3F5A.3020506@v.loewis.de> Anastasios Hatzis schrieb: > Is the xml.dom entirely -with all subpackages/modules- available under > the same package in Python? Not at all. Not with all subpackages; primarily, just minidom is included (and pulldom and the DOM builder). > # (1) for reading/parsing data from XML: > from xml.dom.ext.reader import Sax2 Use xml.dom.minidom.parse instead. > # (2) for building/manipulating DOM tree: > from xml.dom.DOMImplementation import implementation Use xml.dom.minidom instead. If you need a DOMImplementation, use xml.dom.getDOMImplementation(). If you need to create nodes and such, use the relevant create* factory method on the document. > # (3) for serializing data to XML: > from xml.dom.ext import PrettyPrint Use toxml/toprettyxml instead. > in order to get a DOM tree from the XML file which I can than walk > through - I don't care the events... but I thought SAX is > event-driven?!? However, I need to switch to a tree-based XML parser > alternative on Python distribution. Correct. What you currently uses is called a "DOM builder" (i.e. an algorithm that creates a DOM tree) out of SAX2 events. So it consumes SAX events and produces a DOM tree. Python comes with a different such builder out of the box. Regards, Martin From ah at hatzis.de Thu Feb 8 09:24:52 2007 From: ah at hatzis.de (Anastasios Hatzis) Date: Thu, 08 Feb 2007 09:24:52 +0100 Subject: [XML-SIG] Where is the xml.dom.ext package in current pythondistributions? .ext documentation? In-Reply-To: <45CA3F5A.3020506@v.loewis.de> References: <1168445227.45a50f2b7e5b1@webmail.nd.edu> <45A61B0B.5030908@gmx.net> <45C8F473.2030708@v.loewis.de> <45C99F4E.3020302@hatzis.de> <45C9A1D9.4060903@v.loewis.de> <45C9CBB3.6050906@hatzis.de> <45CA3F5A.3020506@v.loewis.de> Message-ID: <45CADE54.7000709@hatzis.de> Martin v. L?wis wrote: > Anastasios Hatzis schrieb: >> Is the xml.dom entirely -with all subpackages/modules- available under >> the same package in Python? > > Not at all. Not with all subpackages; primarily, just minidom is > included (and pulldom and the DOM builder). > ... Martin, many thanks for your information and suggestions. It will be very much of help for the scheduled re-engineering of the SDK. Regards, Anastasios From mbmessaoud at yahoo.com Thu Feb 8 14:01:06 2007 From: mbmessaoud at yahoo.com (Mokhtar BEN MESSAOUD) Date: Thu, 8 Feb 2007 05:01:06 -0800 (PST) Subject: [XML-SIG] reading XML file defined by XSD Message-ID: <434824.75408.qm@web57213.mail.re3.yahoo.com> Hi I have an xml file defined with an XSD file I need to create a GUI for editing this XML file so I need to retrieve XML value and its type ( defined in the XSD file) Is there a python module that allow that? Regards ____________________________________________________________________________________ Need Mail bonding? Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users. http://answers.yahoo.com/dir/?link=list&sid=396546091 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/xml-sig/attachments/20070208/ec73f5c0/attachment.html From sbi at skynet.be Sun Feb 11 13:42:19 2007 From: sbi at skynet.be (=?ISO-8859-1?Q?St=E9phane_Bidoul?=) Date: Sun, 11 Feb 2007 13:42:19 +0100 Subject: [XML-SIG] Pushing pyxml fixes to python xml lib Message-ID: Hello, I used to use pyxml because it corrects some bugs in the standard distribution of the xml package. Now that pyxml is no longer maintained and windows setups for python 2.5 are not available, I would like to see some of the fixes propagated to the standard python library. For instance, there are namespace-related bugs in XMLGenerator that were fixed long ago in pyxml: - http://sourceforge.net/tracker/index.php?func=detail&aid=1463026&group_id=5470&atid=305470 - http://sourceforge.net/tracker/index.php?func=detail&aid=847665&group_id=5470&atid=105470 The patch looks quite easy and safe but noone is committing it. How can we make this progress? Thanks, -sbi -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/xml-sig/attachments/20070211/b4187b1d/attachment.html From martin at v.loewis.de Sun Feb 11 22:50:39 2007 From: martin at v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Sun, 11 Feb 2007 22:50:39 +0100 Subject: [XML-SIG] Pushing pyxml fixes to python xml lib In-Reply-To: References: Message-ID: <45CF8FAF.8030605@v.loewis.de> St?phane Bidoul schrieb: > The patch looks quite easy and safe but noone is committing it. How can > we make this progress? Submit patches or change requests to sf.net/projects/python. For patches already there, you need either need to wait until somebody reviews them, or you can use the offer of some python-dev'ers (including myself) to review one patch if you review five other Python patches in return (notice that there are several hundred unreviewed patches; this is just one of them. There is no chance that we will ever catch up if we don't get more reviewers). I'm surprised that you found code in PyXML that is not in Python; I was pretty sure that this could not have happened, as I always merged all changes in PyXML into Python when making a PyXML release. Can you kindly refer to the specific CVS revision numbers of files in PyXML where the things you mentioned had been fixed? Regards, Martin From noreply at sourceforge.net Wed Feb 21 23:42:23 2007 From: noreply at sourceforge.net (SourceForge.net) Date: Wed, 21 Feb 2007 14:42:23 -0800 Subject: [XML-SIG] [ pyxml-XBEL-1665664 ] parse time problem Message-ID: XBEL item #1665664, was opened at 2007-02-21 22:42 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=707658&aid=1665664&group_id=6473 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Problem Group: None Status: Open Priority: 5 Private: No Submitted By: S?rgio Monteiro Basto (sergiomb) Assigned to: Nobody/Anonymous (nobody) Summary: parse time problem Initial Comment: I begin to report problem on python (https://sourceforge.net/tracker/index.php?func=detail&aid=1656559&group_id=5470&atid=105470) but this is a specif of file ./site-packages/_xmlplus/utils/iso8601.py gmt = __extract_date(m) + __extract_time(m) + (0, 0, 0) this is wrong My sugestion is: gmt = __extract_date(m) + __extract_time(m) gmt = datetime(gmt).timetuple() (0,0,0) zero for week of day, zero for day of the year and zero isdst is the error here. timetuple calculate this last 3 numbers well. and my problem is gone ! references http://docs.python.org/lib/module-time.html: 0 tm_year (for example, 1993) 1 tm_mon range [1,12] 2 tm_mday range [1,31] 3 tm_hour range [0,23] 4 tm_min range [0,59] 5 tm_sec range [0,61]; see (1) in strftime() description 6 tm_wday range [0,6], Monday is 0 7 tm_yday range [1,366] 8 tm_isdst 0, 1 or -1; see below ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=707658&aid=1665664&group_id=6473 From noreply at sourceforge.net Thu Feb 22 17:19:46 2007 From: noreply at sourceforge.net (SourceForge.net) Date: Thu, 22 Feb 2007 08:19:46 -0800 Subject: [XML-SIG] [ pyxml-XBEL-1665664 ] parse time problem Message-ID: XBEL item #1665664, was opened at 2007-02-21 22:42 Message generated for change (Comment added) made by sergiomb You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=707658&aid=1665664&group_id=6473 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Problem Group: None Status: Open Priority: 5 Private: No Submitted By: S?rgio Monteiro Basto (sergiomb) Assigned to: Nobody/Anonymous (nobody) Summary: parse time problem Initial Comment: I begin to report problem on python (https://sourceforge.net/tracker/index.php?func=detail&aid=1656559&group_id=5470&atid=105470) but this is a specif of file ./site-packages/_xmlplus/utils/iso8601.py gmt = __extract_date(m) + __extract_time(m) + (0, 0, 0) this is wrong My sugestion is: gmt = __extract_date(m) + __extract_time(m) gmt = datetime(gmt).timetuple() (0,0,0) zero for week of day, zero for day of the year and zero isdst is the error here. timetuple calculate this last 3 numbers well. and my problem is gone ! references http://docs.python.org/lib/module-time.html: 0 tm_year (for example, 1993) 1 tm_mon range [1,12] 2 tm_mday range [1,31] 3 tm_hour range [0,23] 4 tm_min range [0,59] 5 tm_sec range [0,61]; see (1) in strftime() description 6 tm_wday range [0,6], Monday is 0 7 tm_yday range [1,366] 8 tm_isdst 0, 1 or -1; see below ---------------------------------------------------------------------- >Comment By: S?rgio Monteiro Basto (sergiomb) Date: 2007-02-22 16:19 Message: Logged In: YES user_id=4882 Originator: YES Please forget my last comment it is all wrong. finally I resolve my problem instead return time.mktime which is timezone system depend return time.mktime(gmt) + __extract_tzd(m) - time.timezone I use calendar.timegm which isn't return calendar.timegm(gmt) + __extract_tzd(m) - time.timezone ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=707658&aid=1665664&group_id=6473 From noreply at sourceforge.net Thu Feb 22 17:20:25 2007 From: noreply at sourceforge.net (SourceForge.net) Date: Thu, 22 Feb 2007 08:20:25 -0800 Subject: [XML-SIG] [ pyxml-XBEL-1665664 ] parse time is depend of system timezone Message-ID: XBEL item #1665664, was opened at 2007-02-21 22:42 Message generated for change (Settings changed) made by sergiomb You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=707658&aid=1665664&group_id=6473 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Problem Group: None Status: Open Priority: 5 Private: No Submitted By: S?rgio Monteiro Basto (sergiomb) Assigned to: Nobody/Anonymous (nobody) >Summary: parse time is depend of system timezone Initial Comment: I begin to report problem on python (https://sourceforge.net/tracker/index.php?func=detail&aid=1656559&group_id=5470&atid=105470) but this is a specif of file ./site-packages/_xmlplus/utils/iso8601.py gmt = __extract_date(m) + __extract_time(m) + (0, 0, 0) this is wrong My sugestion is: gmt = __extract_date(m) + __extract_time(m) gmt = datetime(gmt).timetuple() (0,0,0) zero for week of day, zero for day of the year and zero isdst is the error here. timetuple calculate this last 3 numbers well. and my problem is gone ! references http://docs.python.org/lib/module-time.html: 0 tm_year (for example, 1993) 1 tm_mon range [1,12] 2 tm_mday range [1,31] 3 tm_hour range [0,23] 4 tm_min range [0,59] 5 tm_sec range [0,61]; see (1) in strftime() description 6 tm_wday range [0,6], Monday is 0 7 tm_yday range [1,366] 8 tm_isdst 0, 1 or -1; see below ---------------------------------------------------------------------- Comment By: S?rgio Monteiro Basto (sergiomb) Date: 2007-02-22 16:19 Message: Logged In: YES user_id=4882 Originator: YES Please forget my last comment it is all wrong. finally I resolve my problem instead return time.mktime which is timezone system depend return time.mktime(gmt) + __extract_tzd(m) - time.timezone I use calendar.timegm which isn't return calendar.timegm(gmt) + __extract_tzd(m) - time.timezone ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=707658&aid=1665664&group_id=6473 From ken.sayers at googlemail.com Sat Feb 24 18:52:33 2007 From: ken.sayers at googlemail.com (Ken Sayers) Date: Sat, 24 Feb 2007 12:52:33 -0500 Subject: [XML-SIG] python and xslt Message-ID: I have looked around for support in Python for XSLT. I see there is the 4Suite.org package. Are there others? I would really like to use XSLT 2.0. I even saw one that would front-end xalan. Is it hard to wrap java code from python for running in Zope or Plone? Any help would be appreciated. Ken -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/xml-sig/attachments/20070224/061efe24/attachment.htm From christopherlambrou at gmail.com Sun Feb 25 18:35:53 2007 From: christopherlambrou at gmail.com (Chris Lambrou) Date: Sun, 25 Feb 2007 17:35:53 +0000 Subject: [XML-SIG] Using xpath with elements other than the documentElement Message-ID: <70bbae280702250935t77e4ab8ftb489a7cf967f83c6@mail.gmail.com> Hi, I'm having trouble working out how to evaluate xpath expressions using xml.xpath.Evaluate with elements other than a DOM's documentElement. I have a file that contains the following: I've loaded the XML from the file, and can iterate through the 'configuration' elements using the following: dom = xml.dom.minidom.parse(projectPath, dom.documentElement) for configElement in xml.xpath.Evaluate("/javascriptProject/configuration"): #do something with the configuration element Within the loop, I'd like to be able to evaluate xpath expressions with respect to the configElement (e.g. I'd like to evaluate './module' to deal with any module sub-elements for the current configElement). I've tried various combinations of arguments passed to the xml.xpath.Evaluate method, but all of them result in errors. I've tried looking for examples online, but can only find examples that pass a document's root element (dom.documentElement) into the Evaluate method. In particular, the coverage of xpath in the HOWTO of the PyXML project is disappointingly minimal (http://pyxml.sourceforge.net/topics/howto/section-XPath.html), and I'm afraid I'm not yet sufficiently familiar with Python to be able to easily work out where I'm going wrong from the xml.xpath source. The other closest match I found was this posting - http://mail.python.org/pipermail/xml-sig/2006-January/011418.html - but unfortunately there was no followup, and the suggested solution there doesn't work for me. Hopefully, I'm missing something simple here. Surely it must be possible to evaluate xpath expressions against arbitrary elements within an xml dom tree - this has been a breeze to achieve in other languages I've worked with. Could someone please help me with this? I'd be happy to provide self-contained working examples of the problem, if that would help. Chris