Home » Developer & Programmer » JDeveloper, Java & XML » writeToFile error in xml parser for pl/sql ( oracle xdk),urgent help
writeToFile error in xml parser for pl/sql ( oracle xdk),urgent help [message #91581] Fri, 29 November 2002 07:43 Go to next message
Bharadwaj
Messages: 1
Registered: November 2002
Junior Member
The problem description in our environment:-

A xmldom package in the oracle 8.1.7 is trying to create an xml file from a DOMdocument. We are creating this DOMdocument by using an xmlparser. The input to the xmlparser is a file on the unix space.We are able to read the values ,display them. The error happens when the writeToFile method is used to update the xml file after changing the node values in the dom document. The environment seems to be okay or is there any problem with it.

To check our logic, a sample code from the web page http://www.akadia.com/services/ora_gen_xml.html was run.It gave the same error description(ORA-20000).It had also used the same function and the error occured at the same line number.The code from the web page reads as:-

"
DECLARE
doc sys.xmldom.DOMDocument;
main_node sys.xmldom.DOMNode;
root_node sys.xmldom.DOMNode;
user_node sys.xmldom.DOMNode;
item_node sys.xmldom.DOMNode;
root_elmt sys.xmldom.DOMElement;
item_elmt sys.xmldom.DOMElement;
item_text sys.xmldom.DOMText;
CURSOR get_users(p_deptno NUMBER) IS
SELECT empno
, ename
, deptno
, rownum
FROM emp
WHERE deptno = p_deptno;

BEGIN
doc := sys.xmldom.newDOMDocument;
main_node := sys.xmldom.makeNode(doc);
root_elmt := sys.xmldom.createElement(
doc
, 'EMPSET'
);
root_node := sys.xmldom.appendChild(
main_node
, sys.xmldom.makeNode(root_elmt)
);
FOR get_users_rec IN get_users(10) LOOP
item_elmt := sys.xmldom.createElement(
doc
, 'EMP'
);
sys.xmldom.setAttribute(
item_elmt
, 'num'
, get_users_rec.rownum
);
user_node := sys.xmldom.appendChild(
root_node
, sys.xmldom.makeNode(item_elmt)
);
item_elmt := sys.xmldom.createElement(
doc
, 'EMP_NO'
);
item_node := sys.xmldom.appendChild(
user_node
, sys.xmldom.makeNode(item_elmt)
);
item_text := sys.xmldom.createTextNode(
doc
, get_users_rec.empno
);
item_node := sys.xmldom.appendChild(
item_node
, sys.xmldom.makeNode(item_text)
);

END LOOP;
sys.xmldom.writeToFile(doc , '/user/tempdocSample.xml');
sys.xmldom.freeDocument(doc);
END;
/"
The table emp was created with values in it.

Oracle error code:-

ORA-20000: An internal error has occurred: Permission denied
ORA-06512: at "SYS.XMLDOM", line 37
ORA-06512: at "SYS.XMLDOM", line 1784
ORA-06512: at line 61

The priveleges that were required for the above code were:-

GRANT javauserpriv to scott;
GRANT javasyspriv to scott;
GRANT EXECUTE ON xmldom TO scott;

These were also existing for our code and database user.NO clue is there about any possible environmental setting errors.

This code was trying to do the same job that we did but created a document object and not used an existing document object(from a parsing operation).Please advice about possible solutions.It is urgent.

Regards
gopal
Re: writeToFile error in xml parser for pl/sql ( oracle xdk),urgent help [message #91590 is a reply to message #91581] Mon, 02 December 2002 06:31 Go to previous message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
i beleieve, the filenaming (filename preceded by forward slash '  'is the reason.
did ya check your emails?

----------------------------------------------------------------------

END LOOP;
sys.xmldom.writeToFile(doc , [b]'/user/tempdocSample.xml')[/b];
sys.xmldom.freeDocument(doc);
END;
/"

Previous Topic: Re: sample test questions for OCP exams IZO-501/502/504/505
Next Topic: Re: Procedure that has OUT parameter as vArray giving error :ORA-06531: Reference to uninitialized
Goto Forum:
  


Current Time: Fri Apr 19 03:56:01 CDT 2024