On 01/08/12 14:59, Joe Kesselman wrote:
> On 8/1/2012 9:17 AM,
mike...@yahoo.co.uk wrote:
>> On Monday, August 19, 2002 7:29:31 PM UTC+1, rdclk23 wrote:
>>> I have created an XML file using the Microsoft DOM, and all of the
>>> nodes / elements are strung together as one very long line when viewed
>>> in an editor. When the XML file is parsed, the line / column error
>>> messages all say line 2, column # (very large)....
>
> Remember, whitespace in an XML document is part of the document's
> content, and adding whitespace changes that content -- potentially
> changing the results of processing that document. As a result, XML tools
> tend not to indent/pretty-print the XML unless you explicitly instruct
> them to do so.
>
> I haven't worked with the Microsoft implementation in an age and a half,
> so I can't advise you on whether there's an easy switch you can turn on
> to force pretty-printing. But before doing so, you do have to look at
> the application which will be consuming this document and make sure it
> can tolerate that whitespace.
>
> If you want to do this in a more controlled manner, your DOM application
> needs to insert explicit text nodes to represent the whitespace. (That's
> essentially what the pretty-printer does.)