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

Forum statistics

Threads
473,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top