Groups | Blog | Home
all groups > dotnet xml > october 2005 >

dotnet xml : XmlTextWriter and whitespace



st NO[at]SPAM jpa.co.jp
10/6/2005 2:24:48 AM
Hi,

I've a routine that exports a DB query to Excel by building an
XmlDocument and saving to a XmlTextWriter.

The function works but new lines don't show up, i.e. significant
whitespace is cut. I've tried adding WriteAttributeString("xml",
"space", null, "preserve") to the XmlTextWriter just prior to save, but
that results in the error: "Index was outside the bounds of the array."

Can anyone assist?

Many thanks,

Simon Lane
Zafar Abbas
10/6/2005 12:13:17 PM
Have you tried playing with the PreserveWhitespace property of XmlDocument?

[quoted text, click to view]

AddThis Social Bookmark Button