Generate xml from table data--oracle 12c -


how generate below xml. requirement self close tag productiondata.

required output--

<header>      <meterunit sno="1"    meterid="121">          <productiondata   manufacture="abc"/>      </meterunit> </header>  table details: tablename: meterinfo. columnname: sno, meterid, manufacture. data:1 121 abc 

my query--

select xmlelement("header",         xmlelement("meterunit",xmlattributes(sno sno, meterid meterid),xmlelement("productiondata",xmlattributes(manufacture manufacture))))              meterinfo; 

my output

<header>     <meterunit sno="1" meterid="121">         <productiondata   manufacture="abc"></productiondata>     </meterunit> </header> 

don't use xmlroot, introduced placeholder while xmlserialize() function being standardized. appear want add xml declaration. function of xml serialization , should added using xmlserialize(), turns xml object text..


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -