[Zope] how to read xml file in a python script

vupt vupt vuptme at hotmail.com
Wed Nov 5 11:20:52 EST 2003


Hi Andreas,

Thanks for replying to me.

I checked out the python documentation and I followed up
with this good hands on article about parsing XML in Python
(http://www.devarticles.com/art/1/383/3)

In the article, they mention one way to parse xml using
the sax parser by importing this module:
from xml.sax import make_parser

and using this command:
parser.parse(open('playerStats.xml'))

But when I try to do this in my zope python script, I get
Error Value: import of "xml.sax" is unauthorized

Also I read that the open command is not allowed in zope.

And so I am afraid I am still stick with my original problem:
I have an xml document under zope and I would like to parse it and extract
its content with a python script. I would like to do this under the context 
of
zope.

I know there is lots of documentation on how to use xml under python.
But how do I use read xml under zope? Is it different?


Thanks again for any input

pvu


>From: Andreas Jung <lists at andreas-jung.com>
>Reply-To: Andreas Jung <lists at andreas-jung.com>
>To: vupt vupt <vuptme at hotmail.com>, zope at zope.org
>Subject: Re: [Zope] how to read xml file in a python script
>Date: Wed, 05 Nov 2003 14:32:19 +0100
>
>Read the Python Library Reference. THere is enough documentation on 
>Python+XML.
>
>-aj
>
>--On Mittwoch, 5. November 2003 13:26 Uhr +0000 vupt vupt 
><vuptme at hotmail.com> wrote:
>
>>Hi,
>>
>>I am new to Zope and hope someone can help me with an
>>xml task.
>>
>>I have created an Xml file using the XMLKit product.
>>Now I would like to create a python script to parse
>>the XML file to get information from it. How do I do
>>this?
>>
>>If someone can point me to some examples or give some
>>examples of how to do this, I would very appreciate
>>it.
>>
>>thanks in advance.
>>
>>pvu
>>
>>_________________________________________________________________
>>The new MSN 8: smart spam protection and 2 months FREE*
>>http://join.msn.com/?page=features/junkmail
>>http://join.msn.com/?page=dept/bcomm&pgmarket=en-ca&RU=http%3a%2f%2fjoin.
>>msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca
>>
>>
>>_______________________________________________
>>Zope maillist  -  Zope at zope.org
>>http://mail.zope.org/mailman/listinfo/zope
>>**   No cross posts or HTML encoding!  **
>>(Related lists -  http://mail.zope.org/mailman/listinfo/zope-announce
>>  http://mail.zope.org/mailman/listinfo/zope-dev )
>
>
>
>

_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=dept/features&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca




More information about the Zope mailing list