2 Replies Latest reply on Jun 15, 2017 6:17 AM by Etbin

    Schema validation fails in Oracle but succeeds on external validation

    Etbin

      Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production on Exadata

       

      I'd like to know if there are any problems regarding schema validation reported for the version above.

      Colleagues say schema registration didn't throw any errors.

       

      select schema_url from user_xml_schemas

       

      returns

       

      CRS.jpg

      we were given AEOIDAC2_ZeroData_v1.xsd too, but it wasn't requested during registration.

      Running

       

      declare

        xContent xmltype;

        nRetVal  number;

      begin

        select report into xContent from crs_report_xml where pk = 1;

        nRetVal := xContent.isSchemaValid('CrsXML_v1.0.xsd');

        xContent.schemaValidate();

      end;

       

      Error report -

      ORA-19030: Method invalid for non-schema based XML Documents.

      ORA-06512: at "SYS.XMLTYPE", line 354

      ORA-06512: at line 7

      1. 19030. 00000 -  "Method invalid for non-schema based XML Documents."

      *Cause: The method can be invoked on only schema based xmltype objects.

      *Action: Don't invoke the method for non schema based xmltype objects.

       

      while validating the same document against the same set of *.xsd files with an external validator the document is declared valid.

       

      It's my first time dealing with such a validation.

      Any suggestions for how to proceed ?

       

      Regards

       

      Etbin