set timing on
--
declare
  schemaDiff XMLType;
  res boolean;
begin
  select xmlDiff
     (
       xdburitype('/home/OE/purchaseOrder.xsd').getXML(),
       xdburitype('/home/OE/purchaseOrder.v2.xsd').getXML()
     )
  into schemaDiff
  from dual;

  if (dbms_xdb.existsResource('/home/OE/poSchemaDiff.xml')) then
      dbms_xdb.deleteResource('/home/OE/poSchemaDiff.xml');
  end if;
 
  res := dbms_xdb.createResource('/home/OE/poSchemaDiff.xml',schemaDiff);

  dbms_xmlschema.inPlaceEvolve('http://localhost:8080/source/schemas/poSource/xsd/purchaseOrder.xsd',
                                schemaDiff, 1);
end;                                                       
/

