Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Parsing DTD with Oracle XML Parser

447414Aug 23 2005 — edited Aug 26 2005
I am parsing a DTD with the following code to validate an input XML with it using the following code.

----------------------------
DECLARE

dtd_doc xmldom.DOMDocumentType;
par xmlparser.parser;

BEGIN

par := xmlparser.newParser;
xmlparser.parseDTD(par,'/home/usr1/request.dtd' , 'request');
dtd_doc := xmlparser.getDocType(par);

xmlparser.setValidationMode(par, TRUE);
xmlparser.setDoctype(par,dtd_doc);
xmlparser.showWarnings(par, TRUE);
xmlparser.parse(par, '/home/usr1/in.xml');
xmlparser.freeParser(par);

END;
/
----------------------------

The DTD in.dtd references an external entity as follows
-----------------------------
<!ENTITY % ControlRef SYSTEM "ControlBaseref.dtd">
%ControlRef
-----------------------------

The DTD ControlBaseref also exists in the same location as the initial DTD(request.dtd). While I parse it I am encountering an error

DECLARE
*
ERROR at line 1:
ORA-20100: Error occurred while parsing: No such file or directory
ORA-06512: at "XMLDBA9205.XMLPARSER", line 22
ORA-06512: at "XMLDBA9205.XMLPARSER", line 115
ORA-06512: at line 9

[When i copy and paste the contents of ControlBaseref.dtd to request.dtd and ran the same program, I am not getting any error. It went thro fine ]

The possible error I could associate with it is "it is unable to locate the secondary DTD - ControlBaseref.dtd it is referring to". Can anyone tell me how to let the parser know where to search for secondary DTD it is referring to. I tried setbasedir and setbaseurl, but it's not working. Have anyone tried a similar kind or any one has a different idea on why the above error might be

Thanks in advance,
Prakash
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 23 2005
Added on Aug 23 2005
1 comment
1,387 views