From rodsenra at gpr.com.br Wed Dec 1 12:05:47 2004 From: rodsenra at gpr.com.br (Rodrigo Dias Arruda Senra) Date: Wed Dec 1 12:05:50 2004 Subject: [XML-SIG] PyXML 0.8.4 released In-Reply-To: <41ACE508.3030009@v.loewis.de> References: <41ACE508.3030009@v.loewis.de> Message-ID: <20041201090547.00004444@Fenix> [ "Martin v. L?wis" ]: -------------------------------------------------------- > Version 0.8.4 of the Python/XML distribution is now available. Excellent. > It should be considered a beta release, and can be downloaded from the > following URLs: > > http://prdownloads.sourceforge.net/pyxml/PyXML-0.8.4.tar.gz > http://prdownloads.sourceforge.net/pyxml/PyXML-0.8.4.win32-py2.2.exe > http://prdownloads.sourceforge.net/pyxml/PyXML-0.8.4.win32-py2.3.exe > http://prdownloads.sourceforge.net/pyxml/PyXML-0.8.4.win32-py2.3.exe > > Changes in this version, compared to 0.8.3: > > * bump version number to 0.8.4, as Python 2.4 requires that > as the minimum PyXML version. Martin, the absence of a PyXML-0.8.4.win32-py2.4.exe is due to its beta nature ? I suppose that PyXML-0.8.4.win32-py2.3.exe can be used with 2.4, right ? best regards, Senra From rodsenra at gpr.com.br Wed Dec 1 12:20:32 2004 From: rodsenra at gpr.com.br (Rodrigo Dias Arruda Senra) Date: Wed Dec 1 12:20:30 2004 Subject: [XML-SIG] PyXML 0.8.4 released In-Reply-To: <20041201090547.00004444@Fenix> References: <41ACE508.3030009@v.loewis.de> <20041201090547.00004444@Fenix> Message-ID: <20041201092032.00005686@Fenix> [ Rodrigo Dias Arruda Senra ]: -------------------------------------------------------- > > http://prdownloads.sourceforge.net/pyxml/PyXML-0.8.4.tar.gz > > http://prdownloads.sourceforge.net/pyxml/PyXML-0.8.4.win32-py2.2.exe > > http://prdownloads.sourceforge.net/pyxml/PyXML-0.8.4.win32-py2.3.exe > > http://prdownloads.sourceforge.net/pyxml/PyXML-0.8.4.win32-py2.3.exe > > Martin, > the absence of a PyXML-0.8.4.win32-py2.4.exe is due to its beta nature ? Answering my own dumb question, by try-and-no-error, the link below exists. It was only absent from the previous e-mail. > > http://prdownloads.sourceforge.net/pyxml/PyXML-0.8.4.win32-py2.4.exe > I suppose that PyXML-0.8.4.win32-py2.3.exe can be used with 2.4, right ? In the light of recent news, I suppose not. best regards, Senra From disen at geo.unizh.ch Wed Dec 1 19:06:15 2004 From: disen at geo.unizh.ch (Daniel Isenegger) Date: Wed Dec 1 19:07:43 2004 Subject: [XML-SIG] cannot change xmlns:xsi Message-ID: <41AE0817.3000706@geo.unizh.ch> Hi there, i try to generate GML3-files from GML2-files (GML: Geography Markup Language) using PyXML(minidom). I do the validation in XMLSPY. My problem is that there seem to be some default values that i cannot override: the schema: ..... the instance file: here in the instance file i cannot set the attribute xmlns:xsi to 'http://www.w3.org/2001/XMLSchema-instance' (note: the urn is ...w3... and not ...w3c...) using minidom nodelist = self.dom.getElementsByTagName("ogr:FeatureCollection") if nodelist: node.setAttribute("xmlns:xsi","http://www.w3.org/2001/XMLSchema-instance") the attribute is temporally set to ...w3... and then reset to ..w3c... Is there a default-value i cannot override? Or did i get the whole thing wrong?? Thanks Dani From dieter at handshake.de Wed Dec 1 20:04:24 2004 From: dieter at handshake.de (Dieter Maurer) Date: Wed Dec 1 20:35:42 2004 Subject: [XML-SIG] Python Web Services and .NET - will it ever work In-Reply-To: References: Message-ID: <16814.5560.549106.385434@gargle.gargle.HOWL> Richard Kessler wrote at 2004-11-30 08:39 -0800: >Apologies if this is the wrong new group, but I have been STRUGGLING to get >either SOAPpy or ZSI to successfully consume .NET web services and it just >will not work. I have read a few items on the the net regarding problems >others have had. I very much want to use Plone and a Python web service >client to consume web services from my backend (Microsoft .NET) but if the >two wont talk, I am out of luck. There was a thread on "comp.lang.python" which discussed a similar problem. I had the impression that the poster could solve its problem... -- Dieter From and-xml at doxdesk.com Thu Dec 2 16:35:47 2004 From: and-xml at doxdesk.com (Andrew Clover) Date: Thu Dec 2 16:35:37 2004 Subject: [XML-SIG] cannot change xmlns:xsi In-Reply-To: <41AE0817.3000706@geo.unizh.ch> References: <41AE0817.3000706@geo.unizh.ch> Message-ID: <41AF3653.70403@doxdesk.com> Daniel Isenegger wrote: > node.setAttribute("xmlns:xsi","http://www.w3.org/2001/XMLSchema-instance") setAttribute is a Level 1 method and thus namespace-ignorant. The above should probably work as long as there is already an xmlns:xsi attribute on 'node', but if there isn't it'll create a new one as a Level 1 node, without a namespace. This is just one of the many problems when mixing namespace-aware and namespace-ignorant methods. Really you want: XMLNS= 'http://www.w3.org/2000/xmlns/' XSINS= 'http://www.w3.org/2001/XMLSchema-instance' node.setAttributeNS(XMLNS, 'xmlns:xsi', XSINS) However... In DOM Level 2, the namespaceURI of an Element or Attr is considered part of its identity, not dynamically recalculated. So, given: you can change the value of the xmlns:q attribute to 'eggs', but the namespaceURI of the q:b element is still 'spam'. Quite what DOM Level 2 implementations are supposed to do with the problem during output of the document is unspecified, as DOM Level 2 says nothing about IO. But DOM Level 3 LS does. It uses "namespace fixup" to ensure all namespaceURIs survive the output process. You would end up with: Therefore correcting the value of the namespace declaration on the root element won't help much; all its descendants would still have the wrong ('...w3c...') namespace. You would have to walk over the whole document tree using DOM Level 3's Document.renameNode method to change all their namespaces. The alternative would be to use a completely namespace-ignorant DOM implementation. For a DOM Level 3 implemenation you can request this by setting the domConfig parameter 'namespaces' to False. However (again)... > the attribute is temporally set to ...w3... and then reset to ..w3c... Having said all that... minidom is not a DOM Level 3 implementation. It doesn't do namespace fixup at all. Its toxml() method just outputs attributes as they are, so it shouldn't be putting the '...w3c...' namespace in anywhere. So it must be some other tool or part of the program that is having this effect. -- Andrew Clover mailto:and@doxdesk.com http://www.doxdesk.com/ From richard.kessler at matteicos.com Fri Dec 3 18:47:40 2004 From: richard.kessler at matteicos.com (Richard Kessler) Date: Fri Dec 3 18:48:52 2004 Subject: [XML-SIG] Re: Python Web Services and .NET - will it ever work References: Message-ID: Thanks to everyone for the suggestions - I got it to work by do this: I used SOAPpy's WSDL module. By simply creating a proxy using the WSDL from my .NET service, everything started working. Amazing! I did have to decorate my .NET class with [SoapDocumentService (Use=SoapBindingUse.Encoded )]. Thanks again for your responses. Richard "Richard Kessler" wrote in message news:coi7ph$b6c$1@sea.gmane.org... > Apologies if this is the wrong new group, but I have been STRUGGLING to get > either SOAPpy or ZSI to successfully consume .NET web services and it just > will not work. I have read a few items on the the net regarding problems > others have had. I very much want to use Plone and a Python web service > client to consume web services from my backend (Microsoft .NET) but if the > two wont talk, I am out of luck. > > Does anyone out there have suggestions, know of successful projects where > Python consumes .NET web services or have any idea where some thorough > documentation on how to get this to work may exist. > > Thanks very much in advance, > > Richard Kessler > richard.kessler@matteicos.com > > > > _______________________________________________ > XML-SIG maillist - XML-SIG@python.org > http://mail.python.org/mailman/listinfo/xml-sig > From fredrik at pythonware.com Sun Dec 5 14:34:27 2004 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sun Dec 5 14:32:14 2004 Subject: [XML-SIG] ANN: ElementTree 1.2.2 (december 5, 2004) Message-ID: The Element type is a simple but flexible container object, designed to store hierarchical data structures, such as simplified XML infosets, in memory. The ElementTree package provides a Python implementation of this type, plus code to serialize element trees to and from XML files. ElementTree 1.2.2 is 1.2.1 plus an improved version of the HTML parser, backported from the 1.3 development branch. The new parser supports arbitrary character data encodings, and properly handles documents that mix non-ASCII character data with non-ASCII character references and entities. You can get the ElementTree package from: http://effbot.org/downloads Documentation, code samples, and points to articles about the Element- Tree package are available from: http://effbot.org/zone/element.htm enjoy /F From knight at baldmt.com Sun Dec 5 21:34:19 2004 From: knight at baldmt.com (Steven Knight) Date: Sun Dec 5 21:29:12 2004 Subject: [XML-SIG] ignoring "Undeclared entity" errors? Message-ID: Here's the problem I'm trying to solve: I want to assemble fragments of XML documentation that I intend to scatter throughout my Python modules. The fragments will use custom tags describing the content they're documenting. I'm planning to preprocess these custom tags into the right format for the output I'm generating (DocBook, nroff, etc.). I would like the text fragments to be able to contain entities that can be passed through or preprocessed. These entities *will* be declared when I process the fully-assumbled documentation, but are not declared for each individual fragment. When I try to process an individual fragment without the declarations, I of course get "Undeclared entity" fatal errors for these entities, which terminates parsing of the fragment. Defining an ErrorHandler.fatalError() method lets me detect the "Undeclared entity" error, but doesn't change the fact that the parsing terminates. Having to declare a DTD just to be able to perform some specific preprocessing on an otherwise well-formed fragment of XML feels way too heavyweight to me. I'm almost at the point of filtering all of the &entity; uses in my text so they don't look like entities and then restoring them, just to not have to jump through the parser's hoops, but that feels like cheating. Am I just going about this the wrong way? Is there some easier way io just be able to preprocess some XML-formatted data without having to worry about a declaring a DTD? Or to tell the parser that I'm not concerned about the entities in my fragment? --SK From Uche.Ogbuji at fourthought.com Sun Dec 5 23:13:21 2004 From: Uche.Ogbuji at fourthought.com (Uche Ogbuji) Date: Sun Dec 5 23:13:26 2004 Subject: [XML-SIG] PyXML, 4suite, libxml2... what should I choose? In-Reply-To: <200411291934.44488.frans.englich@telia.com> References: <200411291934.44488.frans.englich@telia.com> Message-ID: <1102284801.27542.29.camel@borgia> On Mon, 2004-11-29 at 19:34 +0000, Frans Englich wrote: > I need some guidance for the various XML implementations. Well, at the minimum you'll get argument :-) > In my project I use the Python DOM classes for instantiations of my XML data, > and I need XPath functionality, 4Suite has an XPath implementation that is very easy to use and makes extending XPath with functions implemented in Python very simple. http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/basic-xpath > WXS validation, 4Suite does not support WXS. Advantage libxml2 here. Then again, if you have a choice in the matter you really should consider using RELAX NG instead, which is superior to WXS and is supported by 4Suite. > and XSLT processing. 4Suite's XSLT processor is also easy to use and extend. http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/basic-xslt > Currently, I pipe out my structures to libxml2/libxslt's xmllint/xsltproc for > doing validation, and XSLT processing. libxml2 is capable, but the solution > is ugly, and slow(de-serialization/serialization). In addition, I lack XPath > functionality. I have no intentions to skip Python's XML structures, and use > for example libxml2's. Out of curiousity, by "Python's XML structures" do you mean minidom? If so, what motivates this reservation? I should add the disclaimer that 4Suitee's XPath and XSLT features require Domlette rather than minidom. Domlette is very similar to minidom (much more so than libxml2's DOM- like structures). Domlette is also IMO as pythonic as you can get and still be DOM-like (more Pythonic and you're into the territory of ElementTree and data bindings such as Anobind, GenerateDS and Gnosis Objectify). > So, my plan is to get XPath somewhere, and perhaps be able to substitute > libxml2 for something more Pythonic while I'm at it. You should at least give 4Suite a try if this is your bottom line. > From what I can tell, there is three major packages to keep an eye on: 1) > standard Python; 2) PyXML; 3) 4suite. Let me see if I got this straight: > > * Python have _no_ XPath implementation (right?) Right. > * PyXML install an XPath implementation(written by fourthought) into Python's > package xml(xml.xpath). Is it version 1.0? Is it robust and stable? It's pretty robust and stable. It is based on very old code from 4Suite's XPath and the latter has been optimized a great deal and has added a lot of useful features. > * PyXML has xml.xslt; not an option since it's not stable/production quality, > according to the docs -- or what is its status? How much "experimental" is > it? Basing XSLT on plain DOM is a bit tricky, which is why in 4Suite we've settled on Domlette-only. It will take a lot of work to get Python's xml.xslt compliant and efficient while still using plain old minidom. Again, it's based on old code from 4Suite which has been much optimized and otherwise improved since then. > * 4suite has XPath(another implementation written by fourthought..?) and > robust xslt. It's a much newer version of the XSLT in PyXML. > * Neither PyXML nor 4suite has a W3C XML Schema stack, so I'll have to look > elsewhere; one alternative is XSV but it brings in addition a dependency on > PyLTXML. Looks like continuing to pipe to libxml2's xmllint(or link) is still > the best alternative. I suppose another option is to use Trang to convert WXS to RELAX NG and then use XVIF or 4Suite. > What is the best option(s) for me? With my interest of keeping the > dependencies down, should I go for PyXML-XPath + PyXML-XSLT _if_ it's good > enough or libxslt + libxml2-WXS? I could use 4suite's XSLT, but since I > nevertheless will have a dependency on libxml2/libxslt for WXS I can use > that(and eat the speed penalty). > Important is it has a future(maintained..) and is stable/trustable. > > What should I go for, and what have I missed? > > BTW, is there any plans to merge any XSLT/XPath stack into vanilla Python? > (when?) It's functionality often needed, AFAICT. XPath is a little language, and XSLT a not-so-little one, so I'd expect they're too much to stuff into core Pylib, even with the "batteries included" philosophy. Add to that the fact that something a bit richer than minidom would be needed for the data model (if the implementation is to be at all efficient) and I'd say it's a stretch. > Yes, I'm new on the Python & XML front.. Welcome. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Use CSS to display XML - http://www.ibm.com/developerworks/edu/x-dw-x-xmlcss-i.html Location, Location, Location - http://www.xml.com/pub/a/2004/11/24/py-xml.html The State of Python-XML in 2004 - http://www.xml.com/pub/a/2004/10/13/py-xml.html Be humble, not imperial (in design) - http://www.adtmag.com/article.asp?id=10286 XMLOpen and more XML Hacks - http://www.ibm.com/developerworks/xml/library/x-think27.html A survey of XML standards - http://www-106.ibm.com/developerworks/xml/library/x-stand4/ From Uche.Ogbuji at fourthought.com Sun Dec 5 23:20:47 2004 From: Uche.Ogbuji at fourthought.com (Uche Ogbuji) Date: Sun Dec 5 23:20:51 2004 Subject: [XML-SIG] Re: PyXML, 4suite, libxml2... what should I choose? In-Reply-To: <200411292206.16892.paul@boddie.org.uk> References: <200411292206.16892.paul@boddie.org.uk> Message-ID: <1102285247.27542.37.camel@borgia> On Mon, 2004-11-29 at 22:06 +0100, Paul Boddie wrote: > Frans Englich wrote: > > > > Currently, I pipe out my structures to libxml2/libxslt's xmllint/xsltproc > > for doing validation, and XSLT processing. libxml2 is capable, but the > > solution is ugly, and slow(de-serialization/serialization). In addition, I > > lack XPath functionality. I have no intentions to skip Python's XML > > structures, and use for example libxml2's. > > Although it was written to meet my own simple needs, I suggest you take a look > at libxml2dom: > > http://www.python.org/pypi?:action=display&name=libxml2dom > > It should be possible to feed DOM nodes from libxml2dom into PyXML's XPath > implementation, although I suppose I ought to wrap the libxml2 XPath > functionality itself in order to be able to drop that particular dependency > on PyXML. I did hear something about 4Suite and XPath convenience methods on > nodes, and that did make me wonder if some kind of standard might emerge that > I could implement in libxml2dom. It's no-brainer stuff. On any node object: node.xpath('path/to/desired/child[predicate-or-whatever]') The node itself serves as the context node, the only item in the context list, which is set to position() = 1. Namespace bindings are extracted from in-scope namespaces for that node. Variable bindings can be passed in as an optional second dictionary parameter. You're welcome to emulate that API, of course. If you have any feedback, let us know. > Anyway, I've been using libxml2dom with libxslt without unnecessary > serialisation, so this may be what you're looking for. If you and others want > to improve the software, I may establish a SourceForge project for it and let > development follow that course. Building a smoother DOM interface to libxml2 is a very valuable service. Perhaps, however, you want to pool your efforts with the lxml/vlibxml2 folks? They seem to be more focused on rationalizing memory management, which seems a useful complement to your focus. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Use CSS to display XML - http://www.ibm.com/developerworks/edu/x-dw-x-xmlcss-i.html Location, Location, Location - http://www.xml.com/pub/a/2004/11/24/py-xml.html The State of Python-XML in 2004 - http://www.xml.com/pub/a/2004/10/13/py-xml.html Be humble, not imperial (in design) - http://www.adtmag.com/article.asp?id=10286 XMLOpen and more XML Hacks - http://www.ibm.com/developerworks/xml/library/x-think27.html A survey of XML standards - http://www-106.ibm.com/developerworks/xml/library/x-stand4/ From disen at geo.unizh.ch Tue Dec 7 09:48:43 2004 From: disen at geo.unizh.ch (Daniel Isenegger) Date: Tue Dec 7 09:50:31 2004 Subject: [XML-SIG] Re: XML-SIG Digest, Vol 20, Issue 3 In-Reply-To: <20041203110007.647F01E4018@bag.python.org> References: <20041203110007.647F01E4018@bag.python.org> Message-ID: <41B56E6B.3000206@geo.unizh.ch> xml-sig-request@python.org schrieb: >Send XML-SIG mailing list submissions to > xml-sig@python.org > >To subscribe or unsubscribe via the World Wide Web, visit > http://mail.python.org/mailman/listinfo/xml-sig >or, via email, send a message with subject or body 'help' to > xml-sig-request@python.org > >You can reach the person managing the list at > xml-sig-owner@python.org > >When replying, please edit your Subject line so it is more specific >than "Re: Contents of XML-SIG digest..." > > >Today's Topics: > > 1. Re: cannot change xmlns:xsi (Andrew Clover) > > >---------------------------------------------------------------------- > >Message: 1 >Date: Thu, 02 Dec 2004 16:35:47 +0100 >From: Andrew Clover >Subject: Re: [XML-SIG] cannot change xmlns:xsi >To: xml-sig@python.org >Message-ID: <41AF3653.70403@doxdesk.com> >Content-Type: text/plain; charset=ISO-8859-1; format=flowed > >Daniel Isenegger wrote: > > > >>node.setAttribute("xmlns:xsi","http://www.w3.org/2001/XMLSchema-instance") >> >> > >setAttribute is a Level 1 method and thus namespace-ignorant. The above >should probably work as long as there is already an xmlns:xsi attribute >on 'node', but if there isn't it'll create a new one as a Level 1 node, >without a namespace. This is just one of the many problems when mixing >namespace-aware and namespace-ignorant methods. Really you want: > > XMLNS= 'http://www.w3.org/2000/xmlns/' > XSINS= 'http://www.w3.org/2001/XMLSchema-instance' > node.setAttributeNS(XMLNS, 'xmlns:xsi', XSINS) > >However... > >In DOM Level 2, the namespaceURI of an Element or Attr is considered >part of its identity, not dynamically recalculated. So, given: > > > > > >you can change the value of the xmlns:q attribute to 'eggs', but the >namespaceURI of the q:b element is still 'spam'. > >Quite what DOM Level 2 implementations are supposed to do with the >problem during output of the document is unspecified, as DOM Level 2 >says nothing about IO. > >But DOM Level 3 LS does. It uses "namespace fixup" to ensure all >namespaceURIs survive the output process. You would end up with: > > > > > >Therefore correcting the value of the namespace declaration on the root >element won't help much; all its descendants would still have the wrong >('...w3c...') namespace. You would have to walk over the whole document >tree using DOM Level 3's Document.renameNode method to change all their >namespaces. > >The alternative would be to use a completely namespace-ignorant DOM >implementation. For a DOM Level 3 implemenation you can request this by >setting the domConfig parameter 'namespaces' to False. > >However (again)... > > > >>the attribute is temporally set to ...w3... and then reset to ..w3c... >> >> > >Having said all that... minidom is not a DOM Level 3 implementation. It >doesn't do namespace fixup at all. Its toxml() method just outputs >attributes as they are, so it shouldn't be putting the '...w3c...' >namespace in anywhere. > >So it must be some other tool or part of the program that is having this >effect. > > > Hi Andrew, thanks for your help. I now at this moment can't see all the consequences of your points, I have to study this in greater detail. All the best Dani From and-xml at doxdesk.com Tue Dec 7 18:49:53 2004 From: and-xml at doxdesk.com (Andrew Clover) Date: Tue Dec 7 18:49:40 2004 Subject: [XML-SIG] ignoring "Undeclared entity" errors? In-Reply-To: References: Message-ID: <41B5ED41.8050507@doxdesk.com> Steven Knight wrote: > When I try to process an individual fragment without the declarations, > I of course get "Undeclared entity" fatal errors for these entities, > which terminates parsing of the fragment. Yep. I think this comes from expat itself, so might not be avoidable without using/subclassing a different parser, eg. xmlproc. If you aren't tied to SAX, the pxdom parser will cope with undeclared entities. (If you use a DOM Level 3 ErrorHandler it'll receive a DOMError 'pxdom-unbound-entity' with severity WARNING.) > Having to declare a DTD just to be able to perform some specific > preprocessing on an otherwise well-formed fragment of XML feels way > too heavyweight to me. For me too - pxdom's lenient behaviour was originally intended to allow PXTL to pass entities through without having to define them in a separate doctype for 'target doctype plus PXTL'. Other Python DOM tools don't really support the idea of keeping hold of unexpanded entity references, so they can't do anything but complain if they get an undeclared one. However note that in certain circumstances (in summary: when the parser can know that there are no unprocessed DTD declarations) undeclared entities are a well-formedness error instead of a validity error. So technically your document might not be well-formed, which would be a Bad Thing. In summary, entities suck, make everything harder, and should have been left out of XML completely. -- Andrew Clover mailto:and@doxdesk.com http://www.doxdesk.com/ From postmaster at python.org Thu Dec 9 16:14:49 2004 From: postmaster at python.org (The Post Office) Date: Thu Dec 9 16:16:00 2004 Subject: [XML-SIG] MDaemon Warning - virus found: Returned mail: Data format error Message-ID: <20041209151558.E4C411E4009@bag.python.org> ******************************* WARNING ****************************** Este mensaje ha sido analizado por MDaemon AntiVirus y ha encontrado un fichero anexo(s) infectado(s). Por favor revise el reporte de abajo. Attachment Virus name Action taken ---------------------------------------------------------------------- text.zip I-Worm.Mydoom.m Removed ********************************************************************** This message was not delivered due to the following reason: Your message was not delivered because the destination computer was unreachable within the allowed queue period. The amount of time a message is queued before it is returned depends on local configura- tion parameters. Most likely there is a network problem that prevented delivery, but it is also possible that the computer is turned off, or does not have a mail system running right now. Your message was not delivered within 7 days: Mail server 154.74.86.105 is not responding. The following recipients could not receive this message: Please reply to postmaster@python.org if you feel this message to be in error. From rick.hurst at gmail.com Thu Dec 9 16:21:07 2004 From: rick.hurst at gmail.com (Rick Hurst) Date: Thu Dec 9 16:21:09 2004 Subject: [XML-SIG] dom.minidom getting the text content of a node Message-ID: <5c11d58804120907212e3480e8@mail.gmail.com> Hi, i'm trying to migrate my blogworksXML blog to zope/plone - all the blog content is stored in XML files and I am trying to walk through it using minidom and extract relevant info. I can walk through and read attributes but can't get at text content stored inside nodes which holds the title and body text. The node in question looks like this i'm trying the following (i'm a python newbie BTW):- from xml.dom.minidom import parse, parseString dom1 = parse('foo.xml') for node in dom1.getElementsByTagName("blog"): id = node.getAttribute("id") print id for contentNode in node.getElementsByTagName("text"): for titleNode in node.getElementsByTagName("blogtitle"): print titleNode.nodeName #returns "blogtitle" print titleNode.nodeType #returns 1 #print titleNode.data #AttributeError: Element instance has no attribute 'data' print titleNode.nodeValue #returns "None" is there a way of doing this with minidom or do I need to be using a different parser? Any advice appreciated! the xml is as follows:- rick 1087570241010 1087570241 en -- Rick Hurst http://hypothecate.co.uk From rick.hurst at gmail.com Thu Dec 9 17:38:15 2004 From: rick.hurst at gmail.com (Rick Hurst) Date: Thu Dec 9 17:38:18 2004 Subject: [XML-SIG] Re: dom.minidom getting the text content of a node In-Reply-To: <5c11d58804120907212e3480e8@mail.gmail.com> References: <5c11d58804120907212e3480e8@mail.gmail.com> Message-ID: <5c11d58804120908384b61e825@mail.gmail.com> On Thu, 9 Dec 2004 15:21:07 +0000, Rick Hurst wrote: > The node in question looks like this member self registration]]> OK, apart from the fact that I was looking at the wrong node (cheers peppo), from trawling google all afternoon it seems* that minidom will not parse CDATA sections. can anyone suggest a solution or should I use a different parser? *http://sourceforge.net/tracker/?func=detail&atid=105470&aid=549725&group_id=5470 From fredrik at pythonware.com Thu Dec 9 20:47:41 2004 From: fredrik at pythonware.com (Fredrik Lundh) Date: Thu Dec 9 20:45:29 2004 Subject: [XML-SIG] Re: dom.minidom getting the text content of a node References: <5c11d58804120907212e3480e8@mail.gmail.com> Message-ID: Rick Hurst wrote: > i'm trying the following (i'm a python newbie BTW):- > > from xml.dom.minidom import parse, parseString > dom1 = parse('foo.xml') > > for node in dom1.getElementsByTagName("blog"): > id = node.getAttribute("id") > print id > for contentNode in node.getElementsByTagName("text"): > for titleNode in node.getElementsByTagName("blogtitle"): > print titleNode.nodeName #returns "blogtitle" > print titleNode.nodeType #returns 1 > #print titleNode.data #AttributeError: Element > instance has no attribute 'data' > print titleNode.nodeValue #returns "None" > > is there a way of doing this with minidom or do I need to be using a > different parser? Any advice appreciated! if you add this to the inner loop, print titleNode.childNodes print titleNode.firstChild.wholeText you get this output (under 2.3.3): [, ] Plone: remove member self registration > > http://sourceforge.net/tracker/?func=detail&atid=105470&aid=549725&group_id=5470 this bug report complains that the DOM represents the CDATA section as four text nodes, which is also perfectly valid (see Martin's explanation). code that depends on being able to identify a CDATA section in the source file is broken; character data, character references, entities, and CDATA section should all be treated as text. btw, here's the corresponding ElementTree version: from elementtree import ElementTree tree = ElementTree.parse("foo.xml") for node in tree.findall(".//blog"): print node.get("id") for content_node in node.findall("text"): print content_node.findtext("blogtitle") or, shorter: for node in tree.findall(".//blog"): print node.get("id") print node.findtext("text/blogtitle") From rick.hurst at gmail.com Fri Dec 10 09:40:45 2004 From: rick.hurst at gmail.com (Rick Hurst) Date: Fri Dec 10 09:40:48 2004 Subject: [XML-SIG] Re: dom.minidom getting the text content of a node In-Reply-To: References: <5c11d58804120907212e3480e8@mail.gmail.com> Message-ID: <5c11d58804121000401077fd0c@mail.gmail.com> On Thu, 9 Dec 2004 20:47:41 +0100, Fredrik Lundh wrote: > if you add this to the inner loop, > > print titleNode.childNodes > print titleNode.firstChild.wholeText > > you get this output (under 2.3.3): > > [, ] > Thanks Frederik > > http://sourceforge.net/tracker/?func=detail&atid=105470&aid=549725&group_id=5470 > > this bug report complains that the DOM represents the CDATA section as > four text nodes, which is also perfectly valid (see Martin's explanation). code > that depends on being able to identify a CDATA section in the source file is > broken; character data, character references, entities, and CDATA section > should all be treated as text. that makes sense > btw, here's the corresponding ElementTree version: > > from elementtree import ElementTree > > tree = ElementTree.parse("foo.xml") > > for node in tree.findall(".//blog"): > print node.get("id") > for content_node in node.findall("text"): > print content_node.findtext("blogtitle") > > or, shorter: > > for node in tree.findall(".//blog"): > print node.get("id") > print node.findtext("text/blogtitle") > wow, that looks like a more concise way to do it - thanks i'll take a look at that. FWIW I had some sucess using Sax2 last night:- import sys from xml.dom.ext.reader import Sax2 # create Reader object reader = Sax2.Reader() # parse the document dom1 = reader.fromStream('200406archive010.xml') for node in dom1.getElementsByTagName("blog"): id = node.getAttribute("id") print int(id) for contentNode in node.getElementsByTagName("text"): for titleNode in contentNode.getElementsByTagName("blogtitle"): print titleNode.firstChild.data for titleNode in contentNode.getElementsByTagName("blogbody"): print titleNode.firstChild.data -- Rick Hurst http://hypothecate.co.uk From postmaster at python.org Fri Dec 10 14:31:41 2004 From: postmaster at python.org (Mail Administrator) Date: Fri Dec 10 14:28:41 2004 Subject: [XML-SIG] DELIVERY FAILED Message-ID: <20041210153731.6cf2ad9f4b974f42ab91171e147d6ddf.in@xitimela.cfmnet.co.mz> This message was undeliverable due to the following reason: Your message could not be delivered because the destination computer was not reachable within the allowed queue period. The amount of time a message is queued before it is returned depends on local configura- tion parameters. Most likely there is a network problem that prevented delivery, but it is also possible that the computer is turned off, or does not have a mail system running right now. Your message was not delivered within 6 days: Host 169.83.198.208 is not responding. The following recipients did not receive this message: Please reply to postmaster@python.org if you feel this message to be in error. -------------- next part -------------- A non-text attachment was scrubbed... Name: transcript.zip Type: application/octet-stream Size: 29084 bytes Desc: not available Url : http://mail.python.org/pipermail/xml-sig/attachments/20041210/67b63aa6/transcript-0001.obj From frans.englich at telia.com Fri Dec 10 20:40:03 2004 From: frans.englich at telia.com (Frans Englich) Date: Fri Dec 10 20:32:39 2004 Subject: [XML-SIG] PyXML, 4suite, libxml2... what should I choose? In-Reply-To: <1102284801.27542.29.camel@borgia> References: <200411291934.44488.frans.englich@telia.com> <1102284801.27542.29.camel@borgia> Message-ID: <200412101940.03707.frans.englich@telia.com> On Sunday 05 December 2004 22:13, Uche Ogbuji wrote: > On Mon, 2004-11-29 at 19:34 +0000, Frans Englich wrote: > > I need some guidance for the various XML implementations. Hello Uche, Here's a late reply. I settled for libxml2 because it provides all functionality(I can unfortunately not switch to RNG), and I will have to live with its quirky API. Your reply was very informative, great to have some insight in this spurr of implementations. Cheers, Frans > > Well, at the minimum you'll get argument :-) > > > In my project I use the Python DOM classes for instantiations of my XML > > data, and I need XPath functionality, > > 4Suite has an XPath implementation that is very easy to use and makes > extending XPath with functions implemented in Python very simple. > > http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/basic-xpath > > > WXS validation, > > 4Suite does not support WXS. Advantage libxml2 here. Then again, if > you have a choice in the matter you really should consider using RELAX > NG instead, which is superior to WXS and is supported by 4Suite. > > > and XSLT processing. > > 4Suite's XSLT processor is also easy to use and extend. > > http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/basic-xslt > > > Currently, I pipe out my structures to libxml2/libxslt's xmllint/xsltproc > > for doing validation, and XSLT processing. libxml2 is capable, but the > > solution is ugly, and slow(de-serialization/serialization). In addition, > > I lack XPath functionality. I have no intentions to skip Python's XML > > structures, and use for example libxml2's. > > Out of curiousity, by "Python's XML structures" do you mean minidom? If > so, what motivates this reservation? I should add the disclaimer that > 4Suitee's XPath and XSLT features require Domlette rather than minidom. > Domlette is very similar to minidom (much more so than libxml2's DOM- > like structures). Domlette is also IMO as pythonic as you can get and > still be DOM-like (more Pythonic and you're into the territory of > ElementTree and data bindings such as Anobind, GenerateDS and Gnosis > Objectify). > > > So, my plan is to get XPath somewhere, and perhaps be able to substitute > > libxml2 for something more Pythonic while I'm at it. > > You should at least give 4Suite a try if this is your bottom line. > > > From what I can tell, there is three major packages to keep an eye on: 1) > > standard Python; 2) PyXML; 3) 4suite. Let me see if I got this straight: > > > > * Python have _no_ XPath implementation (right?) > > Right. > > > * PyXML install an XPath implementation(written by fourthought) into > > Python's package xml(xml.xpath). Is it version 1.0? Is it robust and > > stable? > > It's pretty robust and stable. It is based on very old code from > 4Suite's XPath and the latter has been optimized a great deal and has > added a lot of useful features. > > > * PyXML has xml.xslt; not an option since it's not stable/production > > quality, according to the docs -- or what is its status? How much > > "experimental" is it? > > Basing XSLT on plain DOM is a bit tricky, which is why in 4Suite we've > settled on Domlette-only. It will take a lot of work to get Python's > xml.xslt compliant and efficient while still using plain old minidom. > Again, it's based on old code from 4Suite which has been much optimized > and otherwise improved since then. > > > * 4suite has XPath(another implementation written by fourthought..?) and > > robust xslt. > > It's a much newer version of the XSLT in PyXML. > > > * Neither PyXML nor 4suite has a W3C XML Schema stack, so I'll have to > > look elsewhere; one alternative is XSV but it brings in addition a > > dependency on PyLTXML. Looks like continuing to pipe to libxml2's > > xmllint(or link) is still the best alternative. > > I suppose another option is to use Trang to convert WXS to RELAX NG and > then use XVIF or 4Suite. > > > What is the best option(s) for me? With my interest of keeping the > > dependencies down, should I go for PyXML-XPath + PyXML-XSLT _if_ it's > > good enough or libxslt + libxml2-WXS? I could use 4suite's XSLT, but > > since I nevertheless will have a dependency on libxml2/libxslt for WXS I > > can use that(and eat the speed penalty). > > Important is it has a future(maintained..) and is stable/trustable. > > > > What should I go for, and what have I missed? > > > > BTW, is there any plans to merge any XSLT/XPath stack into vanilla > > Python? (when?) It's functionality often needed, AFAICT. > > XPath is a little language, and XSLT a not-so-little one, so I'd expect > they're too much to stuff into core Pylib, even with the "batteries > included" philosophy. Add to that the fact that something a bit richer > than minidom would be needed for the data model (if the implementation > is to be at all efficient) and I'd say it's a stretch. > > > Yes, I'm new on the Python & XML front.. > > Welcome. From disen at geo.unizh.ch Mon Dec 13 17:46:22 2004 From: disen at geo.unizh.ch (Daniel Isenegger) Date: Mon Dec 13 17:48:23 2004 Subject: [XML-SIG] minidom: read value from text node In-Reply-To: <20041203110007.647F01E4018@bag.python.org> References: <20041203110007.647F01E4018@bag.python.org> Message-ID: <41BDC75E.60005@geo.unizh.ch> Hi, i work with the PyXML modul an use minidom to process xml data: In need to get data from text nodes and found an example of functionality in the book O'Reilly-book from C.Jones: Python & XML (S.101) # searches the year and the defoliation value in the instance file and copies the # element defoliation def copyDynamicProperties(self): """copies the dyn properties from a GML3 instance file.""" # looks for elements with the tag defol defolNodelist = self.dom.getElementsByTagName("defol") # iterating over all -eles for node in defolNodelist: # node list defolChildren defolChildren = node.childNodes # reads value cat in instance-file to member var self.cat cat = self.findTextNodes(defolChildren,"cat") print cat #------------------------------------------------------------ # finds the data of the textNode of the elementNode with the # tag theTagName (adapted from Book Python&XML, S.101) def findTextNodes(self,theNodeList,theTagName): #init returnValue for subnode in theNodeList: if subnode.nodeType == subnode.ELEMENT_NODE: if subnode.tagName == theTagName: # call function again to get children self.findTextNodes(subnode.childNodes,theTagName) # elif subnode.nodeType == subnode.TEXT_NODE: print "text-node:", subnode.data return subnode.data Output: text-node: 1 text-node: cat: my Problem is now that the function findTextNodes now is a recursive one, which delivers 2 return -values: the correct value of the text-node and a non-empty string (it looks empty but has 7 spaces ) How can i only get the correct text-value back or how can prevent the string to overwrite the correct value? ( i tried to do this by only to return if subnode.data.isdigit() ist true and othter workarounds, but...(:( ) Thanks Dani From cfbearden at gmail.com Mon Dec 13 18:36:39 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Dec 13 18:36:42 2004 Subject: [XML-SIG] minidom: read value from text node In-Reply-To: <41BDC75E.60005@geo.unizh.ch> References: <20041203110007.647F01E4018@bag.python.org> <41BDC75E.60005@geo.unizh.ch> Message-ID: <433ebc87041213093661e5cd26@mail.gmail.com> > # searches the year and the defoliation value in the instance file and > copies the > # element defoliation > def copyDynamicProperties(self): > """copies the dyn properties from a GML3 instance file.""" > # looks for elements with the tag defol > defolNodelist = self.dom.getElementsByTagName("defol") > # iterating over all -eles > for node in defolNodelist: > # node list defolChildren > defolChildren = node.childNodes > # reads value cat in instance-file to member var self.cat > cat = self.findTextNodes(defolChildren,"cat") > print cat > #------------------------------------------------------------ > # finds the data of the textNode of the elementNode with the > # tag theTagName (adapted from Book Python&XML, S.101) > def findTextNodes(self,theNodeList,theTagName): > #init returnValue > for subnode in theNodeList: > if subnode.nodeType == subnode.ELEMENT_NODE: > if subnode.tagName == theTagName: > # call function again to get children > self.findTextNodes(subnode.childNodes,theTagName) > # > elif subnode.nodeType == subnode.TEXT_NODE: > print "text-node:", subnode.data > return subnode.data My suspicion is that 'cat' is just getting the first whitespace encountered by findTextNodes as it processes the list of child nodes passed to it. Notice that the only return statement in findTextNodes is in the branch that handles child nodes that are text. This means at least two things: (1) when iterating "for subnode in theNodeList", iteration will stop at the first child noted of type TEXT_NODE. No further nodes of any type in theNodeList will be processed; (2) nothing that happens in recursive calls of findTextNodes (under the "if subnode.nodeType == subnode.ELEMENT_NODE:" conditional branch) is ever returned. It can be tricky to mix iteration and recursion in this way. However you resolve this problem, you probably need an accumulator (e.g. a list to which the content of all TEXT_NODEs under defol elements is appended, to be joined and stripped when complete). The accumulator would be passed down the recursion chain as an argument to the recurring function, and it would be returned back up the chain, and eventually assigned to 'cat', where it would be .join()ed and .stripp()ed. Best wishes, Chuck From fdaggs at hsh.org Tue Dec 14 10:10:45 2004 From: fdaggs at hsh.org (fdaggs@hsh.org) Date: Tue Dec 14 11:00:28 2004 Subject: [XML-SIG] {Virus?} Returned mail: see transcript for details Message-ID: <200412140926.iBE9QUn24217@swift.jubilee.org.za> Warning: This message has had one or more attachments removed Warning: (file.zip, file.htm .exe). Warning: Please read the "Jubilee-Attachment-Warning.txt" attachment(s) for more information. The original message was received at Tue, 14 Dec 2004 11:10:45 +0200 from hsh.org [93.49.223.72] ----- The following addresses had permanent fatal errors ----- xml-sig@python.org -------------- next part -------------- This is a message from the MailScanner E-Mail Virus Protection Service ---------------------------------------------------------------------- The original e-mail attachment "file.zip" was believed to be infected by a virus and has been replaced by this warning message. If you wish to receive a copy of the *infected* attachment, please e-mail helpdesk and include the whole of this message in your request. Alternatively, you can call them, with the contents of this message to hand when you call. At Tue Dec 14 12:10:57 2004 the virus scanner said: ClamAV: file.htm .exe contains Worm.Mydoom.M MailScanner: Very long filenames are good signs of attacks against Microsoft e-mail packages (file.htm .exe) Note to Help Desk: Look on the Jubilee MailScanner in /var/spool/MailScanner/quarantine/20041214 (message iBE9QUn24217). -- Postmaster MailScanner thanks transtec Computers for their support From faure at kde.org Tue Dec 14 13:42:42 2004 From: faure at kde.org (David Faure) Date: Tue Dec 14 13:42:50 2004 Subject: [XML-SIG] Request change on http://pyxml.sourceforge.net/topics/xbel/ Message-ID: <200412141342.42920.faure@kde.org> Hello, Can you update the text about konqueror on the above page, to either: David Faure (faure@kde.org) has made XBEL the bookmarks format for Konqueror, the KDE web browser since KDE 2.1. KDE also features a separate application to edit XBEL bookmarks, keditbookmarks. or The Konqueror Web Browser for the KDE desktop has been using XBEL as its native bookmark format since version 2.1. KDE also features a separate application to edit XBEL bookmarks, keditbookmarks. (keeping the links to www.kde.org and www.konqueror.org of course) Thanks. -- David Faure, faure@kde.org, sponsored by Trolltech to work on KDE, Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org). From david.vevar at gmail.com Wed Dec 15 11:05:31 2004 From: david.vevar at gmail.com (David Vevar) Date: Wed Dec 15 11:05:36 2004 Subject: [XML-SIG] XBEL / Konqueror Message-ID: <41C00C6B.9040807@gmail.com> Hi, Since you mention Konqueror on your page (http://pyxml.sourceforge.net/topics/xbel/) I was wondering what was your official position about Konqueror's bookmark format. It's supposed to be XBEL but from what I see there's an icon argument in a bookmark element. Since I can't find it in a dtd I thought that such data should be put into metadata (in info). In your pdf document describing XBEL there's no mention of icons (and how to handle such data) either. Is there an offocial position regarding that? I'd be most grateful for your insight. Best Regards, David From frans.englich at telia.com Wed Dec 15 13:07:19 2004 From: frans.englich at telia.com (Frans Englich) Date: Wed Dec 15 12:59:58 2004 Subject: Fwd: [XML-SIG] XBEL / Konqueror Message-ID: <200412151207.19651.frans.englich@telia.com> I don't think Faure is on xml-sig, forwarding. Frans ---------- Forwarded Message ---------- Subject: [XML-SIG] XBEL / Konqueror Date: Wednesday 15 December 2004 10:05 From: David Vevar To: xml-sig@python.org Hi, Since you mention Konqueror on your page (http://pyxml.sourceforge.net/topics/xbel/) I was wondering what was your official position about Konqueror's bookmark format. It's supposed to be XBEL but from what I see there's an icon argument in a bookmark element. Since I can't find it in a dtd I thought that such data should be put into metadata (in info). In your pdf document describing XBEL there's no mention of icons (and how to handle such data) either. Is there an offocial position regarding that? I'd be most grateful for your insight. Best Regards, David _______________________________________________ XML-SIG maillist - XML-SIG@python.org http://mail.python.org/mailman/listinfo/xml-sig ------------------------------------------------------- From awatters at connotate.com Wed Dec 15 16:36:20 2004 From: awatters at connotate.com (Aaron Watters) Date: Wed Dec 15 16:36:25 2004 Subject: [XML-SIG] xsdb slays sql with xml, constructed flames requested. Message-ID: <7B4C0B5178890D48A2E70BB1EA994764467449@raffertys.connotate.com> Hi guys, Please have a look at my proof of concept data aggregation/publication methodology http://xsdb.sourceforge.net >From an XML perspective it is intended to be more appropriate and simpler to use for common database-style uses than RSS, RDF, XQuery, XPath, and XSLT. I suspect readers of this list will have some thoughts about it (constructive, I hope). Thanks, -- Aaron Watters Ps: I say "proof of concept" but I think the implementation may be usable for non-huge problems. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/xml-sig/attachments/20041215/4d802f72/attachment.htm From noreply at sourceforge.net Wed Dec 15 16:53:32 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Dec 15 16:53:35 2004 Subject: [XML-SIG] [ pyxml-Patches-1085869 ] Boolean values don't serialize properly. Message-ID: Patches item #1085869, was opened at 2004-12-15 15:53 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=1085869&group_id=6473 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Victor T. Ng (vng1) Assigned to: Nobody/Anonymous (nobody) Summary: Boolean values don't serialize properly. Initial Comment: Here's a patch to enable xml.marshal.generic serialization of True/False values. Couldn't figure out how unit tests worked for test_generic, so no tests are included. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=306473&aid=1085869&group_id=6473 From David.Vevar at noviforum.si Wed Dec 15 18:22:45 2004 From: David.Vevar at noviforum.si (David Vevar) Date: Wed Dec 15 18:22:46 2004 Subject: [XML-SIG] XBEL / Call for extension Message-ID: <41C072E5.7020305@noviforum.si> Hello, I contacted you not long ago about an "icon issue" regarding XBEL in general and Konquerer in particular. I also contacted David Faure of KDE who implemented XBEL (well, almost ;-)) for Konquerer bookmarks. After some exchanged messages (having in mind that most of todays browsers tend to be fairly colourful ;-)) we came to a conclusion that it would be a good thing to change (or extend) XBEL a bit. We propose an icon repository at the end of XBEL document in form of an element, something like this base64-encoded data. ... To be more specific, s could point to external locations (web URL's or local-machine repositories) and/or keep icon data inlined as, say, base64-encoded binary (Mozilla(s) already have that), containing images in various formats (jpegs, gifs, pngs), ico files, maybe even something more exotic (in that case we'd also need to put a content-type in there somewhere). Bookmarks could then refer to these icons (through their ids) with some referrer attribute. The point of all this is that having such a format could result in a compact (one XBEL file) bookmark repository. I'd be glad to leave the details of specification to you. What I need to know is whether you'd even consider it, and if so, how soon can we expect the actual specification? I'm looking forward to hearing from you. Best regards, David From dbasch at yahoo.com Wed Dec 15 23:28:56 2004 From: dbasch at yahoo.com (Derek Basch) Date: Wed Dec 15 23:28:59 2004 Subject: [XML-SIG] createProcessingInstruction Message-ID: <20041215222856.13887.qmail@web20821.mail.yahoo.com> Hello, I am having problems with using the xml.dom.minidom.createProcessingInstruction method to create an XSL Style Sheet reference. It places the XSL Style Sheet reference at the end the generated XML instead of the beginning. This breaks the transformation in Firefox v1. Has anyone run into this before? Thanks everyone. The generated XML: The python code: def createReceipt(self): imp= xml.dom.minidom.getDOMImplementation() doctype = imp.createDocumentType("receipt", None, None) doc = imp.createDocument("http://172.20.0.70:81/receipt/", 'receipt', doctype) doc.appendChild(doc.createProcessingInstruction("xml-stylesheet", "type=\"text/xsl\" href=\"http://172.20.0.70:81/evaluator/receipt.xsl\"")) request_receipt_element = doc.documentElement transaction_element = doc.createElement("transaction") request_receipt_element.setAttribute("received", "%s" % (datetime.now(tz=TZ()).isoformat())) request_receipt_element.appendChild(transaction_element) transaction_element.setAttribute("status", self.status_uri) transaction_element.setAttribute( "uri", self.set_directory_uri) return xml.dom.ext.PrettyPrint(doc) __________________________________ Do you Yahoo!? The all-new My Yahoo! - What will yours do? http://my.yahoo.com From and-xml at doxdesk.com Thu Dec 16 01:27:47 2004 From: and-xml at doxdesk.com (Andrew Clover) Date: Thu Dec 16 01:27:23 2004 Subject: [XML-SIG] createProcessingInstruction In-Reply-To: <20041215222856.13887.qmail@web20821.mail.yahoo.com> References: <20041215222856.13887.qmail@web20821.mail.yahoo.com> Message-ID: <41C0D683.1000209@doxdesk.com> Derek Basch wrote: > It places the XSL Style Sheet reference at the end the generated XML > instead of the beginning. > doc = imp.createDocument("http://172.20.0.70:81/receipt/", 'receipt', doctype) > doc.appendChild(doc.createProcessingInstruction(...)) The PI node is appended to the end of the Document node, after the root Element (which is created implicitly by the createDocument method). To put the PI first in the Document's childNodes: pi= doc.createProcessingInstruction(...) doc.insertBefore(pi, doc.documentElement) -- Andrew Clover mailto:and@doxdesk.com http://www.doxdesk.com/ From syslog-ng-admin at lists.balabit.hu Fri Dec 17 12:10:15 2004 From: syslog-ng-admin at lists.balabit.hu (syslog-ng-admin@lists.balabit.hu) Date: Fri Dec 17 12:10:19 2004 Subject: [XML-SIG] Your message to syslog-ng awaits moderator approval Message-ID: <20041217111015.28446.13033.Mailman@www.balabit.hu> Your mail to 'syslog-ng' with the subject Details Is being held until the list moderator can review it for approval. The reason it is being held: Post by non-member to a members-only list Either the message will get posted to the list, or you will receive notification of the moderator's decision. From junkc at fh-trier.de Sat Dec 18 22:40:31 2004 From: junkc at fh-trier.de (Christian Junk) Date: Sat Dec 18 22:40:44 2004 Subject: [XML-SIG] XBEL (dis-)continued? Message-ID: <200412182240.37392.junkc@fh-trier.de> Hi! I'm working on a project for my study of computer science. The project's focus is on bookmarks (and links respectively). I'm very interested in the XBEL format, but it seems that XBEL 1.0 is obsolete? I found a discussion from 2001 at the XML-SIG Archives about XBEL 1.1 and also I found a link to the DTD (http://pyxml.sourceforge.net/topics/dtds/xbel-1.1.dtd), but I think it isn't well-established and there are still some lacks. So, is there anyone out there who still works on XBEL or is willing to restart the work on it? Do you think there actually is a need to extend and/or enhance XBEL 1.0? Regards, Christian From dy3uls at ms-mta-01.texas.rr.com Sun Dec 19 01:30:24 2004 From: dy3uls at ms-mta-01.texas.rr.com (dy3uls@ms-mta-01.texas.rr.com) Date: Sun Dec 19 01:30:33 2004 Subject: [XML-SIG] Returned mail: see transcript for details Message-ID: <20041219003031.70BA51E4012@bag.python.org> The original message was received at Sat, 18 Dec 2004 17:30:24 -0700 from [41.209.212.161] ----- The following addresses had permanent fatal errors ----- ----- Transcript of the session follows ----- ... while talking to 61.123.39.250: >>> DATA <<< 400-aturner; -RMS-E-CRE, ACP file create failed <<< 400-aturner; -SYSTEM-F-EXDISKQUOTA, disk quota exceeded <<< 400 -------------- next part -------------- A non-text attachment was scrubbed... Name: mail.zip Type: application/octet-stream Size: 29092 bytes Desc: not available Url : http://mail.python.org/pipermail/xml-sig/attachments/20041218/fc3f4ac2/mail-0001.obj From martin at v.loewis.de Wed Dec 22 00:37:02 2004 From: martin at v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Wed Dec 22 00:37:00 2004 Subject: [XML-SIG] XBEL (dis-)continued? In-Reply-To: <200412182240.37392.junkc@fh-trier.de> References: <200412182240.37392.junkc@fh-trier.de> Message-ID: <41C8B39E.2040603@v.loewis.de> Christian Junk wrote: > So, is there anyone out there who still works on XBEL or is willing to restart > the work on it? Do you think there actually is a need to extend and/or > enhance XBEL 1.0? I think this list should still work as a discussion place for XBEL. The important point of XBEL is still *exchange*, so I think we should follow a careful process, working towards XBEL 1.2. One such process could be: - collect issues with the current XBEL DTD. - propose modifications for XBEL (*not* calling it XBEL 1.2 at that time) - contact XBEL implementors about such proposed changes, and their opinion about it. I have just added an XBEL tracker at http://sourceforge.net/tracker/?atid=707658&group_id=6473&func=browse where people should collect issues about XBEL they find. Depending on the feedback we get, we can then setup a schedule for releasing new revisions of XBEL. Regards, Martin From uche.ogbuji at fourthought.com Thu Dec 23 00:11:48 2004 From: uche.ogbuji at fourthought.com (Uche Ogbuji) Date: Thu Dec 23 00:11:51 2004 Subject: [XML-SIG] ANN: Amara XML Toolkit 0.9.0 Message-ID: <1103757108.10272.61.camel@borgia> http://uche.ogbuji.net/tech/4Suite/amara Amara XML Toolkit is a collection of Pythonic tools for XML data binding. Not just tools that happen to be written in Python, but tools built from the ground up to use Python idioms and take advantage of the many advantages of Python over other programming languages. Amara builds on 4Suite, but whereas 4Suite focuses more on literal implementation of XML standards in Python, Amara adds a much more Pythonic face to these capabilities. Amara provides tools you can trust to conform with XML standards without losing the familiar Python feel. The components of Amara are: * Bindery: data binding tool (fancy way of saying: a very Pythonic XML API) * Scimitar: implementation of the ISO Schematron schema language for XML; converts Schematron files to Python scripts * domtools: set of tools to augment Python DOMs * saxtools: set of tools to make SAX easier to use in Python There's a lot in Amara, but here are highlights: Amara Bindery: XML as easy as py -------------------------------- Based on the retired project Anobind, but updated to use SAX rather than DOM to create bindings. Bindery reads an XML document and returns a data structure of Python objects corresponding to the vocabulary used in the XML document, for maximum clarity. Bindery turns the document What do you mean "bleh" But I was looking for argument Into a set of objects such that you can write binding.monty.python.spam In order to get the value "eggs" or binding.monty.python[1] In order to get the value "But I was looking for argument". There are other such tools for Python, and what makes Anobind unique is that it's driven by a very declarative rules-based system for binding XML to the Python data. You can register rules that are triggered by XPattern expressions specialized binding behavior. It includes XPath support and is very efficient, using SAX to generate bindings. Scimitar: exceptional schema language for an exceptional programming language ----------------------------------------------------------------------------- Merged in from a separate project, Scimitar is an implementation of ISO Schematron that compiles a Schematron schema into a Python validator script. You typically use scimitar in two phases. Say you have a schematron schema schema1.stron and you want to validate multiple XML files against it, instance1.xml, instance2.xml, instance3.xml. First you run schema1.stron through the scimitar compiler script, scimitar.py: scimitar.py schema1.stron A file, schema1.py is generated and can be used to validate XML instances: python schema1.py instance1.xml Which emits a validation report. Amara DOM Tools: giving DOM a more Pythonic face ------------------------------------------------ DOM came from the Java world, hardly the most Pythonic API possible. Some DOM-like implementations such as 4Suite's Domlettes mix in some Pythonic idiom. Amara DOM Tools goes even further. Amara DOM Tools features pushdom, similar to xml.dom.pulldom, but easier to use. It also includes Python generators-based tools for DOM processing. And a function to return an XPath location for any DOM node. Amara SAX Tools: SAX without the brain explosion ------------------------------------------------ Tenorsax (amara.saxtools.tenorsax) is a framework for "linerarizing" SAX logic so that it flows more naturally, and needs a lot less state machine wizardry. License ------- Amara is open source, provided under the 4Suite variant of the Apache license. See the file COPYING for details. Installation ------------ Amara requires Python 2.3 or more recent and 4Suite 1.0a3 or more recent. Make sure these are installed, unpack Amara to a convenient location and run python setup.py install -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Use CSS to display XML - http://www.ibm.com/developerworks/edu/x-dw-x-xmlcss-i.html Full XML Indexes with Gnosis - http://www.xml.com/pub/a/2004/12/08/py-xml.html Be humble, not imperial (in design) - http://www.adtmag.com/article.asp?id=10286 UBL 1.0 - http://www-106.ibm.com/developerworks/xml/library/x-think28.html Use Universal Feed Parser to tame RSS - http://www.ibm.com/developerworks/xml/library/x-tipufp.html Default and error handling in XSLT lookup tables - http://www.ibm.com/developerworks/xml/library/x-tiplook.html A survey of XML standards - http://www-106.ibm.com/developerworks/xml/library/x-stand4/ The State of Python-XML in 2004 - http://www.xml.com/pub/a/2004/10/13/py-xml.html From uche.ogbuji at fourthought.com Thu Dec 30 19:38:48 2004 From: uche.ogbuji at fourthought.com (Uche Ogbuji) Date: Thu Dec 30 19:38:53 2004 Subject: [XML-SIG] ANN: Amara XML Toolkit 0.9.1 Message-ID: <1104431928.16585.54.camel@borgia> http://uche.ogbuji.net/tech/4Suite/amara ftp://ftp.4suite.org/pub/Amara/ [1] Amara XML Toolkit is a collection of Python tools for XML processing-- not just tools that happen to be written in Python, but tools built from the ground up to use Python idioms and take advantage of the many advantages of Python. Amara builds on 4Suite [http://4Suite.org], but whereas 4Suite focuses more on literal implementation of XML standards in Python, Amara focuses on Pythonic idiom. It provides tools you can trust to conform with XML standards without losing the familiar Python feel. The components of Amara are: * Bindery: data binding tool (fancy way of saying: a very Pythonic XML API) * Scimitar: implementation of the ISO Schematron schema language for XML; converts Schematron files to Python scripts * domtools: set of tools to augment Python DOMs * saxtools: set of tools to make SAX easier to use in Python There's a lot in Amara, but here are highlights: Amara Bindery: XML as easy as py -------------------------------- Based on the retired project Anobind, but updated to use SAX rather than DOM to create bindings. Bindery reads an XML document and returns a data structure of Python objects corresponding to the vocabulary used in the XML document, for maximum clarity. Bindery turns the document What do you mean "bleh" But I was looking for argument Into a set of objects such that you can write binding.monty.python.spam In order to get the value "eggs" or binding.monty.python[1] In order to get the value "But I was looking for argument". There are other such tools for Python, and what makes Anobind unique is that it's driven by a very declarative rules-based system for binding XML to the Python data. You can register rules that are triggered by XPattern expressions specialized binding behavior. It includes XPath support and supports mutation. Bindery is very efficient, using SAX to generate bindings. Scimitar: exceptional schema language for an exceptional programming language ----------------------------------------------------------------------------- Merged in from a separate project, Scimitar is an implementation of ISO Schematron that compiles a Schematron schema into a Python validator script. You typically use scimitar in two phases. Say you have a schematron schema schema1.stron and you want to validate multiple XML files against it, instance1.xml, instance2.xml, instance3.xml. First you run schema1.stron through the scimitar compiler script, scimitar.py: scimitar.py schema1.stron A file, schema1.py is generated and can be used to validate XML instances: python schema1.py instance1.xml Which emits a validation report. Amara DOM Tools: giving DOM a more Pythonic face ------------------------------------------------ DOM came from the Java world, hardly the most Pythonic API possible. Some DOM-like implementations such as 4Suite's Domlettes mix in some Pythonic idiom. Amara DOM Tools goes even further. Amara DOM Tools feature pushdom, similar to xml.dom.pulldom, but easier to use. It also includes Python generator-based tools for DOM processing, and a function to return an XPath location for any DOM node. Amara SAX Tools: SAX without the brain explosion ------------------------------------------------ Tenorsax (amara.saxtools.tenorsax) is a framework for "linerarizing" SAX logic so that it flows more naturally, and needs a lot less state machine wizardry. License ------- Amara is open source, provided under the 4Suite variant of the Apache license. See the file COPYING for details. Installation ------------ Amara requires Python 2.3 or more recent and 4Suite 1.0a3 or more recent. Make sure these are installed, unpack Amara to a convenient location and run python setup.py install [1] We have some problem reports with certain Web browsers and the ftp.4suite.org firewall. Please try an alternate FTP client if you have problems, and kindly bear with us while we sort this out. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Use CSS to display XML - http://www.ibm.com/developerworks/edu/x-dw-x-xmlcss-i.html Full XML Indexes with Gnosis - http://www.xml.com/pub/a/2004/12/08/py-xml.html Be humble, not imperial (in design) - http://www.adtmag.com/article.asp?id=10286 UBL 1.0 - http://www-106.ibm.com/developerworks/xml/library/x-think28.html Use Universal Feed Parser to tame RSS - http://www.ibm.com/developerworks/xml/library/x-tipufp.html Default and error handling in XSLT lookup tables - http://www.ibm.com/developerworks/xml/library/x-tiplook.html A survey of XML standards - http://www-106.ibm.com/developerworks/xml/library/x-stand4/ The State of Python-XML in 2004 - http://www.xml.com/pub/a/2004/10/13/py-xml.html From Uche.Ogbuji at fourthought.com Thu Dec 30 19:48:36 2004 From: Uche.Ogbuji at fourthought.com (Uche Ogbuji) Date: Thu Dec 30 19:48:39 2004 Subject: [XML-SIG] Amara XML Toolkit 0.9.1 changes Message-ID: <1104432516.16585.71.camel@borgia> Forgot the changes in the original announcement: * Fixed embarrassing misinterpretation of sax.handler.feature_namespace_prefixes Now Namespace prefixes work fine with or without PyXML installed * Add saxtools.namespace_mixin utility class * Clean up bindery.document_base name attributes * Add bindery.element_base.xml_remove_child and .xml_index_on_parent-- methods for easier removal of children * tenorsax was useless due to accidental late mangling before 0.9.0 release. Fixed. * Use tenorsax fully in Scimitar. Scimitar is now a complete ISO schematron implementation in about 500 lines of Python code (including the skeletons for code generation) http://lists.fourthought.com/pipermail/4suite/2004-December/013143.html -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Use CSS to display XML - http://www.ibm.com/developerworks/edu/x-dw-x-xmlcss-i.html Full XML Indexes with Gnosis - http://www.xml.com/pub/a/2004/12/08/py-xml.html Be humble, not imperial (in design) - http://www.adtmag.com/article.asp?id=10286 UBL 1.0 - http://www-106.ibm.com/developerworks/xml/library/x-think28.html Use Universal Feed Parser to tame RSS - http://www.ibm.com/developerworks/xml/library/x-tipufp.html Default and error handling in XSLT lookup tables - http://www.ibm.com/developerworks/xml/library/x-tiplook.html A survey of XML standards - http://www-106.ibm.com/developerworks/xml/library/x-stand4/ The State of Python-XML in 2004 - http://www.xml.com/pub/a/2004/10/13/py-xml.html From narve at machina.no Fri Dec 31 01:31:38 2004 From: narve at machina.no (Narve Saetre) Date: Fri Dec 31 01:27:57 2004 Subject: [XML-SIG] XBEL xslt stylesheet Message-ID: <41D49DEA.7020806@machina.no> There seem to be an invalid URL (another web page gone dead) on the XBEL page: >Joris Graaumans (joris@cs.uu.nl) has developed a couple of XSLT stylesheets for XBEL . In my hunt for a better XBEL stylesheet I discovered a superior one (nice, recursive, graphic, icons, fast, cross-browser): http://cgi29.plala.or.jp/mozzarel/xbel/ so I suggest the web master changes the URL to this one (and hope that one stays for a while). Btw, I found it while looking at the superior Firefox extension "Bookmarks Synchronizer" (http://cgi29.plala.or.jp/mozzarel/) - crappy web page but an excellent extension! Regards, -- Narve S?tre Partner / Machina Networks as / +47 41915331 -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.298 / Virus Database: 265.6.6 - Release Date: 28.12.2004