[Zope] using DOM from within Zope

Andreas Jung lists at andreas-jung.com
Wed May 25 15:20:06 EDT 2005



--On Mittwoch, 25. Mai 2005 21:16 Uhr +0200 karl.eklund at amnesty.se wrote:

> Maybe this is the wrong way or something, but how can I use
> xml.dom.minidom (or other module in its entirety) from within Zope? I've
> tried various stuff in the "MyScriptModules" Product. This same approach
> seems to work with the "re" module.
>
> Example:
>
> Products/MyScriptModules/__init__.py:
>
> from Products.PythonScripts.Utility import allow_module
> ...
> allow_module("xml")
> allow_module("xml.dom")
> allow_module("xml.dom.minidom")
>
> Python Script "inside" Zope:
>
> import xml.dom.minidom
> xmlstring="<a><b>texttextext</b><c>hejhejhej</c></a>"
> domtree=xml.dom.minidom.parseString(xmlstring)
> return domtree.toxml()
>

This is a FAQ: use external method or write a Zope product or look at 
TrustedExecutables
by Dieter Maurer.

-aj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope/attachments/20050525/06860366/attachment.bin


More information about the Zope mailing list