Hello,
I have to export some xml data into files from our db. Since the xsd has changed it cannot be exported directly onto another db of a third party tool and I have (among other things) to remove an attribute from an element
CREATE TABLE xml_test(
message XMLTYPE
)
/
INSERT INTO xml_test
VALUES (q'[<?xml version="1.0" encoding="ISO-8859-1"?>
<ZusyMeldung xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.zusy.de/2002/XMLSchema"
xsi:schemaLocation="http://www.zusy.de/2002/XMLSchema ZusyAZ01.xsd">
<TransferHeader xsi:nil="true"/>
<Daten>
A lot more elements
</Daten>
</ZusyMeldung>/
COMMIT;
<TransferHeader xsi:nil="true"/> should become <TransferHeader/>.
I want to write the files directly with the following script and tried to use
updateXML in my SELECT but somehow I don't get it right.
DECLARE
CURSOR cur_out IS
SELECT message
FROM xml_test;
BEGIN
FOR r_out IN cur_out LOOP
dbms_xslprocessor.clob2file (
r_out.message
,'DIR_XMLOUT'
,'out_name.xml'
,0
);
END LOOP;
END;
/
Regards
Marcus