1

Topic: How it is possible to connect 2 xsd to the help import?

Good afternoon.
I have 2 xsd - one the main, the second contains imported types.
The main xsd:

<xs:schema
xmlns:xdb = "http://xmlns.oracle.com/xdb"
xmlns:xs = "http://www.w3.org/2001/XMLSchema"
xmlns:cmn = "http://NamespaceTest.com/CommonTypes.xsd"
xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance">
<xs:import namespace = "http://NamespaceTest.com/CommonTypes.xsd" schemaLocation = "CommonTypes.xsd"/>
<xs:element name = "DOCUMENT" type = "DOCUMENTType"/>
<xs:complexType name = "DOCUMENTType" xdb:SQLType = "Doc_1_Type">
<xs:sequence>
<xs:element name = "HEADER" type = "cmn:HEADERType" minOccurs = "1" maxOccurs = "1"/>
<xs:element name = "BODY" type = "xs:string" minOccurs = "1" maxOccurs = "1"/>
<xs:element name = "FOOTER" type = "xs:string" minOccurs = "1" maxOccurs = "1"/>
</xs:sequence>
</xs:complexType>
</xs:schema>

Imported xsd:
[Spoiler]

<xs:schema xmlns:xs = "http://www.w3.org/2001/XMLSchema"
xmlns:xdb = "http://xmlns.oracle.com/xdb"
targetNamespace = "http://NamespaceTest.com/CommonTypes.xsd"
xmlns = "http://NamespaceTest.com/CommonTypes.xsd">
<xs:element name = "HEADER" type = "HEADERType"/>
<xs:complexType name = "HEADERType" xdb:SQLType = "HEADER_T">
<xs:sequence>
<xs:element name = "DOC_ID" type = "DOC_IDType" minOccurs = "0" xdb:SQLType = "NUMBER"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name = "DOC_IDType">
<xs:restriction base = "xs:int">
<xs:totalDigits value = "18"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>

The checked document:

<? xml version = "1.0" encoding = "windows-1251"?>
<DOCUMENT>
<HEADER>
<DOC_ID> 14 </DOC_ID>
</HEADER>
<BODY> str4 </BODY>
<FOOTER> str2 </FOOTER>
</DOCUMENT>

In such format the document is correctly checked in some API, for example Liquid Studio. However Orakl does not suit such format. At  there is an error:

ORA-31043: Element ' DOCUMENT ' not globally defined in schema ' CommonTypes.xsd'

The problem dares adding in a root tag of the checked document of parameters:

xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation = "Doc227.xsd"

However a hitch that there is no possibility to change format XML of documents. And me, from the point of view of logic, not clearly, what for to specify specific xsd in parameters xml if it explicitly becomes at function invocation  from pl/sql.
On this a question - as it is possible to implement usage of imported types in xsd without changing a format xml the document and whether it is possible basically?
Thanks for attention.