Hi.

I'm using oracle9i XML DB, and want to register one xml instance
but facing the problem.

Steps to register the instance are:
1. connect (% sqlplus "sys@*** as sysdba")
2. register a schema
3. create a table (associated to the registerd schema)
4. insert the instance

The problem occurs while registering the schema (step2).
SQL code I'm using is the following.

===============================
set pagesize 100
set serveroutput on
set long 10000
SET ECHO ON

spool exec.log

drop user testcase7 cascade;

create user testcase7 identified by testcase7
default tablespace users temporary tablespace temp;

grant connect, resource, create session, create library to testcase7;
grant create any directory to testcase7;
grant query rewrite to testcase7;

connect testcase7/testcase7;

-- Create the xmldir load directory; this is the directory where the xml
-- files are residing.
-- operating system user oracle must have acces to this new directory
prompt Create directory
create or replace directory XMLDIR1 as '/home/TEST';

create or replace function getDocumentXml(filename varchar2) return clob
authid current_user is
xbfile bfile;
xclob clob;
dest_offset INTEGER := 1;
src_offset INTEGER := 1;
src_csid NUMBER := NLS_CHARSET_ID('US7ASCII');
lang_context INTEGER := dbms_lob.default_lang_ctx;
warning INTEGER;
begin
xbfile := bfilename('XMLDIR1',filename);
dbms_lob.open(xbfile); -----------------------------------(**1)
dbms_lob.createtemporary(xclob,TRUE,dbms_lob.sessi on);
dbms_lob.loadclobfromfile(xclob, xbfile, dbms_lob.getlength(xbfile)
,dest_offset ,src_offset, src_csid, lang_context, warning);
dbms_lob.close(xbfile);
return xclob;
end;
/

BEGIN
dbms_xmlschema.registerSchema(
schemaURL => 'xml.xsd',
schemaDoc => getDocumentXml('xml.xsd'),
genTables => true,
local => true);
END;
/
===============================

Error message says:

--------------------------------------------------------
ORA-22288: Failed FILEOPEN handling of the file or LOB
(* actually, this message is in Japanese. It's my translation anyway)

?w?H?H?p?X?????H??H?????B
(* here is greeking)

ORA-06512: "SYS.DBMS_LOB", s672
ORA-06512: "TESTCASE7.GETDOCUMENTXML", s12
ORA-06512: s2
--------------------------------------------------------

I guess a failed point is [dbms_lob.open(xbfile); (**1)] in the
function getDocumentXml, but I cannot find it is why.

Does anyone have any suggestions? Anything will be helpful.

Regards.