Why '<?xml version="1.0" encoding="UTF-8"?>' is not appearing in XML ( 9.2)
57043Jan 16 2007 — edited Jan 16 2007Hi,
I am using following SQL query to generate output from XML
select
XMLTYPE
('<?xml version="1.0" encoding="UTF-8"?>'||
xmlelement("bank",
XMLATTRIBUTES('http://www.w3.org/2001/XMLSchema' AS "xmlns:xsi",
'http://www.XXXX.xsd' AS "xsi:nonamespaceSchemaLocation" ),
xmlelement("Transaction",
xmlforest(
intraday "MessageCode",
actnum "ToAccountNo",
v00090 "ToBranchCode",
v00230 "CurrencyCode",
amt "Amount",
trandt "TransactionDate",
valuedt "ValueDate"),
xmlelement("CustomerRefNo",
xmlforest(
utr_number "ReferenceNo1",
ref1 "ReferenceNo2",
ref2 "Custtype",
r1 "SequenceNo"
)))))
x1
from
(
...
...
...
...
)
It is working fine but '<?xml version="1.0" encoding="UTF-8"?>' it is not coming as header of output My output is coming like
<bank xmlns:xsi="http://www.w3.org/2001/XMLSchema" xsi:nonamespaceSchemaLocation="http://www.XXXX.xsd">
<Transaction>
<MessageCode>0100</MessageCode>
<ToAccountNo>012340123456</ToAccountNo>
<ToBranchCode>01234</ToBranchCode>
<CurrencyCode>INR</CurrencyCode>
<Amount>11.00</Amount>
<TransactionDate>2007-01-15T17:54:31</TransactionDate>
<ValueDate>2007-01-15</ValueDate>
..
...
Kindly help.
PJP