Hello,
I generate an XML using code like
SELECT XMLELEMENT(
"Document"
,XMLAttributes(
'urn:iso:std:iso:20022:tech:xsd:pain.001.002.99' AS "xmlns"
,'http://www.w3.org/2001/XMLSchema-instance' AS "xmlns:xsi"
,'urn:iso:std:iso:20022:tech:xsd:pain.001.002.99 pain.001.002.99.xsd' AS "xsi:schemaLocation"
)
)
FROM dual;
The result ist
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.002.99"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:pain.001.002.99 pain.001.002.99.xsd">
</Document>
But I need
<?xml version="1.0" encoding="UTF-8"?>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.002.99"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:pain.001.002.99 pain.001.002.99.xsd">
</Document>
Can I add the header within my select?
The XMLTYPE is inserted into a table and from there transfered via webutil to a client location.
I found that I can convert the XMLTYPE to a DOM document and then use dbms_XMLDom.setCharset, but how can I convert it back to a XMLTYPE. The only way I found is to convert it to a CLOB and then into a XMLTYPE.
Regards
Marcus
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production