title: XML validation against an XSD fails in Oracle but it gets validated in XMLSpy
body: <p>XSD is registered in oracle. Using XMLTYPE.schemavalidate to validate an XML against the registered XSD. The API gives an error as "LSX-00295: field element "item" is not a simple type". But the same XML file with the same XSD gets validated fine in Altova XMLSpy.
  Somehow oracle is giving the complex type error.</p>
  
  <p>Anonymous script is as below:</p>
  
  <pre><code>declare
  lxml  XMLTYPE;
  l_err varchar2(4000);
  l_transformxml CLOB:='&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;tdvpf:products numproducts="2" xsi:schemaLocation="http://www.techdata.com/vpf VendorPriceFileTemplate_Volume.xsd" xmlns:tdvpf="http://www.techdata.com/vpf" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
      &lt;product&gt;
          &lt;base&gt;
              &lt;distributorsku numitems="1"&gt;
                  &lt;item index="2"&gt;a&lt;/item&gt;
              &lt;/distributorsku&gt;
              &lt;vendor numitems="1"&gt;
                  &lt;item index="2"&gt;a&lt;/item&gt;
              &lt;/vendor&gt;
              &lt;vendorpartnumber numitems="1"&gt;
                  &lt;item index="2"&gt;a&lt;/item&gt;
              &lt;/vendorpartnumber&gt;
              &lt;endusertype numitems="1"&gt;
                  &lt;item index="2"&gt;Government&lt;/item&gt;
              &lt;/endusertype&gt;
              &lt;endusersubtype numitems="1"&gt;
                  &lt;item index="2"&gt;a&lt;/item&gt;
              &lt;/endusersubtype&gt;
              &lt;vendorproductgroup numitems="1"&gt;
                  &lt;item index="2"&gt;a&lt;/item&gt;
              &lt;/vendorproductgroup&gt;
              &lt;productname numitems="1"&gt;
                  &lt;item index="2"&gt;a&lt;/item&gt;
              &lt;/productname&gt;
              &lt;productdescription numitems="1"&gt;
                  &lt;item index="2"&gt;a&lt;/item&gt;
              &lt;/productdescription&gt;
              &lt;cost numitems="1"&gt;
                  &lt;item index="2"&gt;0.0&lt;/item&gt;
              &lt;/cost&gt;
              &lt;msrp numitems="1"&gt;
                  &lt;item index="2"&gt;0.0&lt;/item&gt;
              &lt;/msrp&gt;
              &lt;operatingsystem numitems="1"&gt;
                  &lt;item index="2"&gt;Linux&lt;/item&gt;
              &lt;/operatingsystem&gt;
              &lt;operatingsystemversion numitems="1"&gt;
                  &lt;item index="2"&gt;a&lt;/item&gt;
              &lt;/operatingsystemversion&gt;
              &lt;platform numitems="1"&gt;
                  &lt;item index="2"&gt;64 bit&lt;/item&gt;
              &lt;/platform&gt;
              &lt;version numitems="1"&gt;
                  &lt;item index="2"&gt;a&lt;/item&gt;
              &lt;/version&gt;
              &lt;edition numitems="1"&gt;
                  &lt;item index="2"&gt;a&lt;/item&gt;
              &lt;/edition&gt;
              &lt;licensetype numitems="1"&gt;
                  &lt;item index="2"&gt;a&lt;/item&gt;
              &lt;/licensetype&gt;
              &lt;licenseduration numitems="1"&gt;
                  &lt;item index="2"&gt;a&lt;/item&gt;
              &lt;/licenseduration&gt;
              &lt;packagetype numitems="1"&gt;
                  &lt;item index="2"&gt;Full package product&lt;/item&gt;
              &lt;/packagetype&gt;
              &lt;mediatype numitems="1"&gt;
                  &lt;item index="2"&gt;a&lt;/item&gt;
              &lt;/mediatype&gt;
              &lt;maintenancesupporttype numitems="1"&gt;
                  &lt;item index="2"&gt;a&lt;/item&gt;
              &lt;/maintenancesupporttype&gt;
              &lt;maintenancesupportduration numitems="1"&gt;
                  &lt;item index="2"&gt;a&lt;/item&gt;
              &lt;/maintenancesupportduration&gt;
              &lt;licenseprogram numitems="1"&gt;
                  &lt;item index="2"&gt;a&lt;/item&gt;
              &lt;/licenseprogram&gt;
              &lt;language numitems="1"&gt;
                  &lt;item index="2"&gt;a&lt;/item&gt;
              &lt;/language&gt;
              &lt;productclass numitems="1"&gt;
                  &lt;item index="2"&gt;Applications&lt;/item&gt;
              &lt;/productclass&gt;
              &lt;mediapartnumber numitems="1"&gt;
                  &lt;item index="2"&gt;a&lt;/item&gt;
              &lt;/mediapartnumber&gt;
              &lt;requireditems numitems="1"&gt;
                  &lt;item index="2"&gt;a&lt;/item&gt;
              &lt;/requireditems&gt;
              &lt;seats-qty numitems="1"&gt;
                  &lt;item index="2"&gt;a&lt;/item&gt;
              &lt;/seats-qty&gt;
              &lt;users-qty numitems="1"&gt;
                  &lt;item index="2"&gt;a&lt;/item&gt;
              &lt;/users-qty&gt;
              &lt;appliances-qty numitems="1"&gt;
                  &lt;item index="2"&gt;a&lt;/item&gt;
              &lt;/appliances-qty&gt;
              &lt;devices-qty numitems="1"&gt;
                  &lt;item index="2"&gt;a&lt;/item&gt;
              &lt;/devices-qty&gt;
              &lt;migrations-qty numitems="1"&gt;
                  &lt;item index="2"&gt;a&lt;/item&gt;
              &lt;/migrations-qty&gt;
              &lt;mailboxes-qty numitems="1"&gt;
                  &lt;item index="2"&gt;a&lt;/item&gt;
              &lt;/mailboxes-qty&gt;
              &lt;gigabytes-qty numitems="1"&gt;
                  &lt;item index="2"&gt;a&lt;/item&gt;
              &lt;/gigabytes-qty&gt;
              &lt;servers-qty numitems="1"&gt;
                  &lt;item index="2"&gt;a&lt;/item&gt;
              &lt;/servers-qty&gt;
              &lt;workstations-qty numitems="1"&gt;
                  &lt;item index="2"&gt;a&lt;/item&gt;
              &lt;/workstations-qty&gt;
              &lt;licenses-qty numitems="1"&gt;
                  &lt;item index="2"&gt;a&lt;/item&gt;
              &lt;/licenses-qty&gt;
              &lt;processors-qty numitems="1"&gt;
                  &lt;item index="2"&gt;a&lt;/item&gt;
              &lt;/processors-qty&gt;
              &lt;domains-qty numitems="1"&gt;
                  &lt;item index="2"&gt;a&lt;/item&gt;
              &lt;/domains-qty&gt;
              &lt;nodes-qty numitems="1"&gt;
                  &lt;item index="2"&gt;a&lt;/item&gt;
              &lt;/nodes-qty&gt;
          &lt;/base&gt;
          &lt;licenseprogram&gt;
              &lt;points numitems="1"&gt;
                  &lt;item index="2"&gt;0.0&lt;/item&gt;
              &lt;/points&gt;
              &lt;minquantity numitems="1"&gt;
                  &lt;item index="2"&gt;0.0&lt;/item&gt;
              &lt;/minquantity&gt;
              &lt;maxquantity numitems="1"&gt;
                  &lt;item index="2"&gt;0.0&lt;/item&gt;
              &lt;/maxquantity&gt;
              &lt;volumelevel numitems="1"&gt;
                  &lt;item index="2"&gt;a&lt;/item&gt;
              &lt;/volumelevel&gt;
              &lt;groupmethod numitems="1"&gt;
                  &lt;item index="2"&gt;ProgramPool&lt;/item&gt;
              &lt;/groupmethod&gt;
          &lt;/licenseprogram&gt;
      &lt;/product&gt;
  &lt;/tdvpf:products&gt;
  ';
  begin
  lxml := XMLTYPE (l_transformxml).createschemabasedxml ('VendorPriceFileTemplate_Volume.xsd');
     XMLTYPE.schemavalidate (lxml);
  
     IF lxml.isschemavalid () = 1
     THEN
        DBMS_OUTPUT.put_line ('XSD validation success');
     END IF;
  EXCEPTION
     WHEN OTHERS
     THEN
        l_err := SUBSTR (SQLERRM, 1, 4000);
        DBMS_OUTPUT.put_line ('Error: ' || l_err);
  END;
  </code></pre>