Parsing DTD with Oracle XML Parser [message #134168] |
Tue, 23 August 2005 14:28 |
mpinvitesu
Messages: 15 Registered: July 2005
|
Junior Member |
|
|
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
|
|
|