[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

XML-XSD Processing/Creation.

xkenneth

1/2/2008 5:19:00 PM

Hi All,

So i'm working with the WITSML standard, which is a pretty
massive standard defined in XML for the transfer of oilfield data.
There are a ton of XSD files for defining and checking all data in the
WITSML format. I'd like to be able to easily create XML based on the
types defined by the WITSML XSD files. Is there any way to create a
basic XML object based on an XSD file and then populate it with data.
Can i create python classes based off the XSD files? What else can I
do with the XSD files? I'm looking for a really simplistic way to work
with WITSML in python.

Regards,
Kenneth Miller

Thanks a ton!
4 Answers

Jeroen Ruigrok van der Werven

1/2/2008 5:48:00 PM

0

-On [20080102 18:21], xkenneth (xkenneth@gmail.com) wrote:
> So i'm working with the WITSML standard, which is a pretty
>massive standard defined in XML for the transfer of oilfield data.

I cannot answer (yet) the question of generating XML data from an XSD. But for
writing out XML files I like to use either ElementTree or lxml. Very easy and
straightforward use of XML from Python in my opinion.

--
Jeroen Ruigrok van der Werven <asmodai(-at-)in-nomine.org> / asmodai
ã?¤ã?§ã?«ã?¼ã?³ ã?©ã?¦ã??ã?­ã??ã?¯ ã?´ã?¡ã?³ ã??ã?« ã?¦ã?§ã?«ã?´ã?§ã?³
http://www.in-n... | http://www.ra...
Once sent from the Golden Hall...

Paul Kölle

1/2/2008 9:03:00 PM

0

xkenneth schrieb:
> Hi All,
>
> So i'm working with the WITSML standard, which is a pretty
> massive standard defined in XML for the transfer of oilfield data.
> There are a ton of XSD files for defining and checking all data in the
> WITSML format. I'd like to be able to easily create XML based on the
> types defined by the WITSML XSD files. Is there any way to create a
> basic XML object based on an XSD file and then populate it with data.
> Can i create python classes based off the XSD files? What else can I
> do with the XSD files?
This might be worth looking at: http://www.rexx.com/~dkuhlman/#...

cheers
Paul

Stefan Behnel

1/3/2008 7:55:00 AM

0

paul wrote:
>> Can i create python classes based off the XSD files? What else can I
>> do with the XSD files?
> This might be worth looking at: http://www.rexx.com/~dkuhlman/#...

If it's really such a complex XML language, the tool above might or might not
be of any help, as it doesn't support the whole XSD standard (and XML Schema
is very complex). It's worth a try, but don't expect too much.

The lxml way of dealing with XML languages is namespace implementation:

http://codespeak.net/lxml/dev/element_classe...

However, there isn't currently a way to automatically bootstrap an
implementation, especially not in XSD, so it depends on the language how much
work it will be to get this to a usable state.

Stefan

xkenneth

1/3/2008 10:50:00 PM

0

On Jan 3, 1:55 am, Stefan Behnel <stefan.behnel-n05...@web.de> wrote:
> paul wrote:
> >> Can i create python classes based off the XSD files? What else can I
> >> do with the XSD files?
> > This might be worth looking at:http://www.rexx.com/~dkuhlman/#...
>
> If it's really such a complex XML language, the tool above might or might not
> be of any help, as it doesn't support the whole XSD standard (and XML Schema
> is very complex). It's worth a try, but don't expect too much.
>
> The lxml way of dealing with XML languages is namespace implementation:
>
> http://codespeak.net/lxml/dev/element_classe...
>
> However, there isn't currently a way to automatically bootstrap an
> implementation, especially not in XSD, so it depends on the language how much
> work it will be to get this to a usable state.
>
> Stefan

Just a bump in an attempt to get some more help.