Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Remove Whitespace from XML

user5722493Feb 18 2019 — edited Feb 28 2019

Hi All,

I am generating an XML file using DBMS_XMLDOM.DOMNode and generating node using DBMS_XMLDOM.appendChild.

Finally writing to file using DBMS_XMLDOM.WRITETOFILE.

XML data is populating from an Oracle table.

But the issue is, the XML is generating with white spaces, like below (xml is opened in Notepad++)

  

<?xml version="1.0" encoding="UTF-8"?>

<CampaignSchedule xmlns="http://dummy.new.com/schemas/schedule/111111">    

  <Agency>

        <AgencyName>Dummy</AgencyName>

      </Advertiser>

      <Product>

        <ProductName>Apple</ProductName>

      </Product>

 

Where as I would like create the XML without the whitespace and if I open the same in Notepad++, should display like below:

<?xml version="1.0" encoding="UTF-8"?><CampaignSchedule xmlns="http://dummy.new.com/schemas/schedule/111111"> <Agency> <AgencyName>Dummy</AgencyName> </Advertiser>      <Product> <ProductName>Apple</ProductName> </Product>

It would be nice, if anyone can put some light on this issue.

Thanks with Regards,

JD

Comments

Processing

Post Details

Added on Feb 18 2019
10 comments
4,532 views