Registering a schema refers to another by xs:include
452247Sep 1 2006 — edited Sep 1 2006Hi all,
I think I'm missing something pretty fundamental. I've got an xsd for a file type defined by the government that spans across about 15 xsd files. They refer to one another using lines like:
<xs:include schemaLocation="AssessSubjectsType2006.xsd"/>
I've written some PL/SQL that goes through each file registering them using DBMS_XMLSchema.registerSchema (they are all in order so any dependency should already by registered before it's needed). The script runs fine on the files that don't refer to any other files, but falls over as soon as it tries with a file that includes another.
For example: When processing the file "AssessTypes2006.xsd" which has an include to "AssessSubjectsType2006.xsd" I get the following error:
ORA-31000: Resource 'AssessSubjectsType2006.xsd' is not an XDB schema document.
A quick "SELECT schema_url, user_xml_schemas.LOCAL, QUAL_SCHEMA_URL FROM user_xml_schemas" shows that the schema has been registered.
Is this because the include is using a relative location instead of an absolute? Does XML DB struggle with includes or should I be able to just register the root document and it picks up all the dependences and include them automatically?
Thanks in advance,
Tim Williams.
P.S. This is on XE.
Edited to add database version.