Kenneth Miller | 12 May 23:17

Looking for general insight.

All,

     Any opinions on my problem would be greatly appreciated.

    I've got a large pre-defined XML schema, tons of data types etc. I  
want to be able to create python objects from the schemas and traffic  
these objects in and out of some sort of a database. Could I perhaps  
create these objects using lxml and extend lxml to use zope persistence?

Regards,
Kenneth Miller
John Lovell | 12 May 23:54

Re: Looking for general insight.

Kenneth:

What you ask is not easy.  However, I can point you at a few things that
might be helpful.

First a clarification.  When you say, "create python objects from the
schemas and traffic these objects in and out of some sort of a database"
do you mean python classes or lxml trees filled with random data (or
something else)?

For python classes from XML schemas check out:
http://www.rexx.com/~dkuhlman/generateDS.html

For lxml trees filled with random data check out:
http://messagesleuth.svn.sourceforge.net/viewvc/messagesleuth/trunk/xsd2
data.py?revision=6&view=markup
Note:  For this you will need to pay attention to the other
MessageSleuth libraries it uses.
Note:  Realize that this supports a subset of XML Schema operators.
Note:  While I am proud of most of this code (and it consistently meets
my needs) I believe randstr.py can generate invalid strings under
certain conditions.

Good luck,

John W. Lovell
Web Applications Engineer
Northwest Educational Service District
1601 R Avenue
Anacortes, WA 98221
(Continue reading)


Gmane