XmlTextWriter and whitespace

S

st

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
 
S

Scott Allen

Hi Simon:

Have you tried setting the PreserveWhitespace property on your
XmlDocument object to true?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,888
Messages
2,569,964
Members
46,293
Latest member
BonnieHamb

Latest Threads

Top