Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Canonicalizing xml

Status
Not open for further replies.

sem

Programmer
Jun 3, 2000
4,709
UA
I need to write data from xmldom.DOMNode variable to a varchar2 table field, but xmldom.writeToBuffer produces indentations that waste a lot of space. Is there any way to manage identations, preferably to get rid of them at all?
 
[/code]
declare
doc xmldom.DOMDocument;
applNode xmldom.DOMNode;
subApplNode xmldom.DOMNode;
element xmldom.DOMElement;
result varchar2(4000);
begin
doc := xmldom.newDOMDocument();
element := xmldom.createElement(doc, 'Application');
applNode := xmldom.appendChild(xmldom.makeNode(doc),
xmldom.makeNode(element));
element := xmldom.createElement(doc, 'SubApplication');
applNode := xmldom.appendChild(applNode,
xmldom.makeNode(element));
xmldom.writeToBuffer(doc, result);

end;

[/code]

Now the length of result is 93 bytes. Actually without any loss of information it may (and must!) be 87.
In my specific case (document is far more complex :) ) the difference is more than 100 bytes and I need them badly as the third party application requires that xml to be inserted into varchar2 field.

Regards, Dima
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top