Hi,
i am using oracle 11.2.0.4 on windows 2016 64 bit.
I have a table with invoice number and an xmltype column to store xml data. I would like to create a xml document with invoice_number.xml in a directory.
I tried using below methods but they create additional tags at the beginning of xml document.
DECLARE
rc sys_refcursor;
BEGIN
OPEN rc FOR SELECT invoice_xml FROM invoice_xml_info where invoice_number='571306';
dbms_xslprocessor.clob2file( xmltype( rc ).getclobval( ) , 'XT_DIR','clob2file.xml');
END;
Output is as below
<?xml version="1.0"?>
<ROWSET>
<ROW>
<INVOICE_XML>
<Invoice xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">
<cbc:ID>571306</cbc:ID>
.......
I dont want the first 3 tags (need xml version) to appear in my xml document. Please advice.