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!

complexType restriction problem

mh379860lyJun 15 2011 — edited Jul 20 2011
HI Gentlemen,

I have a schema, ehd_root.xsd from which many different schemas are derived, mainly by restriction. Here is a complex type, ehd_body_typ, which only has a placeholder element.
<xs:complexType name="ehd_body_typ">
		<xs:choice minOccurs="0" maxOccurs="unbounded">
			*<xs:any processContents="skip" minOccurs="0" maxOccurs="unbounded"/>*
		</xs:choice>
	</xs:complexType>
Now there is another schema, go_root.xsd with a complex type go_body_typ as
<xs:complexType name="go_body_typ">
		<xs:complexContent>
			<xs:restriction base="ehd_body_typ">
				<xs:sequence>
					*<xs:element ref="go:gnr_liste" maxOccurs="unbounded"/>*
				</xs:sequence>
			</xs:restriction>
		</xs:complexContent>
	</xs:complexType>
Clearly, the <any> element should be substituted by the contents of go_body_typ. The problem is that Oracle does not support complex_type inheritance by restriction. "Because inheritance support in SQL does not support a notion of restriction, the SQL type corresponding to the restricted complexType is a empty subtype of the parent object type" (taken from Oracle® XML DB Developer's Guide, chapter 8 XML Schema Storage and Query: Advanced). This means that <any> will be taken from the supertype as varchar2(4000) which is extremely short for me. I badly need object-relational storage, so I can not rely on CLOBs which would be a solution.

Well, if I copy the core element
*<xs:element ref="go:gnr_liste" maxOccurs="unbounded"/>*
from go_root.xsd into ehd_root.xsd it works fine, but what if another complex type, krw_body_type would like to restrict the original ehd_body_type? The two subtypes are quite different: I can not bind the supertype to just one single subtype. I must preserve its generality.

Can anyone give me an idea?

Thanks, kind regards:

Miklos HERBOLY

Edited by: mh**** on Jun 15, 2011 10:51 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 17 2011
Added on Jun 15 2011
14 comments
240 views