Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> DBMS_XMLPARSER and external DTD
Hello,
I am using Oracle 9.2.0.3 on HPUX 11i. I want to use DBMS_XMLPARSER to process XML documents stored in a table as CLOBs. In the documents theres a DOCTYPE tag <!DOCTYPE myDocType SYSTEM "DTD/myDTD.dtd">. The following code returns :
ORA-31001: Invalid resource handle or path name "/DTD/myDTD.dtd" ORA-06512: at "XDB.DBMS_XMLDOM", line 3840 ORA-06512: at "XDB.DBMS_XMLDOM", line 3883
My utl_file_dir parameter is set to '*'
The error comes form the call : aNodeList := DBMS_XMLDOM.getElementsByTagName(aDoc, 'myDocType') ; The same code using the XDK works fine just replacing DBMS_XMLPARSER with XMLPARSER, DBMS_XMLDOM with XMLDOM... but is slow I also tried to remove the DOCTYPE tag and it works fine and fast.
Do you have any idea of what I could do to make the DTD regognized.
Thanks a lot
David
DECLARE
aParser DBMS_XMLPARSER.PARSER ;
aDoc DBMS_XMLDOM.DOMDOCUMENT ;
aNodeList DBMS_XMLDOM.DOMNodeList ;
aNode DBMS_XMLDOM.DOMNode ;
aNodeAttr DBMS_XMLDOM.DOMNode ;
aNodeAttrList DBMS_XMLDOM.DOMNamedNodeMap ;
CURSOR C_test IS
SELECT payload FROM TEST ;
DBMS_XMLPARSER.parseClob(aParser, R_test.payload) ; aDoc := DBMS_XMLPARSER.getDocument(aParser) ; aNodeList := DBMS_XMLDOM.getElementsByTagName(aDoc, 'myDocType') ; IF DBMS_XMLDOM.isNull(aDoc) THEN DBMS_OUTPUT.PUT_LINE('Doc IS NULL') ; ELSE FOR idx IN 0..(DBMS_XMLDOM.getLength(aNodeList)-1) LOOP aNode := DBMS_XMLDOM.item(aNodeList, idx) ; dbms_output.put_line(DBMS_xmldom.getNodeName(aNode)) ; dbms_output.put_line(DBMS_xmldom.getNodeValue(aNode)) ; aNodeAttrList := DBMS_XMLDOM.getAttributes(aNode) ; FOR idx1 IN 0..(DBMS_XMLDOM.getLength(aNodeAttrList)-1) LOOP aNodeAttr := DBMS_XMLDOM.item(aNodeAttrList, idx1) ; dbms_output.put_line(DBMS_xmldom.getNodeName(aNodeAttr) || ' = '||DBMS_xmldom.getNodeValue (aNodeAttr)) ; END LOOP ; END LOOP ; END IF ;
![]() |
![]() |