Skip to Main Content

Database Software

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!

Schema namespace conflicts

419818Apr 23 2004 — edited Apr 23 2004
Hi,

I am interested in registering two schemas. These schemas have overlapping namespaces - for example: http://www.my.com/name and http://www.my.com/name/subname

Using username scott in the database, for the first of these schemas, Oracle places a file in the repository at http://localhost:8080/sys/schemas/SCOTT/www.my.com/name
In order to register the second, it needs to create the file http://localhost:8080/sys/schemas/SCOTT/www.my.com/name/subname
However, it can't do this, as the first registration created "name" as a file. It can't now be a directory. The error I receive is ORA-31002: Path name /sys/schemas/SCOTT/www.my.com/name/subname is not a container

While it would be nice simply to avoid the situation by choosing namespaces, there are some very large and well established standards whose schemas use exactly this type of naming scheme. So, it would appear to me that I can't use these standard schemas with Oracle XDB.

However, I am not an Oracle guru by any means. Perhaps (hopefully) I've made a simple error, or there's an easy workaround. I'd appreciate your comments. I've appended the test files I used to duplicate this problem.

Best,
Killian.

schema1.xsd

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema
targetNamespace="http://www.my.com/foo/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xdb="http://xmlns.oracle.com/xdb"
elementFormDefault="qualified"
xdb:storeVarrayAsTable="true">

<xsd:element name="foo" type="xsd:string" xdb:defaultTable="foo">
</xsd:element>

</xsd:schema>

schema2.xsd

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema
targetNamespace="http://www.my.com/name/subname"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xdb="http://xmlns.oracle.com/xdb"
elementFormDefault="qualified"
xdb:storeVarrayAsTable="true">

<xsd:element name="bar" type="xsd:string" xdb:defaultTable="bar">
</xsd:element>

</xsd:schema>

registerSchema.sql:

begin
--
-- Register schema1.xsd - namespace is http://www.my.com/name
dbms_xmlschema.registerSchema
(
'http://www.my.com/name',
xdbURIType('/home/SCOTT/schema1.xsd').getClob(),
TRUE,TRUE,FALSE,TRUE
);
--
-- Register schema2.xsd - namespace is http://www.my.com/name/subname
dbms_xmlschema.registerSchema
(
'http://www.my.com/name/subname',
xdbURIType('/home/SCOTT/schema2.xsd').getClob(),
TRUE,TRUE,FALSE,TRUE
);
end;
/

deleteSchema.sql:

begin
--
-- Delete schema1
dbms_xmlschema.deleteSchema
(
'http://www.my.com/name',
dbms_xmlschema.DELETE_CASCADE_FORCE
);
--
-- Delete schema2
dbms_xmlschema.deleteSchema
(
'http://www.my.com/name/subname',
dbms_xmlschema.DELETE_CASCADE_FORCE
);
end;




Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 21 2004
Added on Apr 23 2004
1 comment
245 views