Hi all
As we are modeling using sparx and generating XML Schemas (.xsd) files its generating the element first and then complex type element
but as we required to registered this schema in oracle xmldb (generated by spax) its giving us errors because oracle is accepting compelx type should be defined first and then child as element as W3C Standards.
so how can we generate XML Schemas as per Standard using Sparx?
here is the example of code generating from sparx
<xs:schema xmlns:xs="
http://www.w3.org/2001/XMLSchema" xmlns:xdb="
http://xmlns.oracle.com/xdb">
<xs:element name="FC_CarrierOfCharacteristics" type="FC_CarrierOfCharacteristics"/>
<xs:complexType name="FC_CarrierOfCharacteristics" abstract="true">
<xs:annotation>
<xs:documentation>Abstract class for local feature properties and bound global properties of a feature type</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="constrainedBy" type="FC_Constraint" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
declare
doc varchar2(32000) := '';
begin
dbms_xmlschema.registerSchema('
http://www.oracle.com/PO_ROOT4.xsd', doc);
end;
here is the following code suppose to be
<xs:schema xmlns:xs="
http://www.w3.org/2001/XMLSchema" xmlns:xdb="
http://xmlns.oracle.com/xdb">
<xs:complexType name="FC_CarrierOfCharacteristics" xdb:SQLType="FC_COC">
<xs:annotation>
<xs:documentation>Abstract class for local feature properties and bound global properties of a feature type</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="constrainedBy" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:element name="FC_CarrierOfCharacteristics">
<xs:complexType>
<xs:sequence>
<xs:element name="FC_CarrierOfCharacteristics" type="FC_CarrierOfCharacteristics"/>
</xs:sequence>
</xs:complexType>
declare
doc varchar2(32000) := '';
begin
dbms_xmlschema.registerSchema('
http://www.oracle.com/PO_ROOT2.xsd', doc);
end;
please kindly guide us how can we generate XML Schemas (.xsd) files