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!

How to register multiple xsd with relative include references?

Matze1969Nov 28 2013 — edited Nov 29 2013

Hi there,

unfortunately I'm a newbie to XDB and maybe this is a basic question. But I didn't get it solved right now (also Google wasn't my friend helping me out)...

I try to register a set of xsd to XML DB (11g Release 2 11.2.0.1.0) with the given structure:

Folder 'demo' contains:

mainmodel.xsd

types.xsd

Subfolder 'demo/details' contains:

submodel_a.xsd with <xs:include schemaLocation="../types.xsd"/>

submodel_b.xsd with <xs:include schemaLocation="submodel_a.xsd"/>

First I created the folders 'demo' and 'demo/details' in the XML DB repository using dbms_xdb.CreateFolder.

Then I added the xsd as resources to the XML DB, e.g.

declare

      v_result boolean;

      v_schema xmltype := xmltype(bfilename('DEMO', 'types.xsd'), nls_charset_id('ISO-8859-1'));

    begin

      v_result := dbms_xdb.CreateResource('/demo/types.xsd', v_schema);

    end;

   /      

Then I registered my types.xsd:

begin

DBMS_XMLSCHEMA.REGISTERSCHEMA(

        schemaurl => 'types.xsd',

        schemadoc => BFILENAME ('DEMO','types.xsd'),

        csid => 0

        );

        end;

        /

When trying to register submodel_a.xsd the same way I get the following error:

ORA-31000: Ressource '../types.xsd' is not an XDB schema document.

How can I resolve this?

Best regards

Matthias

This post has been answered by odie_63 on Nov 28 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 27 2013
Added on Nov 28 2013
6 comments
3,569 views