From Christof.Hoeke at e-7.com Thu Jan 3 10:24:57 2008 From: Christof.Hoeke at e-7.com (=?iso-8859-1?Q?=22H=F6ke=2C_Christof=22?=) Date: Thu, 3 Jan 2008 10:24:57 +0100 Subject: [XML-SIG] XSLT 2 and XQuery in (C)Python? Message-ID: <57254BE3C7FAD845A0E402A369B0D0DD992E8E@gt1mail1.gt.e-7.local> Hi, is there any hope of an XSLT 2 / XPath 2 possibility in Python? None of the tools I used until now (4suite, Pyana, lxml/etree/libxml) have XSLT 2 support and seem not to get one soon either? I used Saxon's XSLT 2 with Jython which is great and suspect Saxon.NET runs with IronPython (have not tried that though). Is there maybe a way to access Saxon from CPython? On a similar question, is there any XQuery libs for Python? Thanks a lot Christof From stefan_ml at behnel.de Thu Jan 3 12:42:22 2008 From: stefan_ml at behnel.de (Stefan Behnel) Date: Thu, 03 Jan 2008 12:42:22 +0100 Subject: [XML-SIG] XSLT 2 and XQuery in (C)Python? In-Reply-To: <57254BE3C7FAD845A0E402A369B0D0DD992E8E@gt1mail1.gt.e-7.local> References: <57254BE3C7FAD845A0E402A369B0D0DD992E8E@gt1mail1.gt.e-7.local> Message-ID: <477CCA1E.9040403@behnel.de> Hi, I don't know of any Python integrated implementations, but... H?ke, Christof wrote: > I used Saxon's XSLT 2 with Jython which is great and suspect Saxon.NET runs > with IronPython (have not tried that though). Is there maybe a way to > access Saxon from CPython? you can call Saxon (which also supports XQuery) through its command line interface (subprocess module). At least the binary distribution of Saxon also compiles nicely with gcj, in case you do not want a JVM around when you run it. This worked for me: gcj -o saxon $CFLAGS --main=net.sf.saxon.Transform saxon9.jar Obviously, if you want a better interface (such as stdin/stdout transformation), you can write it in Java and compile it together with the jar. A C-level interface to a gcj compiled Saxon would be cool (as they did with Lucene). That way, you could get a pretty low-level (SAX2?) interface into lxml... Stefan From stefan_ml at behnel.de Mon Jan 7 10:15:27 2008 From: stefan_ml at behnel.de (Stefan Behnel) Date: Mon, 07 Jan 2008 10:15:27 +0100 Subject: [XML-SIG] XSLT 2 and XQuery in (C)Python? In-Reply-To: <57254BE3C7FAD845A0E402A369B0D0DD992E8E@gt1mail1.gt.e-7.local> References: <57254BE3C7FAD845A0E402A369B0D0DD992E8E@gt1mail1.gt.e-7.local> Message-ID: <4781EDAF.1010604@behnel.de> Hi, H?ke, Christof wrote: > is there any hope of an XSLT 2 / XPath 2 possibility in Python? None of the > tools I used until now (4suite, Pyana, lxml/etree/libxml) have XSLT 2 > support and seem not to get one soon either? > > I used Saxon's XSLT 2 with Jython which is great and suspect Saxon.NET runs > with IronPython (have not tried that though). Is there maybe a way to > access Saxon from CPython? > > On a similar question, is there any XQuery libs for Python? You can look through the (pretty long) list of the W3C XQuery group: http://www.w3.org/XML/Query/#implementations Some of the implementations seem to have Python bindings, and some might be usable as XPath2/XSLT2 processors. Stefan From stefan_ml at behnel.de Mon Jan 7 10:22:40 2008 From: stefan_ml at behnel.de (Stefan Behnel) Date: Mon, 07 Jan 2008 10:22:40 +0100 Subject: [XML-SIG] XSLT 2 and XQuery in (C)Python? In-Reply-To: <57254BE3C7FAD845A0E402A369B0D0DD992E8E@gt1mail1.gt.e-7.local> References: <57254BE3C7FAD845A0E402A369B0D0DD992E8E@gt1mail1.gt.e-7.local> Message-ID: <4781EF60.2030408@behnel.de> H?ke, Christof wrote: > On a similar question, is there any XQuery libs for Python? One thing that looks pretty cool is Qexo. The web page says it's a partial implementation, so I don't know how usable it is, but it compiles XQuery to Java bytecode, which you can then compile into an executable using gcj. So that would get you a C-compiled statement that you could execute from Python. http://www.gnu.org/software/qexo/ Stefan From info at thegrantinstitute.com Wed Jan 16 23:37:01 2008 From: info at thegrantinstitute.com (Anthony Jones) Date: 16 Jan 2008 14:37:01 -0800 Subject: [XML-SIG] Professional Grant Proposal Writing Workshop (March 2008: Los Angeles, California) Message-ID: <20080116143701.F3A575D12DA08046@thegrantinstitute.com> An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/xml-sig/attachments/20080116/a478ed98/attachment.htm From goodz158 at yahoo.com Sun Jan 27 13:31:24 2008 From: goodz158 at yahoo.com (Good Z) Date: Sun, 27 Jan 2008 04:31:24 -0800 (PST) Subject: [XML-SIG] Converting XML Schema to data struture and then to XML Message-ID: <227274.30811.qm@web35906.mail.mud.yahoo.com> Hello, I need to write an application to convert XML schema (.xsd) to a data structure then using this data structure and the data from some other files, generate an XML file. I have seen generateDS and pyfo library that can be combined to write this application but my problem is that i somehow do not like DOM and would like to write this in ElementTree. I wonder if anyone can point me how to write this quickly in ElementTree or someone has already done this effort. Regards, Mike. ____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/xml-sig/attachments/20080127/2e3ad112/attachment.htm From strangest at comcast.net Sun Jan 27 15:17:56 2008 From: strangest at comcast.net (Gloria) Date: Sun, 27 Jan 2008 09:17:56 -0500 Subject: [XML-SIG] Converting XML Schema to data struture and then to XML In-Reply-To: <227274.30811.qm@web35906.mail.mud.yahoo.com> References: <227274.30811.qm@web35906.mail.mud.yahoo.com> Message-ID: <479C9294.9040402@comcast.net> Check out BeauitfulSoup and BeautifulStoneSoup. Well written modules, no W3C compliance, but still very useful. ~G~ > Hello, > I need to write an application to convert XML schema (.xsd) to a data > structure then using this data structure and the data from some other > files, generate an XML file. > > I have seen generateDS and pyfo library that can be combined to write > this application but my problem is that i somehow do not like DOM and > would like to write this in ElementTree. I wonder if anyone can point > me how to write this quickly in ElementTree or someone has already > done this effort. > > Regards, > Mike. > > ------------------------------------------------------------------------ > Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try > it now. > > > ------------------------------------------------------------------------ > > _______________________________________________ > XML-SIG maillist - XML-SIG at python.org > http://mail.python.org/mailman/listinfo/xml-sig > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/xml-sig/attachments/20080127/9de90e68/attachment.htm From stefan_ml at behnel.de Sun Jan 27 15:54:36 2008 From: stefan_ml at behnel.de (Stefan Behnel) Date: Sun, 27 Jan 2008 15:54:36 +0100 Subject: [XML-SIG] Converting XML Schema to data struture and then to XML In-Reply-To: <227274.30811.qm@web35906.mail.mud.yahoo.com> References: <227274.30811.qm@web35906.mail.mud.yahoo.com> Message-ID: <479C9B2C.8010305@behnel.de> Good Z wrote: > I need to write an application to convert XML schema (.xsd) to a data > structure then using this data structure and the data from some other > files, generate an XML file. > > I have seen generateDS and pyfo library that can be combined to write this > application but my problem is that i somehow do not like DOM and would like > to write this in ElementTree. I wonder if anyone can point me how to write > this quickly in ElementTree or someone has already done this effort. In case you can do without the schema, lxml.objectify might be worth a look: http://codespeak.net/lxml/dev/objectify.html Stefan From goodz158 at yahoo.com Mon Jan 28 05:28:37 2008 From: goodz158 at yahoo.com (Good Z) Date: Sun, 27 Jan 2008 20:28:37 -0800 (PST) Subject: [XML-SIG] Converting XML Schema to data struture and then to XML Message-ID: <549349.15527.qm@web35908.mail.mud.yahoo.com> Thanks Stefan, But my primary requirement is converting XML Schema. Mike ----- Original Message ---- From: Stefan Behnel To: Good Z Cc: xml-sig at python.org Sent: Sunday, January 27, 2008 8:24:36 PM Subject: Re: [XML-SIG] Converting XML Schema to data struture and then to XML Good Z wrote: > I need to write an application to convert XML schema (.xsd) to a data > structure then using this data structure and the data from some other > files, generate an XML file. > > I have seen generateDS and pyfo library that can be combined to write this > application but my problem is that i somehow do not like DOM and would like > to write this in ElementTree. I wonder if anyone can point me how to write > this quickly in ElementTree or someone has already done this effort. In case you can do without the schema, lxml.objectify might be worth a look: http://codespeak.net/lxml/dev/objectify.html Stefan ____________________________________________________________________________________ Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/xml-sig/attachments/20080127/33fbfd0a/attachment.htm From stefan_ml at behnel.de Mon Jan 28 10:20:20 2008 From: stefan_ml at behnel.de (Stefan Behnel) Date: Mon, 28 Jan 2008 10:20:20 +0100 Subject: [XML-SIG] Converting XML Schema to data struture and then to XML In-Reply-To: <549349.15527.qm@web35908.mail.mud.yahoo.com> References: <549349.15527.qm@web35908.mail.mud.yahoo.com> Message-ID: <479D9E54.8080703@behnel.de> Hi, Good Z wrote: >>> I need to write an application to convert XML schema (.xsd) to a data >>> structure then using this data structure and the data from some other >>> files, generate an XML file. >>> >>> I have seen generateDS and pyfo library that can be combined to write >> this >>> application but my problem is that i somehow do not like DOM and >> would like >>> to write this in ElementTree. I wonder if anyone can point me how to >>> write >>> this quickly in ElementTree or someone has already done this effort. > > In case you can do without the schema, lxml.objectify might be worth a > look: > > http://codespeak.net/lxml/dev/objectify.html > > Thanks Stefan, > > But my primary requirement is converting XML Schema. Sure, no problem. But may I ask what the reasoning behind this requirement is? I mean, code generation isn't really a value by itself. Stefan From karl.norby at gmail.com Mon Jan 28 10:47:08 2008 From: karl.norby at gmail.com (Karl Norby) Date: Mon, 28 Jan 2008 03:47:08 -0600 Subject: [XML-SIG] Converting XML Schema to data struture and then to XML In-Reply-To: <227274.30811.qm@web35906.mail.mud.yahoo.com> References: <227274.30811.qm@web35906.mail.mud.yahoo.com> Message-ID: You could also try pyXSD (pyxsd.org) as a starting point. It does much of what you describe. -Karl 2008/1/27 Good Z : > > Hello, > I need to write an application to convert XML schema (.xsd) to a data > structure then using this data structure and the data from some other files, > generate an XML file. > > I have seen generateDS and pyfo library that can be combined to write this > application but my problem is that i somehow do not like DOM and would like > to write this in ElementTree. I wonder if anyone can point me how to write > this quickly in ElementTree or someone has already done this effort. > > Regards, > Mike. > > ________________________________ > Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it > now. > _______________________________________________ > XML-SIG maillist - XML-SIG at python.org > http://mail.python.org/mailman/listinfo/xml-sig > > From stefan_ml at behnel.de Mon Jan 28 11:28:04 2008 From: stefan_ml at behnel.de (Stefan Behnel) Date: Mon, 28 Jan 2008 11:28:04 +0100 Subject: [XML-SIG] Converting XML Schema to data struture and then to XML In-Reply-To: <479D9E54.8080703@behnel.de> References: <549349.15527.qm@web35908.mail.mud.yahoo.com> <479D9E54.8080703@behnel.de> Message-ID: <479DAE34.20700@behnel.de> Hi, Stefan Behnel wrote: > Good Z wrote: >>>> I need to write an application to convert XML schema (.xsd) to a data >>>> structure then using this data structure and the data from some other >>>> files, generate an XML file. >>>> >>>> I have seen generateDS and pyfo library that can be combined to write >>> this >>>> application but my problem is that i somehow do not like DOM and >>> would like >>>> to write this in ElementTree. I wonder if anyone can point me how to >>>> write >>>> this quickly in ElementTree or someone has already done this effort. >> In case you can do without the schema, lxml.objectify might be worth a >> look: >> >> http://codespeak.net/lxml/dev/objectify.html >> >> Thanks Stefan, >> >> But my primary requirement is converting XML Schema. > > Sure, no problem. But may I ask what the reasoning behind this requirement is? > I mean, code generation isn't really a value by itself. Just in case you're interested (and since similar topics have come up a couple of times on lxml's mailing list), I added a doc section on parse-time schema validation in lxml 2.0 here: http://codespeak.net/svn/lxml/trunk/doc/objectify.txt Look out for section 2, "Asserting a Schema". It's not yet included in the online docs at http://codespeak.net/lxml/dev/objectify.html but it will appear there by the end of the week. Stefan From goodz158 at yahoo.com Mon Jan 28 11:34:55 2008 From: goodz158 at yahoo.com (Good Z) Date: Mon, 28 Jan 2008 02:34:55 -0800 (PST) Subject: [XML-SIG] Converting XML Schema to data struture and then to XML Message-ID: <116467.61512.qm@web35906.mail.mud.yahoo.com> Ok. My requirement is as follows: We have a third party PDF form with following input and output supplied by the vendor and used as below: Input:Raw data that needs to be filled in ADOBE form through keyboard. Output: Once the form is filled, the form has a buttons to generate XML file for the data and save it on harddisk. There are many thousand users of this form and based on the input different xml are generated. They have also provided us schema so that we can generate XML and verify the XML against that. Our software is accepting input from the web and thus has all data. We would like to generate the XML tree structure using schema and then use the data values entered by the user and then generate XML file. Regards, Mike. ----- Original Message ---- From: Stefan Behnel To: Good Z Cc: xml-sig at python.org Sent: Monday, January 28, 2008 2:50:20 PM Subject: Re: [XML-SIG] Converting XML Schema to data struture and then to XML Hi, Good Z wrote: >>> I need to write an application to convert XML schema (.xsd) to a data >>> structure then using this data structure and the data from some other >>> files, generate an XML file. >>> >>> I have seen generateDS and pyfo library that can be combined to write >> this >>> application but my problem is that i somehow do not like DOM and >> would like >>> to write this in ElementTree. I wonder if anyone can point me how to >>> write >>> this quickly in ElementTree or someone has already done this effort. > > In case you can do without the schema, lxml.objectify might be worth a > look: > > http://codespeak.net/lxml/dev/objectify.html > > Thanks Stefan, > > But my primary requirement is converting XML Schema. Sure, no problem. But may I ask what the reasoning behind this requirement is? I mean, code generation isn't really a value by itself. Stefan ____________________________________________________________________________________ Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/xml-sig/attachments/20080128/3b1d8f79/attachment-0001.htm From stefan_ml at behnel.de Mon Jan 28 12:03:13 2008 From: stefan_ml at behnel.de (Stefan Behnel) Date: Mon, 28 Jan 2008 12:03:13 +0100 Subject: [XML-SIG] Converting XML Schema to data struture and then to XML In-Reply-To: <116467.61512.qm@web35906.mail.mud.yahoo.com> References: <116467.61512.qm@web35906.mail.mud.yahoo.com> Message-ID: <479DB671.8000608@behnel.de> Hi, Good Z wrote: > Ok. My requirement is as follows: We have a third party PDF form with > following input and output supplied by the vendor and used as below: > Input:Raw data that needs to be filled in ADOBE form through keyboard. > Output: Once the form is filled, the form has a buttons to generate XML > file for the data and save it on harddisk. > > There are many thousand users of this form and based on the input different > xml are generated. They have also provided us schema so that we can > generate XML and verify the XML against that. > > Our software is accepting input from the web and thus has all data. We > would like to generate the XML tree structure using schema and then use the > data values entered by the user and then generate XML file. Ok, so you're generating an XML tree in memory, filling in data, and validating on the way out. Maybe this is of interest then: http://codespeak.net/lxml/dev/objectify.html#tree-generation-with-the-e-factory Note that lxml does support XML Schema *validation*, it just doesn't care about the schema while you are working on the tree, and it does not generate Python code from it. It's dynamic, not static. BTW, from the POV of objectify, generating Python classes from a schema would basically mean infering a document instance from an XML Schema (sort of a meta-model to model transformation). I find that an interesting relation, but maybe that's just me... Stefan From info at thegrantinstitute.com Wed Jan 30 00:00:41 2008 From: info at thegrantinstitute.com (Anthony Jones) Date: 29 Jan 2008 15:00:41 -0800 Subject: [XML-SIG] Professional Grant Proposal Writing Workshop (May 2008: Ottawa, Ontario) Message-ID: <20080129150040.C5DBC64F149A2179@thegrantinstitute.com> An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/xml-sig/attachments/20080129/504071a8/attachment.htm From info at thegrantinstitute.com Thu Jan 31 10:30:10 2008 From: info at thegrantinstitute.com (Anthony Jones) Date: 31 Jan 2008 01:30:10 -0800 Subject: [XML-SIG] Professional Grant Proposal Writing Workshop (March 2008: Los Angeles, California) Message-ID: <20080131013010.03A667D760331B42@thegrantinstitute.com> An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/xml-sig/attachments/20080131/191d3716/attachment.htm From michael at elyt.com Thu Jan 10 07:58:35 2008 From: michael at elyt.com (Michael Dunstan) Date: Thu, 10 Jan 2008 06:58:35 -0000 Subject: [XML-SIG] PyXML on PyPI Message-ID: <99b561f50801092233g1572c981v7e0f0c0751f3497e@mail.gmail.com> Hi, It would be useful to have a copy of source tar ball for PyXML 0.8.4 uploaded to PyPI. Then it can be easy_installed or used in zc.buildout. There is an existing entry for PyXML on PyPI which has the owners "loewis, aaronsw, jkloth". Can one of these owners upload PyXML-0.8.4.tar.gz to PyPI? (Or alternatively add myself, dunny, as an owner for that project and I could have a go at doing the upload.) Thanks! -- Michael Dunstan