From noreply at sourceforge.net Tue May 2 15:59:44 2006 From: noreply at sourceforge.net (SourceForge.net) Date: Tue, 02 May 2006 06:59:44 -0700 Subject: [XML-SIG] [ pyxml-Bugs-1480403 ] xpath.Evaluate() fails on larger documents Message-ID: Bugs item #1480403, was opened at 2006-05-02 13:59 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=106473&aid=1480403&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: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Rene Ladan (rene0) Assigned to: Nobody/Anonymous (nobody) Summary: xpath.Evaluate() fails on larger documents Initial Comment: I'm using the xpath.Evaluate() function in a Python program but xpath.Evaluate() seems to have a bug. When using a small test document (10 lines), it get the right result, but when using a larger document (about 185kB), it returns an empty list instead of the expected result. In both cases I'm expecting a list containing a single text node. The path expression and the relative starting node of the expression are the same in both cases. I've attached the test document (test-eval.xml), the larger document (vb.xml), and a test program (test-eval.py) which also has the above behaviour as a single archive xpath-evaluate.tar.gz Versions: python 2.4.3 py-xml 0.8.4 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=106473&aid=1480403&group_id=6473 From c_paredes at ml.com Tue May 2 20:41:27 2006 From: c_paredes at ml.com (c_paredes at ml.com) Date: Tue, 2 May 2006 15:41:27 -0300 Subject: [XML-SIG] Mail System Error - Returned Mail Message-ID: The original message was received at Tue, 2 May 2006 15:41:27 -0300 from ml.com [105.57.34.190] ----- The following addresses had permanent fatal errors ----- ----- Transcript of session follows ----- ... while talking to server python.org.: >>> MAIL From:c_paredes at ml.com <<< 500 c_paredes at ml.com... Access denied -------------- next part -------------- A non-text attachment was scrubbed... Name: text.zip Type: application/octet-stream Size: 22 bytes Desc: not available Url : http://mail.python.org/pipermail/xml-sig/attachments/20060502/f0567fa0/attachment.obj From aconrad.tlv at magic.fr Tue May 2 21:30:24 2006 From: aconrad.tlv at magic.fr (Alexandre CONRAD) Date: Tue, 02 May 2006 21:30:24 +0200 Subject: [XML-SIG] no 'writexml' when building a domTree from ext.Sax2 In-Reply-To: <1091129642.4127.3.camel@borgia> References: <41051B40.70604@magic.fr> <1091033737.19713.124.camel@borgia> <4108BB82.2080502@magic.fr> <1091129642.4127.3.camel@borgia> Message-ID: <4457B350.9010301@magic.fr> (sending again to the list) Uche Ogbuji wrote: > There are so many ways to do all this that I'm not sure where to start. > What are your priorities? Speed? Low memory footprint? Simplicity of > code? Avoiding installing 3rd-party tools?... >>>Warning: 4DOM is very slow. It's claim to fame used to be compliance, >>>but now it has been superseded in that regard by Andrew Clover's pxdom. >>> >>>I'm pretty sure I wouldn't recommend 4DOM to anyone for anything right >>>now. >> >>Well, I'm just reading the documentation. What would you recommand ? > > > I need much more info. minidom? cDomlette? pxdom? A Python "data binding"? > An output library? Many things would work. Hello list, I'm back on an old topic of mine. I'm thinking of re-writing the XML application that I have been running fine for a while now. Plus, I'm now more confortable with XML and mostly Python in general compared to my skills back in august 2004. But today, I'm bumping into a problem I remembered that Uche Ogbuji pointed to me. "4DOM is very slow". :) So until now, everything worked fine for me with XML files containing about 50 nodes or so. But now I'm getting into XML files from 200 to 800 nodes (and more). And I do feel that 4DOM is slow. To open an XML file, I use: from xml.dom.ext.reader import Sax2 reader = Sax2.Reader() doc = reader.fromStream("playlist.xml") xml.dom.ext.StripXml(doc) return doc So I'd like some advices of what could be recommanded as a replacement of 4DOM. (building and parsing XML files) You were talking about minidom, cDomlette, xpdom, etc... I would prefer using python's standard module library rather than installing 3rd party tools. Speed (faster than 4DOM would be a good start) is one of my priorities. I'm also using XPath for parsing (not always though). Regards, -- Alexandre CONRAD - TLV Research & Development tel : +33 1 30 80 55 05 fax : +33 1 30 80 55 06 6, rue de la plaine 78860 - SAINT NOM LA BRETECHE FRANCE From aconrad.tlv at magic.fr Wed May 3 11:02:10 2006 From: aconrad.tlv at magic.fr (Alexandre CONRAD) Date: Wed, 03 May 2006 11:02:10 +0200 Subject: [XML-SIG] no 'writexml' when building a domTree from ext.Sax2 In-Reply-To: <1091129642.4127.3.camel@borgia> References: <41051B40.70604@magic.fr> <1091033737.19713.124.camel@borgia> <4108BB82.2080502@magic.fr> <1091129642.4127.3.camel@borgia> Message-ID: <44587192.5090601@magic.fr> (sending again to the list) Uche Ogbuji wrote: > There are so many ways to do all this that I'm not sure where to start. > What are your priorities? Speed? Low memory footprint? Simplicity of > code? Avoiding installing 3rd-party tools?... >>>Warning: 4DOM is very slow. It's claim to fame used to be compliance, >>>but now it has been superseded in that regard by Andrew Clover's pxdom. >>> >>>I'm pretty sure I wouldn't recommend 4DOM to anyone for anything right >>>now. >> >>Well, I'm just reading the documentation. What would you recommand ? > > > I need much more info. minidom? cDomlette? pxdom? A Python "data binding"? > An output library? Many things would work. Hello list, I'm back on an old topic of mine. I'm thinking of re-writing the XML application that I have been running fine for a while now. Plus, I'm now more confortable with XML and mostly Python in general compared to my skills back in august 2004. But today, I'm bumping into a problem I remembered that Uche Ogbuji pointed to me. "4DOM is very slow". :) So until now, everything worked fine for me with XML files containing about 50 nodes or so. But now I'm getting into XML files from 200 to 800 nodes (and more). And I do feel that 4DOM is slow. To open an XML file, I use: from xml.dom.ext.reader import Sax2 reader = Sax2.Reader() doc = reader.fromStream("playlist.xml") xml.dom.ext.StripXml(doc) return doc So I'd like some advices of what could be recommanded as a replacement of 4DOM. (building and parsing XML files) You were talking about minidom, cDomlette, xpdom, etc... I would prefer using python's standard module library rather than installing 3rd party tools. Speed (faster than 4DOM would be a good start) is one of my priorities. I'm also using XPath for parsing (not always though). Regards, -- Alexandre CONRAD - TLV Research & Development tel : +33 1 30 80 55 05 fax : +33 1 30 80 55 06 6, rue de la plaine 78860 - SAINT NOM LA BRETECHE FRANCE From fredrik at pythonware.com Wed May 3 14:19:44 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Wed, 3 May 2006 14:19:44 +0200 Subject: [XML-SIG] no 'writexml' when building a domTree from ext.Sax2 References: <41051B40.70604@magic.fr> <1091033737.19713.124.camel@borgia> <4108BB82.2080502@magic.fr> <1091129642.4127.3.camel@borgia> <44587192.5090601@magic.fr> Message-ID: Alexandre CONRAD wrote: > I would prefer using python's standard module library rather than > installing 3rd party tools. Speed (faster than 4DOM would be a good > start) is one of my priorities. I'm also using XPath for parsing (not > always though). speed and no 3rd party tools aren't exactly compatible requirements. however, if it's okay for you to ship one or two python modules with your application, you could use the ElementTree and ElementPath modules from the ElementTree kit, together with Python's pyexpat. http://effbot.org/zone/elementtree.htm by itself, ElementTree is a bit faster than most other DOM implementations. if you add the cElementTree module (a standard component on many modern Linux systems), you'll end up with something that can read XML files faster than Python can read text files: http://effbot.org/zone/celementtree.htm#benchmarks ET is a bit limited in the XPath department, though. if you want reasonable speed and full XPath support (and a *lot* more), see http://codespeak.net/lxml/ From aconrad.tlv at magic.fr Wed May 3 16:19:06 2006 From: aconrad.tlv at magic.fr (Alexandre CONRAD) Date: Wed, 03 May 2006 16:19:06 +0200 Subject: [XML-SIG] no 'writexml' when building a domTree from ext.Sax2 In-Reply-To: References: <41051B40.70604@magic.fr> <1091033737.19713.124.camel@borgia> <4108BB82.2080502@magic.fr> <1091129642.4127.3.camel@borgia> <44587192.5090601@magic.fr> Message-ID: <4458BBDA.9020301@magic.fr> > ET is a bit limited in the XPath department, though. if you want reasonable > speed and full XPath support (and a *lot* more), see http://codespeak.net/lxml/ Ok, I'll have a look at the documentation. I might stick up to this. This looks complete and they seem to work hard on keeping it pythonic. If I understand well, to get the documentation of lxlm, I'll have to read the ET documentation as it seems to be the same API. I've been googling discussions about ET and lxml and people seems to be pretty happy about it. Thanks for you help. Regards, -- Alexandre CONRAD - TLV Research & Development tel : +33 1 30 80 55 05 fax : +33 1 30 80 55 06 6, rue de la plaine 78860 - SAINT NOM LA BRETECHE FRANCE From SRVMAIL-SA at be.issworld.com Thu May 4 13:59:53 2006 From: SRVMAIL-SA at be.issworld.com (System Attendant) Date: Thu, 4 May 2006 13:59:53 +0200 Subject: [XML-SIG] [MailServer Notification] To External Sender: a virus was found a nd action taken. Message-ID: <17319A85FBCD7941BB6A8032FAF488C90805682B@SRVMAIL> ScanMail for Microsoft Exchange took action on the message. The message details were: Sender = xml-sig at python.org Recipient(s) = kris.lekime at be.issworld.com; Subject = error Scanning time = 05/04/2006 13:59:53 Engine/Pattern = 8.000-1001/3.403.00 Action taken on message: The attachment letter.zip contained WORM_MYDOOM.L virus. ScanMail took the action: Deleted. Warning to external sender: ScanMail has detected a virus in an email you sent. From ht at inf.ed.ac.uk Wed May 10 11:04:27 2006 From: ht at inf.ed.ac.uk (Henry S. Thompson) Date: Wed, 10 May 2006 10:04:27 +0100 Subject: [XML-SIG] SAX2 and PyXML -- any actual complete implementations? Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I've spent the last day exploring the state of 0.8.4 and SAX2, and as far as I can see the following is the case: * Only expat of the distributed SAX2 parsers supports start/endPrefixMapping * Only expat of the distributed SAX2 parsers supports setDocumentLocator Given that I need a validating parser, that's a bit unfortunate. PyXML hasn't moved forward for some time -- is the energy for Python and XML going somewhere else, or does no-one care enough about validation. . .? Not a criticism, a genuine request for information. I am prepared to look at either 1) Building a validator on top of expat; 2) Adding support for start/endPrefixMapping and (easy) setDocumentLocator to SAX2/xmlproc. if there's really nothing else out there. Cheers, 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 at inf.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] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) iD4DBQFEYayckjnJixAXWBoRAuSLAJsGqE2swzUjQnlPrkCI4w5LPJVAyQCY8f3S yvznoGdBxQ9OCfdt7OcmMA== =AsXO -----END PGP SIGNATURE----- From ht at inf.ed.ac.uk Wed May 10 12:23:14 2006 From: ht at inf.ed.ac.uk (Henry S. Thompson) Date: Wed, 10 May 2006 11:23:14 +0100 Subject: [XML-SIG] prepare_input_source in saxutils Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Suspect this is an FAQ, but I don't understand what to do about it. The saxutils in the 0.8.4 distribution shadows the one in the Python 2.4 distribution proper, but it (the 0.8.4) version has at least one bug that's fixed in the official distro. What's the approved way to unshadow the (newer, corrected) saxutils? 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 at inf.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] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQFEYb8TkjnJixAXWBoRAlPPAJ0VQR5xiE8Gc2bR2bdrsU3jN3LDxQCfYib+ i0va5Q/zJEKn5/9LysDar3U= =fnjV -----END PGP SIGNATURE----- From ht at inf.ed.ac.uk Thu May 11 17:43:22 2006 From: ht at inf.ed.ac.uk (Henry S. Thompson) Date: Thu, 11 May 2006 16:43:22 +0100 Subject: [XML-SIG] Pull access to SAX Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I've built something which does this in a way I find useful, it's available for anyone who wants such a thing: http://www.ltg.ed.ac.uk/~ht/PullFromSAX.py 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 at inf.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] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQFEY1uakjnJixAXWBoRAkfaAJ9AqsT1JSR0Fm1jQbaf2dYyW3wIKwCgg99E uYzzlRlHK//Hm1UgTdQH/Vo= =40p+ -----END PGP SIGNATURE----- From noreply at sourceforge.net Thu May 18 18:04:03 2006 From: noreply at sourceforge.net (SourceForge.net) Date: Thu, 18 May 2006 09:04:03 -0700 Subject: [XML-SIG] [ pyxml-Patches-1491055 ] sgmlop broken on Python 2.5 Message-ID: Patches item #1491055, was opened at 2006-05-18 18:04 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=1491055&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: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Walter D?rwald (doerwalter) Assigned to: Nobody/Anonymous (nobody) Summary: sgmlop broken on Python 2.5 Initial Comment: extensions/sgmlop.c uses PyObject_NEW() for allocating and PyMem_DEL() for freeing which is broken under Python 2.5. This patch fixes this problem. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=306473&aid=1491055&group_id=6473 From lars at larsshack.org Sat May 20 03:09:36 2006 From: lars at larsshack.org (Lars Kellogg-Stedman) Date: Fri, 19 May 2006 21:09:36 -0400 Subject: [XML-SIG] Parsing malformed XHTML Message-ID: Hello all, There a document out there on the 'net that appears to be an XHTML document: Great, right? But unfortunately it's malformed in a number of ways (mismatched tags, tag case problems, unescaped '&' in URLs, etc). Neither minidom.parseStream() nor xml.dom.ext.reader.Sax2.Reader.fromStream() will parse it correctly: xml.sax._exceptions.SAXParseException: foo.html:2:0: syntax error And even if one gets rid of the bogus doctype declaration, the rest of the document just makes the parsers fall over: xml.sax._exceptions.SAXParseException: foo.html:14:53: not well-formed (invalid token) My next thought was to parse this with xml.dom.ext.reader.HtmlLib...but HtmlLib doesn't like the namespace declarations: xml.dom.NamespaceErr: Invalid or illegal namespace operation I need to parse this document into a DOM, make some changes, and then spit back out the modified file as (X?)HTML (ideally well-formed). Am I going to be able to do this with PyXML? If not, I'd love to hear your suggestions for the appropriate tools. Thanks! -- Lars -- Lars Kellogg-Stedman From brian at sweetapp.com Sun May 21 10:23:59 2006 From: brian at sweetapp.com (Brian Quinlan) Date: Sun, 21 May 2006 10:23:59 +0200 Subject: [XML-SIG] Parsing malformed XHTML In-Reply-To: References: Message-ID: <4470239F.1090900@sweetapp.com> Lars Kellogg-Stedman wrote: > I need to parse this document into a DOM, make some changes, and then > spit back out the modified file as (X?)HTML (ideally well-formed). Am > I going to be able to do this with PyXML? If not, I'd love to hear > your suggestions for the appropriate tools. > > Thanks! > > -- Lars > You might want to look into Beautiful Soup. Another approach is to pass the document through HTML Tidy and then process the output. Cheers, Brian From ashearerw at shearersoftware.com Tue May 23 22:38:39 2006 From: ashearerw at shearersoftware.com (Andrew Shearer) Date: Tue, 23 May 2006 16:38:39 -0400 Subject: [XML-SIG] Parsing malformed XHTML Message-ID: <17c19be0605231338u1834b86n4aaf9635577ba0a@mail.gmail.com> > Lars Kellogg-Stedman wrote: > > > I need to parse this document into a DOM, make some changes, and then > > spit back out the modified file as (X?)HTML (ideally well-formed). Am > > I going to be able to do this with PyXML? If not, I'd love to hear > > your suggestions for the appropriate tools. > > > > Thanks! > > > > -- Lars > You might want to look into Beautiful Soup. Another approach is to pass > the document through HTML Tidy and then process the output. > > Cheers, > Brian Another possibility is HTMLFilter. It parses HTML 4 or backward-compatible XHTML in a way that's more SAX-like than DOM-like, though you could still use it to build a DOM. It's well suited for modifying documents in place, because tags you don't need to modify can pass straight through without risk of indigestion. http://www.shearersoftware.com/software/developers/htmlfilter/ -- Andrew From b.n.lawrence at rl.ac.uk Fri May 26 22:22:41 2006 From: b.n.lawrence at rl.ac.uk (Bryan Lawrence) Date: Fri, 26 May 2006 21:22:41 +0100 Subject: [XML-SIG] unicode problems in elementtree Message-ID: <200605262122.41891.b.n.lawrence@rl.ac.uk> Hi Folks elementtree is barfing (well to be correct, expat is barfing) with some unicode strings I'm passing through to it ... eg: self = , self._parser = , self._parser.Parse = , data = u'badc.nerc.ac.uk:DIF:NM_HiGEM_yaao...on_Date>2005-02-03' ExpatError: not well-formed (invalid token): line 1, column 11389 args = ('not well-formed (invalid token): line 1, column 11389',) code = 4 lineno = 1 offset = 11389 For the record, we find [3 <= tau ]in that block ... we also have problem with degree symbols and whatever .. I suspect the problem is that I'm not actually passing an xml document (with a character encoding definition) to ET ... I'm just passing some stuff which is an xml fragment (from a web service interface to a database). Does elementtree and/or expat need to know the encoding to get this right? (which may be a problem coz this could be from anyone's document in any encoding ...) (Sorry, I'm a bit unicode illiterate, and while I appreciate it's something I should know, there is other stuff filling my mind at the moment ...) Bryan From dstanek at dstanek.com Sat May 27 00:34:29 2006 From: dstanek at dstanek.com (David Stanek) Date: Fri, 26 May 2006 22:34:29 +0000 Subject: [XML-SIG] unicode problems in elementtree In-Reply-To: <200605262122.41891.b.n.lawrence@rl.ac.uk> References: <200605262122.41891.b.n.lawrence@rl.ac.uk> Message-ID: <20060526223429.GE9005@darkbox.hsd1.oh.comcast.net> On Fri, May 26, 2006 at 09:22:41PM +0100, Bryan Lawrence wrote: > > Does elementtree and/or expat need to know the encoding to get this right? > (which may be a problem coz this could be from anyone's document in any > encoding ...) > I think you will have to tell elementtree what encoding your XML is in. Otherwise how would it know? I am sure there is a better way, but I have seen people try to guess encodings like: # untested and from my bad memory :-) encodings = ['utf-8', 'utf-16',i 'iso-8859-1',] for encoding in encodings: try: unicode(s, encoding) except UnicodeError: pass else: break The encodings list would be a list of common encodings that you may expect. Again there must be a better way to do this... I would suggest that you try to set a standard for encodings. David Stanek -- http://www.traceback.org GPG keyID #6272EDAF on http://pgp.mit.edu Key fingerprint = 8BAA 7E11 8856 E148 6833 655A 92E2 3E00 6272 EDAF -------------- 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/20060526/34a02057/attachment.pgp From jzgoda at o2.pl Sat May 27 12:26:32 2006 From: jzgoda at o2.pl (Jarek Zgoda) Date: Sat, 27 May 2006 12:26:32 +0200 Subject: [XML-SIG] unicode problems in elementtree In-Reply-To: <200605262122.41891.b.n.lawrence@rl.ac.uk> References: <200605262122.41891.b.n.lawrence@rl.ac.uk> Message-ID: Bryan Lawrence napisa?(a): > I suspect the problem is that I'm not actually passing an xml document (with a > character encoding definition) to ET ... I'm just passing some stuff which is > an xml fragment (from a web service interface to a database). > > Does elementtree and/or expat need to know the encoding to get this right? > (which may be a problem coz this could be from anyone's document in any > encoding ...) As per XML spec, if no encoding is declared, UTF-8 is assumed (AFAIK expat follows this). Check if your data is valid UTF-8. Expat accepts only UTF-8, UTF-16, iso-8859-1 and ascii data, but without encoding declaration treats everything as UTF-8. -- Jarek Zgoda http://jpa.berlios.de/ From md at xlhost.de Sat May 27 13:58:56 2006 From: md at xlhost.de (Matthias Dorfner) Date: Sat, 27 May 2006 13:58:56 +0200 (CEST) Subject: [XML-SIG] Pyxml question Message-ID: <60775.195.37.209.59.1148731136.squirrel@server22.xlhost.de> Hello, first of all thanks a lot for your great pyxml descriptions on your homepage, it helps me a lot! Nevertheless I've still some problems creating my xml file with the correct double quoted string in the namespace, here one example: I need exactly this output but not single quoted(' -> "). Here's the code I use to create this one: dom = xml.dom.minidom.getDOMImplementation() doc = dom.createDocument(None, "request", None) #Get the document element msg_elem = doc.documentElement #Create an xmlns attributes on the root element msg_elem.setAttributeNS(XMLNS_NAMESPACE, "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance") msg_elem.setAttributeNS(XMLNS_NAMESPACE, "xsi:noNameSpaceSchemaLocation", "Handle.xsd") Maybe you know what I can do, I tried a lot but nothing worked. Thanks for your time, Greetings Matthias D. www.xlhost.de From md at xlhost.de Sat May 27 14:45:14 2006 From: md at xlhost.de (Matthias Dorfner) Date: Sat, 27 May 2006 14:45:14 +0200 (CEST) Subject: [XML-SIG] Pyxml: DOM questions, problems with namespaces Message-ID: <62225.195.37.209.59.1148733914.squirrel@server22.xlhost.de> Hello together, I'm quite new to pyxml, so please forgive me some maybe "stupid" questions. I've two question: 1. some problems creating my xml file with the correct double quoted string in the namespace, here one example: I need exactly this output but not single quoted(' -> "). Here's the code I use to create this one: dom = xml.dom.minidom.getDOMImplementation() doc = dom.createDocument(None, "request", None) #Get the document element msg_elem = doc.documentElement #Create an xmlns attributes on the root element msg_elem.setAttributeNS(EMPTY_NAMESPACE, "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance") msg_elem.setAttributeNS(EMPTY_NAMESPACE, "xsi:noNameSpaceSchemaLocation", "Handle.xsd") 2. I want so post the above created xml structure to a webserver, but I need to convert this first to a string, how can I do this? PrettyPrint allows only writing this DOM structure to a file. Or is it possible to correctly read out this xml file? Maybe you know what I can do, I tried a lot but nothing worked. Thanks for your time, Greetings Babsi From dieter at handshake.de Sat May 27 20:06:09 2006 From: dieter at handshake.de (Dieter Maurer) Date: Sat, 27 May 2006 20:06:09 +0200 Subject: [XML-SIG] unicode problems in elementtree In-Reply-To: <200605262122.41891.b.n.lawrence@rl.ac.uk> References: <200605262122.41891.b.n.lawrence@rl.ac.uk> Message-ID: <17528.38161.106992.186300@gargle.gargle.HOWL> Bryan Lawrence wrote at 2006-5-26 21:22 +0100: >elementtree is barfing (well to be correct, expat is barfing) with some >unicode strings I'm passing through to it ... > >eg: >self = , self._parser = >, self._parser.Parse = pyexpat.xmlparser object>, data = >u'badc.nerc.ac.uk:DIF:NM_HiGEM_yaao...on_Date>2005-02-03' > ExpatError: not well-formed (invalid token): line 1, column 11389 > args = ('not well-formed (invalid token): line 1, column 11389',) > code = 4 > lineno = 1 > offset = 11389 > >For the record, we find [3 <= tau ]in that block ... I expect this is not a unicode but an XML problem: "<=" should in fact be spelled "<=" (as "<" needs to be quoted in XML). >we also have problem with >degree symbols and whatever .. You get which error? How does your source look like? -- Dieter From stylusstudio at gmail.com Tue May 30 19:11:33 2006 From: stylusstudio at gmail.com (Stylus Studio) Date: Tue, 30 May 2006 13:11:33 -0400 Subject: [XML-SIG] [ANN] Job Posting - Web Application Engineer (Python + XML) in Boston Message-ID: <57783b190605301011k2a7f1e28re15d34e865695b5c@mail.gmail.com> [ANNOUNCE] Dear Python-XML Users - We're looking to hire a Sr. Web Application Engineer with Python and XML experience. A detailed Job Description follows. To apply, send an email with resume and cover letter to stylusstudio at stylusstudio.com - Thank you! Job Description ---------------------- Sr. Web Developer / Application Engineer Responsibilities: The Sr. Web developer / Application Engineer will be responsible for developing advanced sales and marketing infrastructure and applications for the Stylus Studio Web site, http://www.stylusstudio.com - Responsibilities include developing and maintaining various mission-critical back-end server infrastructure to increase sales and visitor traffic to the site, for example: * Converting older web applications which were developed using various scripting languages into Python applications * Development of custom middleware and back-end applications * Advanced logging and personalization engines * Custom Sales tools * An online shop * Creating new websites * Creation of content authoring tools Qualifications: Ideally, the candidate will have had previously played a leading role in launching a high-traffic, e-commerce site. Candidate must have top-notch Web application development skills in addition to robust C# programming skills in order. Please note, only candidates with a bachelor's degree in computer science or engineering, or, a very substantial amount of related technical coursework and Work experience in a related field will be considered. Required Skills: Python, XML, Windows Server 2003, SQL Server, IIS, C#, ASP.NET, HTML, CSS, XSLT, JavaScript, T-SQL/Stored Procedures. Required Experience: +5 Years, Bachelors Degree For more information about Stylus Studio you can visit the Stylus Studio website at: http://www.stylusstudio.com or download the product at: http://www.stylusstudio.com/xml_download.html From Chuck_Lemons at Dell.com Tue May 30 19:24:10 2006 From: Chuck_Lemons at Dell.com (Chuck_Lemons at Dell.com) Date: Tue, 30 May 2006 12:24:10 -0500 Subject: [XML-SIG] 64 bit version of PyXML Message-ID: I am porting a Python application that uses PyXML to a 64 bit architecture and getting the following error: from xml.utils import boolean ImportError: DLL load failed with error code 193 This particular error is with boolean.pyd. I found two other pyd files, pyexpat.py and sglmop.pyd. I don't think I will need sglmop.pyd, but I will probably need pyexpat.pyd. Is there a 64 bit version of PyXML available? I am running my Python applications on 64 bit WinPE/VistaPE. The 64 bit versions of PE do not include the WOW layer that allows 32 bit applications to run on 64 bit applications. Therefore, all executables/DLLs need to be compiled natively for 64 bit. Chuck Lemons -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/xml-sig/attachments/20060530/1258d012/attachment.html From martin at v.loewis.de Wed May 31 00:12:06 2006 From: martin at v.loewis.de (martin at v.loewis.de) Date: Wed, 31 May 2006 00:12:06 +0200 Subject: [XML-SIG] 64 bit version of PyXML In-Reply-To: References: Message-ID: <1149027126.447cc3362481a@www.domainfactory-webmail.de> Zitat von Chuck_Lemons at Dell.com: > I am porting a Python application that uses PyXML to a 64 bit > architecture and getting the following error: > > from xml.utils import boolean > ImportError: DLL load failed with error code 193 Why 64-bit architecture are you talking about (processor, operating system, Python distribution)? (ok, later you say it's VistaPE. Still not sure whether that is Itanium or AMD64, and what Python version) > This particular error is with boolean.pyd. I found two other pyd files, > pyexpat.py and sglmop.pyd. I don't think I will need sglmop.pyd, but I > will probably need pyexpat.pyd. Is there a 64 bit version of PyXML > available? No - you will need to build it yourself. There isn't an official Python binary release for Win64 on AMD64, either (atleast not from python.org). Regards, Martin From Chuck_Lemons at Dell.com Wed May 31 16:34:28 2006 From: Chuck_Lemons at Dell.com (Chuck_Lemons at Dell.com) Date: Wed, 31 May 2006 09:34:28 -0500 Subject: [XML-SIG] 64 bit version of PyXML In-Reply-To: <1149027126.447cc3362481a@www.domainfactory-webmail.de> Message-ID: Thanks for the response Martin. The 64-bit architecture is AMD64. I am using Python 2.4.3.11 from ActiveState. This version does provide 64-bit support for AMD64. Ok, it sounds like I need to build it myself. What CVS modules will I need to get? Chuck -----Original Message----- From: martin at v.loewis.de [mailto:martin at v.loewis.de] Sent: Tuesday, May 30, 2006 5:12 PM To: Lemons, Chuck Cc: xml-sig at python.org Subject: Re: [XML-SIG] 64 bit version of PyXML Zitat von Chuck_Lemons at Dell.com: > I am porting a Python application that uses PyXML to a 64 bit > architecture and getting the following error: > > from xml.utils import boolean > ImportError: DLL load failed with error code 193 Why 64-bit architecture are you talking about (processor, operating system, Python distribution)? (ok, later you say it's VistaPE. Still not sure whether that is Itanium or AMD64, and what Python version) > This particular error is with boolean.pyd. I found two other pyd > files, pyexpat.py and sglmop.pyd. I don't think I will need > sglmop.pyd, but I will probably need pyexpat.pyd. Is there a 64 bit > version of PyXML available? No - you will need to build it yourself. There isn't an official Python binary release for Win64 on AMD64, either (atleast not from python.org). Regards, Martin From mailserv-reply at SMTP.UNIMELB.EDU.AU Wed May 31 16:44:25 2006 From: mailserv-reply at SMTP.UNIMELB.EDU.AU (PMDF Mailserv V6.2) Date: Thu, 01 Jun 2006 00:44:25 +1000 Subject: [XML-SIG] Problems in PMDF Mailserv V6.2 command processing Message-ID: <01M33B8CXGUUBH6VPX@SMTP.UNIMELB.EDU.AU> Error in the command: The original message was received at Wed, 31 May 2006 09:45:20 -0500 from python.org [91.202.94.8] Unrecognized command verb: THE Subsequent commands ignored because of previous error. Ignored: ----- The following addresses had permanent fatal errors ----- Ignored: Ignored: ----- Transcript of session follows ----- Ignored: ... while talking to mail server unimelb.edu.au.: Ignored: 554 ... Message is too large Ignored: 554 ... Service unavailable Use the HELP command to get a list of legal MAILSERV commands. From martin at v.loewis.de Wed May 31 22:42:39 2006 From: martin at v.loewis.de (martin at v.loewis.de) Date: Wed, 31 May 2006 22:42:39 +0200 Subject: [XML-SIG] 64 bit version of PyXML In-Reply-To: References: Message-ID: <1149108159.447dffbf140b3@www.domainfactory-webmail.de> Zitat von Chuck_Lemons at Dell.com: > Ok, it sounds like I need to build it myself. What CVS modules will I > need to get? None; you need the source release (which you find next to where you find the binary release). They you do "python setup.py install". For that to work, you need the same tool chain that ActiveState was using to produce the Win64 binaries in the first place. Regards, Martin