If you search the STAF forums you'll see that this question has been 
answered before several times (see 
http://sourceforge.net/forum/message.php?msg_id=4292971).  You can also do 
a google search on Jython and minidom then you'll see why this fails in 
Jython (as this is not a question specific to STAF/STAX).  There was a 
problem in the minidom package provided with Jython 2.1.

As an alternative, you can use the XML Parser provided with Java to parse 
XML from within a STAX job instead.  See section "2.6.7 How can I parse an 
XML file from a STAX job?" in the STAF FAQ at 
http://staf.sourceforge.net/current/STAFFAQ.htm#d0e961 for an example of 
how to do this.

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   [EMAIL PROTECTED]
(512) 838-8347 or Tieline 678-8347




"Ahmed Mostafa" <[EMAIL PROTECTED]> 
Sent by: [EMAIL PROTECTED]
05/20/2008 05:33 AM

To
STAF <staf-users@lists.sourceforge.net>
cc

Subject
[staf-users] [STAX] Python XML parsing error






In a script element of a STAX job, when I try to open an XML document 
using the xml.dom.minidom module, I get the following error:
===== Python Error Information =====
com.ibm.staf.service.stax.STAXPythonEvaluationException:
Traceback (innermost last):    File "<pyExec string>", line 5, in ?
File 
"C:\STAF\data\STAF\lang\java\shared_jython\2.1-staf-v3\Lib\xml\dom\minidom.py", 
line 908, in parse
File 
"C:\STAF\data\STAF\lang\java\shared_jython\2.1-staf-v3\Lib\xml\dom\minidom.py", 
line 900, in _doparse
File 
"C:\STAF\data\STAF\lang\java\shared_jython\2.1-staf-v3\Lib\xml\dom\pulldom.py", 
line 251, in getEvent
AttributeError: feed

Here is the Python code of the XML file loading:
from xml.dom import minidom
doc = minidom.parse( R'C:\xmlfile.xml' )

The XML file is well-formatted, and I parsed normally using Python alone 
(from Python 2.1 IDLE)

Any ideas?
-- 
Ahmed Mostafa
0123919750
[EMAIL PROTECTED]
Software Developer
IBM Egypt, Cairo Technology Development Center 
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to