insert xml into column STORE AS BINARY XML ALLOW ANYSCHEMA fails
77111Jul 28 2009 — edited Jul 28 2009I'm getting the error "ORA-44422: nonschema XML disallowed for this column" when trying to insert a schema based xml into a column marked with allow anyschema. I'm using Oracle 11.1.0.6.0.
1. create the table:
CREATE TABLE testxml (key VARCHAR2(30), flags NUMBER(10), data XMLType)
XMLTYPE COLUMN "DATA" STORE AS BINARY XML ALLOW ANYSCHEMA;
2. validate and try to insert the xml:
SET SERVEROUTPUT ON
declare
x XMLType;
xschema XMLType;
begin
x := XMLType(bfilename('XMLDIR', 'test.xml'), nls_charset_id('AL32UTF8'));
xschema := x.CreateSchemaBasedXml('http://auto3p.com/ascard/ascard.xsd');
xschema.SchemaValidate();
DBMS_OUTPUT.PUT_LINE('Schema: ' || xschema.GetSchemaURL() || ' Validated: ' || xschema.IsSchemaValidated());
insert into testxml (key,data) values ('123', xschema);
end;
*/*
Schema: http://auto3p.com/ascard/ascard.xsd Validated: 1
declare
***
ERROR at line 1:
ORA-44422: nonschema XML disallowed for this column
ORA-06512: at line 9
3. the test.xml root tag:
<card xmlns="http://auto3p.com/ascard" action="replace">...
4. The schema root tag:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://auto3p.com/ascard"
xmlns="http://auto3p.com/ascard"
elementFormDefault ="qualified">
<xs:element name="card" type="ASCardObj_30839_ComplexType" />....