Use xml.dom.minidom in Submission script

Hello,

I’d like to use ‘xml.dom.minidom.parse’ function from a submission script.
My problem is when I run the script I have an ImportException.
"No module named pyexpat (IronPython.Runtime.Exceptions.ImportException)

Does anyone have a tip to fix that ?
Very simple code sample :

import xml.dom.minidom

def main():
configPath = GetRootDirectory() + “\config.xml”
configDocument = xml.dom.minidom.parse(configPath)

Thanks

Deadline’s IronPython engine (the default) doesn’t support native cPython modules, which I’m guessing xml.dom.minidom is. If you are using Deadline 5.1 or later, you should be able to use the Python.NET engine instead though and see if that works. To tell Deadline to use the Python.NET engine, you just need to make the following the first line in the script:

#Python.NET

So your example script would look like this:

#Python.NET

import xml.dom.minidom

def __main__():
    configPath = GetRootDirectory() + "\\config.xml"
    configDocument = xml.dom.minidom.parse(configPath)

Give that a try and let us know if it helps.

Cheers,

  • Ryan

Yes you guess right!
Thank you