1. Computing

Format XML Data using Delphi - Properly Indent TXMLDocument XML Tags Without doNodeAutoIndent

By November 1, 2011

Follow me on:

in TXmlDocument :: When using the TXMLDocument to create XML documents you might receive a nasty EOleException: This operation can not be performed with a Node of type PCDATA.

If you want the resulting XML to look "pretty" - so that each element node appears on its own line, indented appropriately to reflect its nesting in the node hierarchy, you might be adding the doNodeAutoIndent flag in the Options property of the TXMLDocument instance.

Read the full article to learn how to Fix the "This operation can not be performed with a Node of type PCDATA" when using doNodeAutoIndent


November 1, 2011 at 11:47 am
(1) Sauro says:

FormatXMLDoc doesn’t produce good looking XML because it doesn’t indent enough, it’s also not configurable. I would recommend instead using xmllint.exe, it produces much nicer looking XML.

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

©2014 About.com. All rights reserved.